]> granicus.if.org Git - clang/commitdiff
Added test for capturing VLA types if the captured variable is a function parameter.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 2 Jul 2014 07:05:22 +0000 (07:05 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 2 Jul 2014 07:05:22 +0000 (07:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212170 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/captured-statements.c

index 4ff87910c22ff425f5e66500c3fe9c358b51eb01..feb12673f0b50b740d9a603f4ee5ebbb91fcdb17 100644 (file)
@@ -60,6 +60,19 @@ void test3(int size) {
   // CHECK-3: call void @__captured_stmt
 }
 
+// Capture VLA array
+void test4(int size, int vla_arr[size]) {
+  #pragma clang __debug captured
+  {
+    vla_arr[0] = 1;
+  }
+  // CHECK-3: test4([[INT:i.+]] [[SIZE:.+]], [[INT]]*
+  // CHECK-3: store [[INT]] [[SIZE]], [[INT]]* [[SIZE_ADDR:.+]],
+  // CHECK-3: [[REF:%.+]] = getelementptr inbounds
+  // CHECK-3: store [[INT]]* [[SIZE_ADDR]], [[INT]]** [[REF]]
+  // CHECK-3: call void @__captured_stmt
+}
+
 void dont_capture_global() {
   static int s;
   extern int e;