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