1 // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device -fapply-global-visibility-to-externs -fvisibility default -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-DEFAULT %s 2 // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device -fapply-global-visibility-to-externs -fvisibility protected -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-PROTECTED %s 3 // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device -fapply-global-visibility-to-externs -fvisibility hidden -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-HIDDEN %s 4 5 #include "Inputs/cuda.h" 6 7 // CHECK-DEFAULT: @c = addrspace(4) externally_initialized global 8 // CHECK-DEFAULT: @g = addrspace(1) externally_initialized global 9 // CHECK-PROTECTED: @c = protected addrspace(4) externally_initialized global 10 // CHECK-PROTECTED: @g = protected addrspace(1) externally_initialized global 11 // CHECK-HIDDEN: @c = protected addrspace(4) externally_initialized global 12 // CHECK-HIDDEN: @g = protected addrspace(1) externally_initialized global 13 __constant__ int c; 14 __device__ int g; 15 16 // CHECK-DEFAULT: define amdgpu_kernel void @_Z3foov() 17 // CHECK-PROTECTED: define protected amdgpu_kernel void @_Z3foov() 18 // CHECK-HIDDEN: define protected amdgpu_kernel void @_Z3foov() 19 __global__ void foo() { 20 g = c; 21 } 22