gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / pr34457-1.c
blob3dca13df0933e66887f54e6b2b9b2d934c1a4f31
1 /* PR c/34457 */
2 /* { dg-do link } */
3 /* { dg-require-effective-target trampolines } */
4 /* { dg-require-effective-target lto } */
5 /* { dg-options "-flto -O2" } */
6 /* { dg-additional-sources "pr34457-2.c" } */
9 typedef __SIZE_TYPE__ size_t;
10 extern int printf (const char *, ...);
11 extern void *memset (void *, int, size_t);
13 int bar (int (*p)(), int q, void *r) {}
15 int
16 main(int argc, char **argv)
18 struct s { int a; char b[argc]; };
19 int nested (struct s x) { return x.a + sizeof(x); }
20 struct s t;
21 memset (&t, 0, sizeof(t));
22 t.a = 123;
23 printf("%d\n", bar (nested, argc, &t));
24 return 0;