diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2021-07-09 14:13:34 +0300 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2021-07-09 14:16:54 +0300 |
commit | 329f8197ef59f9bd23328b52d623ba768b51dbb2 (patch) | |
tree | 80b3cb43d5e875d7b93b435c0e733d435e1d7579 | |
parent | 1440d4564f79b2f7bee8fc25fc9596f10c6aa3a6 (diff) | |
download | llvm-329f8197ef59f9bd23328b52d623ba768b51dbb2.zip llvm-329f8197ef59f9bd23328b52d623ba768b51dbb2.tar.gz llvm-329f8197ef59f9bd23328b52d623ba768b51dbb2.tar.bz2 |
[NFC][Clang][CodegenOpenCL] Fix test not to rely on volatile store not being removed
-rw-r--r-- | clang/test/CodeGenOpenCL/convergent.cl | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/test/CodeGenOpenCL/convergent.cl b/clang/test/CodeGenOpenCL/convergent.cl index 1905d7d..a69b3d7 100644 --- a/clang/test/CodeGenOpenCL/convergent.cl +++ b/clang/test/CodeGenOpenCL/convergent.cl @@ -3,11 +3,10 @@ // This is initially assumed convergent, but can be deduced to not require it. -// CHECK-LABEL: define{{.*}} spir_func void @non_convfun() local_unnamed_addr #0 +// CHECK-LABEL: define{{.*}} spir_func void @non_convfun(i32* %p) local_unnamed_addr #0 // CHECK: ret void __attribute__((noinline)) -void non_convfun(void) { - volatile int* p; +void non_convfun(volatile int* p) { *p = 0; } @@ -28,29 +27,29 @@ void g(void); // non_convfun(); // } // -// CHECK-LABEL: define{{.*}} spir_func void @test_merge_if(i32 %a) local_unnamed_addr #1 { +// CHECK-LABEL: define{{.*}} spir_func void @test_merge_if(i32 %a, i32* %p) local_unnamed_addr #1 { // CHECK: %[[tobool:.+]] = icmp eq i32 %a, 0 // CHECK: br i1 %[[tobool]], label %[[if_end3_critedge:.+]], label %[[if_then:.+]] // CHECK: [[if_then]]: // CHECK: tail call spir_func void @f() -// CHECK: tail call spir_func void @non_convfun() +// CHECK: tail call spir_func void @non_convfun(i32* %p) // CHECK: tail call spir_func void @g() // CHECK: br label %[[if_end3:.+]] // CHECK: [[if_end3_critedge]]: -// CHECK: tail call spir_func void @non_convfun() +// CHECK: tail call spir_func void @non_convfun(i32* %p) // CHECK: br label %[[if_end3]] // CHECK: [[if_end3]]: // CHECK: ret void -void test_merge_if(int a) { +void test_merge_if(int a, volatile int* p) { if (a) { f(); } - non_convfun(); + non_convfun(p); if (a) { g(); } |