2008-12-21 07:11:59 +08:00
|
|
|
// RUN: clang %s -emit-llvm -o %t
|
|
|
|
|
|
|
|
int b(char* x);
|
|
|
|
|
|
|
|
// Extremely basic VLA test
|
|
|
|
void a(int x) {
|
|
|
|
char arry[x];
|
|
|
|
arry[0] = 10;
|
|
|
|
b(arry);
|
|
|
|
}
|
2008-12-21 11:33:21 +08:00
|
|
|
|
2008-12-21 11:40:32 +08:00
|
|
|
int c(int n)
|
2008-12-21 11:33:21 +08:00
|
|
|
{
|
2008-12-21 11:40:32 +08:00
|
|
|
return sizeof(int[n]);
|
2008-12-21 11:33:21 +08:00
|
|
|
}
|
2009-02-10 05:48:07 +08:00
|
|
|
|
|
|
|
int f0(int x) {
|
|
|
|
int vla[x];
|
|
|
|
return vla[x-1];
|
|
|
|
}
|
2009-02-11 06:50:24 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
f(int count)
|
|
|
|
{
|
|
|
|
int a[count];
|
|
|
|
|
|
|
|
do { } while (0);
|
|
|
|
|
|
|
|
if (a[0] != 3) {
|
|
|
|
}
|
|
|
|
}
|