diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -599,7 +599,7 @@ auto *GV = new llvm::GlobalVariable( getModule(), ATy, false, llvm::GlobalValue::AppendingLinkage, - llvm::ConstantArray::get(ATy, UsedArray), "gpu.used.external"); + llvm::ConstantArray::get(ATy, UsedArray), "__clang_gpu_used_external"); addCompilerUsedGlobal(GV); } diff --git a/clang/test/CodeGenCUDA/host-used-extern.cu b/clang/test/CodeGenCUDA/host-used-extern.cu --- a/clang/test/CodeGenCUDA/host-used-extern.cu +++ b/clang/test/CodeGenCUDA/host-used-extern.cu @@ -11,19 +11,19 @@ #include "Inputs/cuda.h" -// CHECK-LABEL: @gpu.used.external = appending {{.*}}global +// CHECK-LABEL: @__clang_gpu_used_external = appending {{.*}}global // CHECK-DAG: @_Z7kernel1v // CHECK-DAG: @_Z7kernel4v // CHECK-DAG: @var1 -// CHECK-LABEL: @llvm.compiler.used = {{.*}} @gpu.used.external - -// NEG-NOT: @gpu.used.external = {{.*}} @_Z7kernel2v -// NEG-NOT: @gpu.used.external = {{.*}} @_Z7kernel3v -// NEG-NOT: @gpu.used.external = {{.*}} @var2 -// NEG-NOT: @gpu.used.external = {{.*}} @var3 -// NORDC-NOT: @gpu.used.external = {{.*}} @_Z7kernel1v -// NORDC-NOT: @gpu.used.external = {{.*}} @_Z7kernel4v -// NORDC-NOT: @gpu.used.external = {{.*}} @var1 +// CHECK-LABEL: @llvm.compiler.used = {{.*}} @__clang_gpu_used_external + +// NEG-NOT: @__clang_gpu_used_external = {{.*}} @_Z7kernel2v +// NEG-NOT: @__clang_gpu_used_external = {{.*}} @_Z7kernel3v +// NEG-NOT: @__clang_gpu_used_external = {{.*}} @var2 +// NEG-NOT: @__clang_gpu_used_external = {{.*}} @var3 +// NORDC-NOT: @__clang_gpu_used_external = {{.*}} @_Z7kernel1v +// NORDC-NOT: @__clang_gpu_used_external = {{.*}} @_Z7kernel4v +// NORDC-NOT: @__clang_gpu_used_external = {{.*}} @var1 __global__ void kernel1();