Index: lib/CodeGen/CodeGenModule.cpp =================================================================== --- lib/CodeGen/CodeGenModule.cpp +++ lib/CodeGen/CodeGenModule.cpp @@ -4678,8 +4678,9 @@ /// same translation unit. void CodeGenModule::EmitStaticExternCAliases() { // Don't do anything if we're generating CUDA device code -- the NVPTX - // assembly target doesn't support aliases. - if (Context.getTargetInfo().getTriple().isNVPTX()) + // and AMDGCN assembly target doesn't support aliases. + if (Context.getTargetInfo().getTriple().isNVPTX() || + (Context.getTargetInfo().getTriple().getArch() == llvm::Triple::amdgcn)) return; for (auto &I : StaticExternCValues) { IdentifierInfo *Name = I.first; Index: test/CodeGenCUDA/alias.cu =================================================================== --- test/CodeGenCUDA/alias.cu +++ test/CodeGenCUDA/alias.cu @@ -1,8 +1,11 @@ // REQUIRES: x86-registered-target // REQUIRES: nvptx-registered-target +// REQUIRES: amdgpu-registered-target // RUN: %clang_cc1 -fcuda-is-device -triple nvptx-nvidia-cuda -emit-llvm \ // RUN: -o - %s | FileCheck %s +// RUN: %clang_cc1 -fcuda-is-device -triple amdgcn -emit-llvm \ +// RUN: -o - %s | FileCheck %s #include "Inputs/cuda.h"