aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/vla12.C
blob: ad52daf5b2ea86324aa904d799e1f87036c917a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// VLA sizeof test
// { dg-do compile }
// { dg-options "" }
// { dg-require-effective-target alloca }

int
f1 (int i)
{
  char a[sizeof (i) + 6 + i];
  char b[sizeof (a) + 1];
  return sizeof (b);
}

int
f2 (int i)
{
  char a[sizeof (i) + 6 + i];
  char b[sizeof (a)];
  return sizeof (b);
}

int
f3 (int i)
{
  char a[sizeof (i) + 6 + i];
  char b[sizeof (i) + i];
  char c[sizeof (a) + sizeof (b) + 7];
  return sizeof (c);
}