File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
regression/ansi-c/gcc_builtins6 Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <stddef.h>
2+
3+ struct S
4+ {
5+ int x ;
6+ union {
7+ int y ;
8+ struct S2
9+ {
10+ int z ;
11+ } s [1 ];
12+ } u [2 ];
13+ };
14+
15+ int main ()
16+ {
17+ int A [offsetof(struct S , u [0 ].y )== sizeof (int )?1 :-1 ];
18+ #if defined(__GNUC__ ) && !defined(__clang__ )
19+ int B [offsetof(struct S , u -> y )== sizeof (int )?1 :-1 ];
20+ int C [offsetof(struct S , u -> s [0 ].z )== sizeof (int )?1 :-1 ];
21+ #endif
22+ return 0 ;
23+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ --
7+ ^warning: ignoring
8+ ^CONVERSION ERROR$
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ extern char *yyansi_ctext;
2222
2323#include " parser_static.inc"
2424
25+ #include " literals/convert_integer_literal.h"
26+
2527#include " ansi_c_y.tab.h"
2628
2729// statements have right recursion, deep nesting of statements thus
@@ -425,6 +427,17 @@ offsetof_member_designator:
425427 mto ($2 , $3 );
426428 mto ($$, $2 );
427429 }
430+ | offsetof_member_designator TOK_ARROW member_name
431+ {
432+ $$ =$1 ;
433+ set ($2 , ID_index);
434+ exprt tmp=convert_integer_literal(" 0" );
435+ stack ($2 ).move_to_operands(tmp);
436+ mto ($$, $2 );
437+ set ($2 , ID_member);
438+ stack ($2 ).set(ID_component_name, stack($3 ).get(ID_C_base_name));
439+ mto ($$, $2 );
440+ }
428441 ;
429442
430443quantifier_expression :
You can’t perform that action at this time.
0 commit comments