1- // REQUIRES: amdgpu-registered-target
2-
3- // RUN: %clang_cc1 -fopenmp -fno-openmp-target-big-jump-loop - x c++ -w -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-ppc-host.bc
4- // RUN: %clang_cc1 -fopenmp -fno-openmp-target-big-jump-loop - x c++ -w -std=c++11 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -target-cpu gfx906 -o - | FileCheck %s
1+ // RUN: %clang_cc1 -fopenmp -x c++ -w -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-ppc-host.bc
2+ // RUN: %clang_cc1 -fopenmp -x c++ -w -std=c++11 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -target-cpu gfx906 -o - | FileCheck %s
3+ // RUN: %clang_cc1 -fopenmp -x c++ -w -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=spirv64-intel -emit-llvm-bc %s -o %t-ppc-spirv -host.bc
4+ // RUN: %clang_cc1 -fopenmp -x c++ -w -std=c++11 -triple spirv64-intel -fopenmp-targets=spirv64-intel -emit-llvm %s -fopenmp-is-target- device -fopenmp-host-ir-file-path %t-ppc-spirv- host.bc -o - | FileCheck %s
55// expected-no-diagnostics
66
77
@@ -16,6 +16,12 @@ Inspired from SOLLVE tests:
1616
1717#define N 1024
1818
19+ #ifdef __AMDGPU__
20+ #define GPU " amdgcn"
21+ #else
22+ #define GPU " spirv64"
23+ #endif
24+
1925int metadirective1 () {
2026
2127 int v1[N], v2[N], v3[N];
@@ -26,7 +32,7 @@ int metadirective1() {
2632 #pragma omp target map(to:v1,v2) map(from:v3, target_device_num) device(default_device)
2733 {
2834 #pragma omp metadirective \
29- when (device={arch (" amdgcn " )}: teams distribute parallel for ) \
35+ when (device={arch (GPU )}: teams distribute parallel for ) \
3036 default (parallel for )
3137
3238 for (int i = 0 ; i < N; i++) {
@@ -38,28 +44,28 @@ int metadirective1() {
3844 return errors;
3945}
4046
41- // CHECK: define weak_odr protected amdgpu_kernel void @[[METADIRECTIVE:.+metadirective1[a-z0-9_]+]]
47+ // CHECK: define weak_odr protected {{amdgpu|spir}}_kernel void @[[METADIRECTIVE:.+metadirective1[a-z0-9_]+]]
4248// CHECK: entry:
43- // CHECK: %{{[0-9]}} = call i32 @__kmpc_target_init
49+ // CHECK: %{{[0-9]}} = call{{.*}} i32 @__kmpc_target_init
4450// CHECK: user_code.entry:
45- // CHECK: call void @[[METADIRECTIVE]]_omp_outlined
46- // CHECK-NOT: call void @__kmpc_parallel_51
51+ // CHECK: call{{.*}} void @[[METADIRECTIVE]]_omp_outlined
52+ // CHECK-NOT: call{{.*}} void @__kmpc_parallel_60
4753// CHECK: ret void
4854
4955
5056// CHECK: define internal void @[[METADIRECTIVE]]_omp_outlined
5157// CHECK: entry:
52- // CHECK: call void @__kmpc_distribute_static_init
58+ // CHECK: call{{.*}} void @__kmpc_distribute_static_init
5359// CHECK: omp.loop.exit:
54- // CHECK: call void @__kmpc_distribute_static_fini
60+ // CHECK: call{{.*}} void @__kmpc_distribute_static_fini
5561
5662
5763// CHECK: define internal void @[[METADIRECTIVE]]_omp_outlined_omp_outlined
5864// CHECK: entry:
59- // CHECK: call void @__kmpc_for_static_init_4
65+ // CHECK: call{{.*}} void @__kmpc_for_static_init_4
6066// CHECK: omp.inner.for.body:
6167// CHECK: store atomic {{.*}} monotonic
6268// CHECK: omp.loop.exit:
63- // CHECK-NEXT: call void @__kmpc_for_static_fini
69+ // CHECK-NEXT: call{{.*}} void @__kmpc_for_static_fini
6470// CHECK-NEXT: ret void
6571
0 commit comments