Debian Codegraph @

gcc/testsuite/gcc.dg/nested-vla-2.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-std=gnu99" } */
3 /* { dg-require-effective-target trampolines } */
4
5
6 int main()
7 {
8 int n = 1;
9
10 char tmp[2] = { 0 };
11 typeof(char (*)[++n]) bar(void) { return &tmp; }
12
13 if (2 != n)
14 __builtin_abort();
15
16 if (2 != sizeof(*bar()))
17 __builtin_abort();
18
19 if (2 != n)
20 __builtin_abort();
21
22 n = 1;
23
24 typeof(char (*)[++n]) (*bar2)(void) = bar;
25
26 if (2 != n)
27 __builtin_abort();
28
29 if (2 != sizeof(*(*bar2)()))
30 __builtin_abort();
31
32 if (2 != n)
33 __builtin_abort();
34 }
35