Skip to content

Commit b90c4a3

Browse files
author
Daniel Kroening
authored
Merge pull request #1256 from tautschnig/c-attributes-fix
C attributes parsing fix
2 parents 6440fc2 + 1ab944e commit b90c4a3

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#define STATIC_ASSERT(condition) \
2+
int array##__LINE__[(condition) ? 1 : -1]
3+
4+
#ifdef __GNUC__
5+
6+
int x __attribute__ ((__vector_size__ (12), __may_alias__));
7+
int x2 __attribute__ ((__may_alias__));
8+
int x3 __attribute__ ((__may_alias__, __vector_size__ (12)));
9+
10+
STATIC_ASSERT(sizeof(x)==12);
11+
STATIC_ASSERT(sizeof(x2)==sizeof(int));
12+
STATIC_ASSERT(sizeof(x3)==12);
13+
14+
#endif
15+
16+
int main(int argc, char* argv[])
17+
{
18+
return 0;
19+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

regression/ansi-c/gcc_attributes5/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33

44
^EXIT=0$

src/ansi-c/parser.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ gcc_attribute_list:
15451545
gcc_attribute
15461546
| gcc_attribute_list ',' gcc_attribute
15471547
{
1548-
$$=merge($1, $2);
1548+
$$=merge($1, $3);
15491549
}
15501550
;
15511551

0 commit comments

Comments
 (0)