aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/vla.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/vla.c')
-rw-r--r--test/CodeGen/vla.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/vla.c b/test/CodeGen/vla.c
index 06d17b88d3..fa7a22fd0b 100644
--- a/test/CodeGen/vla.c
+++ b/test/CodeGen/vla.c
@@ -73,3 +73,15 @@ void test1() {
function(1, bork[2]);
}
+// rdar://8476159
+static int GLOB;
+int test2(int n)
+{
+ GLOB = 0;
+ char b[1][n+3]; /* Variable length array. */
+ // CHECK: [[tmp_1:%.*]] = load i32* @GLOB, align 4
+ // CHECK-NEXT: add nsw i32 [[tmp_1]], 1
+ __typeof__(b[GLOB++]) c;
+ return GLOB;
+}
+