1*be9fa9deSFabian Mora!REQUIRES: amdgpu-registered-target, nvptx-registered-target 209b30f40SKiran Chandramohan 309b30f40SKiran Chandramohan!RUN: %flang_fc1 -triple amdgcn-amd-amdhsa -emit-hlfir -fopenmp -fopenmp-is-target-device %s -o - | FileCheck %s 4*be9fa9deSFabian Mora!RUN: %flang_fc1 -triple nvptx64-nvidia-cuda -emit-hlfir -fopenmp -fopenmp-is-target-device %s -o - | FileCheck %s 509b30f40SKiran Chandramohan!RUN: bbc -fopenmp -fopenmp-is-target-device -fopenmp-is-gpu -emit-hlfir -o - %s | FileCheck %s 609b30f40SKiran Chandramohan 709b30f40SKiran Chandramohan!RUN: not %flang_fc1 -triple amdgcn-amd-amdhsa -emit-hlfir -fopenmp %s -o - 2>&1 | FileCheck %s --check-prefix=FLANG-ERROR 8*be9fa9deSFabian Mora!RUN: not %flang_fc1 -triple nvptx64-nvidia-cuda -emit-hlfir -fopenmp %s -o - 2>&1 | FileCheck %s --check-prefix=FLANG-ERROR 909b30f40SKiran Chandramohan!RUN: not bbc -fopenmp -fopenmp-is-gpu -emit-hlfir %s -o - 2>&1 | FileCheck %s --check-prefix=BBC-ERROR 1009b30f40SKiran Chandramohan 1109b30f40SKiran Chandramohan!CHECK: module attributes {{{.*}}omp.is_gpu = true 1209b30f40SKiran Chandramohansubroutine omp_subroutine() 1309b30f40SKiran Chandramohanend subroutine omp_subroutine 1409b30f40SKiran Chandramohan 1509b30f40SKiran Chandramohan!FLANG-ERROR: error: OpenMP AMDGPU/NVPTX is only prepared to deal with device code. 1609b30f40SKiran Chandramohan!BBC-ERROR: FATAL: -fopenmp-is-gpu can only be set if -fopenmp-is-target-device is also set 17