blob: 0c539003842a1b50ee78dee0ff5ce7b5b886e550 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 %s -emit-llvm -o %t
2
3int b(char* x);
4
5// Extremely basic VLA test
6void a(int x) {
7 char arry[x];
8 arry[0] = 10;
9 b(arry);
10}
11
12int c(int n)
13{
14 return sizeof(int[n]);
15}
16
17int f0(int x) {
18 int vla[x];
19 return vla[x-1];
20}
21
22void
23f(int count)
24{
25 int a[count];
26
27 do { } while (0);
28
29 if (a[0] != 3) {
30 }
31}
32
33void g(int count) {
34 // Make sure we emit sizes correctly in some obscure cases
35 int (*a[5])[count];
36 int (*b)[][count];
37}