From de3ad89b60e5751779c73ccc6f7726653b40a6c0 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Sun, 20 Aug 2017 13:54:10 +0100 Subject: [PATCH 1/2] Test passes It even was passing at 5cba7ec0ac6, it's not clear why it had been marked as failing. --- regression/ansi-c/gcc_attributes5/test.desc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regression/ansi-c/gcc_attributes5/test.desc b/regression/ansi-c/gcc_attributes5/test.desc index fc2b1874059..466da18b2b5 100644 --- a/regression/ansi-c/gcc_attributes5/test.desc +++ b/regression/ansi-c/gcc_attributes5/test.desc @@ -1,4 +1,4 @@ -KNOWNBUG +CORE main.c ^EXIT=0$ From 1ab944e42ff6eaf4db7d5bbf5aa00833d01de848 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Sun, 20 Aug 2017 13:54:57 +0100 Subject: [PATCH 2/2] Merge the correct attribute node Fixes a parser off-by-one error. --- regression/ansi-c/gcc_attributes10/main.c | 19 +++++++++++++++++++ regression/ansi-c/gcc_attributes10/test.desc | 8 ++++++++ src/ansi-c/parser.y | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 regression/ansi-c/gcc_attributes10/main.c create mode 100644 regression/ansi-c/gcc_attributes10/test.desc diff --git a/regression/ansi-c/gcc_attributes10/main.c b/regression/ansi-c/gcc_attributes10/main.c new file mode 100644 index 00000000000..cf52787176e --- /dev/null +++ b/regression/ansi-c/gcc_attributes10/main.c @@ -0,0 +1,19 @@ +#define STATIC_ASSERT(condition) \ + int array##__LINE__[(condition) ? 1 : -1] + +#ifdef __GNUC__ + +int x __attribute__ ((__vector_size__ (12), __may_alias__)); +int x2 __attribute__ ((__may_alias__)); +int x3 __attribute__ ((__may_alias__, __vector_size__ (12))); + +STATIC_ASSERT(sizeof(x)==12); +STATIC_ASSERT(sizeof(x2)==sizeof(int)); +STATIC_ASSERT(sizeof(x3)==12); + +#endif + +int main(int argc, char* argv[]) +{ + return 0; +} diff --git a/regression/ansi-c/gcc_attributes10/test.desc b/regression/ansi-c/gcc_attributes10/test.desc new file mode 100644 index 00000000000..466da18b2b5 --- /dev/null +++ b/regression/ansi-c/gcc_attributes10/test.desc @@ -0,0 +1,8 @@ +CORE +main.c + +^EXIT=0$ +^SIGNAL=0$ +-- +^warning: ignoring +^CONVERSION ERROR$ diff --git a/src/ansi-c/parser.y b/src/ansi-c/parser.y index 0819265fe70..bddccced310 100644 --- a/src/ansi-c/parser.y +++ b/src/ansi-c/parser.y @@ -1545,7 +1545,7 @@ gcc_attribute_list: gcc_attribute | gcc_attribute_list ',' gcc_attribute { - $$=merge($1, $2); + $$=merge($1, $3); } ;