diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-10-29 12:21:55 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-10-29 12:21:55 +0000 |
commit | 4ed019aabebd185a56a7cfa155739ca646452047 (patch) | |
tree | fe9e8c8ea34e1e6600e1c0c6d52e8d683c6bb8a6 /test/CodeGen/captured-statements.c | |
parent | 5926ec6f1e60858350ab783dae8cccfae4322c0c (diff) | |
download | clang-4ed019aabebd185a56a7cfa155739ca646452047.tar.gz |
Improved capturing variable-length array types in CapturedStmt.
An updated implemnentation of VLA types capturing based on previously committed solution for Lambdas.
This version captures the whole VLA type instead of particular variables which are part of VLA size expression and allows to use previusly calculated size of VLA type in captured regions. Required for OpenMP.
Differential Revision: http://reviews.llvm.org/D5099
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220850 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/captured-statements.c')
-rw-r--r-- | test/CodeGen/captured-statements.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/CodeGen/captured-statements.c b/test/CodeGen/captured-statements.c index 85d597aeb3..52747fba1e 100644 --- a/test/CodeGen/captured-statements.c +++ b/test/CodeGen/captured-statements.c @@ -4,6 +4,8 @@ // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-2 // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-3 +typedef __INTPTR_TYPE__ intptr_t; + int foo(); int global; @@ -61,15 +63,16 @@ void test3(int size) { } // Capture VLA array -void test4(int size, int vla_arr[size]) { +void test4(intptr_t size, intptr_t 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: test4([[INTPTR_T:i.+]] {{.*}}[[SIZE_ARG:%.+]], [[INTPTR_T]]* + // CHECK-3: store [[INTPTR_T]] {{.*}}[[SIZE_ARG]], [[INTPTR_T]]* [[SIZE_ADDR:%.+]], + // CHECK-3: [[SIZE:%.+]] = load [[INTPTR_T]]* [[SIZE_ADDR]], // CHECK-3: [[REF:%.+]] = getelementptr inbounds - // CHECK-3: store [[INT]]* [[SIZE_ADDR]], [[INT]]** [[REF]] + // CHECK-3: store [[INTPTR_T]] [[SIZE]], [[INTPTR_T]]* [[REF]] // CHECK-3: call void @__captured_stmt } |