2008-01-25 Douglas Gregor <doug.gregor@gmail.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr34457-1.c
blob7a1efed54d94c8577e88a59e0e6ad38dcea66c08
1 /* PR c/34457 */
2 /* { dg-do compile } */
3 /* { dg-options "--combine -O2" } */
4 /* { dg-additional-sources "pr34457-2.c" } */
7 typedef __SIZE_TYPE__ size_t;
8 extern int printf (const char *, ...);
9 extern void *memset (void *, int, size_t);
11 int bar (int (*)(), int, void *);
13 int
14 main(int argc, char **argv)
16 struct s { int a; char b[argc]; };
17 int nested (struct s x) { return x.a + sizeof(x); }
18 struct s t;
19 memset (&t, 0, sizeof(t));
20 t.a = 123;
21 printf("%d\n", bar (nested, argc, &t));
22 return 0;