[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / OpenMP / metadirective_device_isa_codegen_amdgcn.cpp
blobcbb75c4a68376a306808443a8401f8695814b894
1 // REQUIRES: amdgpu-registered-target
3 // 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
4 // 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
5 // expected-no-diagnostics
7 #ifndef HEADER
8 #define HEADER
10 int amdgcn_device_isa_selected() {
11 int threadCount = 0;
13 #pragma omp target map(tofrom \
14 : threadCount)
16 #pragma omp metadirective \
17 when(device = {isa("dpp")} \
18 : parallel) default(single)
19 threadCount++;
22 return threadCount;
25 // CHECK: define weak_odr protected amdgpu_kernel void @__omp_offloading_{{.*}}amdgcn_device_isa_selected
26 // CHECK: user_code.entry:
27 // CHECK: call void @__kmpc_parallel_51
28 // CHECK-NOT: call i32 @__kmpc_single
29 // CHECK: ret void
31 int amdgcn_device_isa_not_selected() {
32 int threadCount = 0;
34 #pragma omp target map(tofrom \
35 : threadCount)
37 #pragma omp metadirective \
38 when(device = {isa("sse")} \
39 : parallel) \
40 when(device = {isa("another-unsupported-gpu-feature")} \
41 : parallel) default(single)
42 threadCount++;
45 return threadCount;
47 // CHECK: define weak_odr protected amdgpu_kernel void @__omp_offloading_{{.*}}amdgcn_device_isa_not_selected
48 // CHECK: user_code.entry:
49 // CHECK: call i32 @__kmpc_single
50 // CHECK-NOT: call void @__kmpc_parallel_51
51 // CHECK: ret void
53 #endif