Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / vla-stexp-8.c
blob5b475eb6cf2061ba2edbe7f2e51995c444f84267
1 /* PR29970, PR91038 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -Wunused-variable" } */
6 int foo0(void)
8 int c = *(*(*({ int n = 10; int (*x)[n][n] = __builtin_malloc(sizeof *x); x; }) + 5) + 5);
9 return c;
12 int foo1(void)
14 int c = *(5 + *(5 + *({ int n = 10; int (*x)[n][n] = __builtin_malloc(sizeof *x); x; })));
15 return c;
18 int bar2(void)
20 int c = (*({ int n = 10; struct { int y[n]; int z; }* x = __builtin_malloc(sizeof *x); x; })).z;
21 return c;
24 int bar3(void)
26 int n = 2; /* { dg-warning "unused variable" } */
27 int c = (*({ int n = 3; /* { dg-warning "unused variable" } */
28 ({ int n = 10; int (*x)[n][n] = __builtin_malloc(sizeof *x); x; }); }))[5][5];
29 return c;
32 int bar3b(void)
34 int n = 2; /* { dg-warning "unused variable" } */
35 int c = (*({ int n = 3; /* { dg-warning "unused variable" } */
36 ({ int n = 10; int (*x)[n][n] = __builtin_malloc(sizeof *x); x; }); }))[0][0];
37 return c;
40 int bar4(void)
42 int n = 2; /* { dg-warning "unused variable" } */
43 int c = *(5 + *( 5 + *({ int n = 3; /* { dg-warning "unused variable" } */
44 ({ int n = 10; int (*x)[n][n] = __builtin_malloc(sizeof *x); x; }); })));
45 return c;