Debian Codegraph @

gcc/testsuite/g++.dg/ext/vla12.C

raw
1 // VLA sizeof test
2 // { dg-do compile }
3 // { dg-options "" }
4
5 int
6 f1 (int i)
7 {
8 char a[sizeof (i) + 6 + i];
9 char b[sizeof (a) + 1];
10 return sizeof (b);
11 }
12
13 int
14 f2 (int i)
15 {
16 char a[sizeof (i) + 6 + i];
17 char b[sizeof (a)];
18 return sizeof (b);
19 }
20
21 int
22 f3 (int i)
23 {
24 char a[sizeof (i) + 6 + i];
25 char b[sizeof (i) + i];
26 char c[sizeof (a) + sizeof (b) + 7];
27 return sizeof (c);
28 }