summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/target_codegen.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2017-10-02 16:32:39 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2017-10-02 16:32:39 +0000
commit931e19bf5132e047e2da79061a011867b22ff12e (patch)
tree6d17ca50a16c88473c92d5098f3e5ca17699a32e /clang/test/OpenMP/target_codegen.cpp
parentf91dc28b7b64e2ad75ccb21d66db3ff5f8b780d4 (diff)
downloadbcm5719-llvm-931e19bf5132e047e2da79061a011867b22ff12e.tar.gz
bcm5719-llvm-931e19bf5132e047e2da79061a011867b22ff12e.zip
[OPENMP] Capture argument of `device` clause for target-based
directives. The argument of the `device` clause in target-based executable directives must be captured to support codegen for the `target` directives with the `depend` clauses. llvm-svn: 314686
Diffstat (limited to 'clang/test/OpenMP/target_codegen.cpp')
-rw-r--r--clang/test/OpenMP/target_codegen.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/OpenMP/target_codegen.cpp b/clang/test/OpenMP/target_codegen.cpp
index 5073fd760c9..8debf92e8ed 100644
--- a/clang/test/OpenMP/target_codegen.cpp
+++ b/clang/test/OpenMP/target_codegen.cpp
@@ -92,14 +92,17 @@ int foo(int n) {
double cn[5][n];
TT<long long, char> d;
- // CHECK: [[RET:%.+]] = call i32 @__tgt_target(i32 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i[[SZ]]* null, i32* null)
+ // CHECK: [[ADD:%.+]] = add nsw i32
+ // CHECK: store i32 [[ADD]], i32* [[CAPTURE:%.+]],
+ // CHECK: [[LD:%.+]] = load i32, i32* [[CAPTURE]],
+ // CHECK: [[RET:%.+]] = call i32 @__tgt_target(i32 [[LD]], i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i[[SZ]]* null, i32* null)
// CHECK-NEXT: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0
// CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]]
// CHECK: [[FAIL]]
// CHECK: call void [[HVT0:@.+]]()
// CHECK-NEXT: br label %[[END]]
// CHECK: [[END]]
- #pragma omp target
+ #pragma omp target device(global + a)
{
}
OpenPOWER on IntegriCloud