diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 173a4f43a911175643bda81ee675e8d9269056ea (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/CodeGen/captured-statements.c | |
parent | 88f7a7d5251a2d813460274c92decc143a11569b (diff) | |
download | FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.zip FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.tar.gz |
Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957
Diffstat (limited to 'test/CodeGen/captured-statements.c')
-rw-r--r-- | test/CodeGen/captured-statements.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/test/CodeGen/captured-statements.c b/test/CodeGen/captured-statements.c index c87c187..85d597a 100644 --- a/test/CodeGen/captured-statements.c +++ b/test/CodeGen/captured-statements.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o %t +// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o %t // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-GLOBALS // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-1 // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-2 @@ -48,17 +48,31 @@ void test2(int x) { // CHECK-2: %i = alloca i32 // Capture array -void test3() { +void test3(int size) { int arr[] = {1, 2, 3, 4, 5}; + int vla_arr[size]; #pragma clang __debug captured { - arr[2] = arr[1]; + arr[2] = vla_arr[size - 1]; } // CHECK-3: test3 // CHECK-3: alloca [5 x i32] // 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; |