r212170 - Added test for capturing VLA types if the captured variable is a function parameter.

Alexey Bataev a.bataev at hotmail.com
Wed Jul 2 00:05:22 PDT 2014


Author: abataev
Date: Wed Jul  2 02:05:22 2014
New Revision: 212170

URL: http://llvm.org/viewvc/llvm-project?rev=212170&view=rev
Log:
Added test for capturing VLA types if the captured variable is a function parameter.

Modified:
    cfe/trunk/test/CodeGen/captured-statements.c

Modified: cfe/trunk/test/CodeGen/captured-statements.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/captured-statements.c?rev=212170&r1=212169&r2=212170&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/captured-statements.c (original)
+++ cfe/trunk/test/CodeGen/captured-statements.c Wed Jul  2 02:05:22 2014
@@ -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;





More information about the cfe-commits mailing list