annotate gcc/testsuite/g++.dg/ext/vla12.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // VLA sizeof test
kono
parents:
diff changeset
2 // { dg-do compile }
kono
parents:
diff changeset
3 // { dg-options "" }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
4 // { dg-require-effective-target alloca }
111
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 int
kono
parents:
diff changeset
7 f1 (int i)
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 char a[sizeof (i) + 6 + i];
kono
parents:
diff changeset
10 char b[sizeof (a) + 1];
kono
parents:
diff changeset
11 return sizeof (b);
kono
parents:
diff changeset
12 }
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 int
kono
parents:
diff changeset
15 f2 (int i)
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 char a[sizeof (i) + 6 + i];
kono
parents:
diff changeset
18 char b[sizeof (a)];
kono
parents:
diff changeset
19 return sizeof (b);
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 int
kono
parents:
diff changeset
23 f3 (int i)
kono
parents:
diff changeset
24 {
kono
parents:
diff changeset
25 char a[sizeof (i) + 6 + i];
kono
parents:
diff changeset
26 char b[sizeof (i) + i];
kono
parents:
diff changeset
27 char c[sizeof (a) + sizeof (b) + 7];
kono
parents:
diff changeset
28 return sizeof (c);
kono
parents:
diff changeset
29 }