Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaOpenCL / block-array-capturing.cl
blob7c886d395b9ee7113d0a6d4b1c6aa8efefcb45df
1 // RUN: %clang_cc1 -O0 -cl-std=CL2.0 -triple spir64-unknown-unknown -emit-llvm %s -o -| FileCheck %s
2 // expected-no-diagnostics
4 typedef int (^block_t)(void);
6 int block_typedef_kernel(global int* res) {
7 // CHECK: %{{.*}} = alloca <{ i32, i32, ptr addrspace(4), [3 x i32] }>
8 int a[3] = {1, 2, 3};
9 // CHECK: call void @llvm.memcpy{{.*}}
10 block_t b = ^(void) { return a[0]; };
11 return b();
14 // CHECK: define {{.*}} @__block_typedef_kernel_block_invoke
15 // CHECK: %{{.*}} = getelementptr inbounds [3 x i32], ptr addrspace(4) %{{.*}}, i64 0, i64 0
16 // CHECK-NOT: call void @llvm.memcpy{{.*}}