// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix HOST
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix DEVICE
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-pc-linux-gnu -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix HOST
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-pc-linux-gnu -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-i386-host.bc
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-i386-host.bc -o - | FileCheck %s --check-prefix DEVICE
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux-gnu -fopenmp-targets=x86_64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix HOST
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux-gnu -fopenmp-targets=x86_64-unknown-linux-gnu -emit-llvm-bc %s -o %t-x86_64-host.bc
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86_64-host.bc -o - | FileCheck %s --check-prefix DEVICE
// expected-no-diagnostics
int G1;
static int G2;
int G3;
static int G4;
int G5;
static int G6;
int G7;
static int G8;
int G9;
static int G10;
int G11;
static int G12;
// TODO: The code below should probably work but it is not 100% clear.
#pragma omp declare target
#pragma omp begin declare variant match(device = {kind(host)})
int GX;
static int GY;
#pragma omp end declare variant
#pragma omp end declare target
// TODO: It is odd, probably wrong, that we don't mangle all variables.
// DEVICE-DAG: @G1 = {{.*}}global i32 0, align 4
// DEVICE-DAG: @_ZL2G2 = internal {{.*}}global i32 0, align 4
// DEVICE-DAG: @G3 = {{.*}}global i32 0, align 4
// DEVICE-DAG: @_ZL2G4 = internal {{.*}}global i32 0, align 4
// DEVICE-DAG: @G5 = {{.*}}global i32 0, align 4
// DEVICE-DAG: @_ZL2G6 = internal {{.*}}global i32 0, align 4
// DEVICE-NOT: ref
// DEVICE-NOT: llvm.used
// DEVICE-NOT: omp_offload
// HOST-DAG: @G7 = global i32 0, align 4
// HOST-DAG: @_ZL2G8 = internal global i32 0, align 4
// HOST-DAG: @G9 = global i32 0, align 4
// HOST-DAG: @_ZL3G10 = internal global i32 0, align 4
// HOST-DAG: @G11 = global i32 0, align 4
// HOST-DAG: @_ZL3G12 = internal global i32 0, align 4