diff --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp --- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp +++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp @@ -138,9 +138,9 @@ SetupMachineFunction(MF); if (STI->isTargetCOFF()) { - bool Internal = MF.getFunction().hasInternalLinkage(); - COFF::SymbolStorageClass Scl = Internal ? COFF::IMAGE_SYM_CLASS_STATIC - : COFF::IMAGE_SYM_CLASS_EXTERNAL; + bool Local = MF.getFunction().hasLocalLinkage(); + COFF::SymbolStorageClass Scl = + Local ? COFF::IMAGE_SYM_CLASS_STATIC : COFF::IMAGE_SYM_CLASS_EXTERNAL; int Type = COFF::IMAGE_SYM_DTYPE_FUNCTION << COFF::SCT_COMPLEX_TYPE_SHIFT; diff --git a/llvm/test/CodeGen/AArch64/local-sym-storage-class.ll b/llvm/test/CodeGen/AArch64/local-sym-storage-class.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/local-sym-storage-class.ll @@ -0,0 +1,15 @@ +; RUN: llc -mtriple aarch64-unknown-windows-msvc %s -o - | FileCheck %s + +define internal void @internal() { + ret void +} + +define private void @private() { + ret void +} + +; Check that the internal and private linkage symbols have IMAGE_SYM_CLASS_STATIC (3). +; CHECK: .def internal; +; CHECK: .scl 3; +; CHECK: .def .Lprivate; +; CHECK: .scl 3; diff --git a/llvm/test/CodeGen/X86/local-sym-storage-class.ll b/llvm/test/CodeGen/X86/local-sym-storage-class.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/X86/local-sym-storage-class.ll @@ -0,0 +1,15 @@ +; RUN: llc -mtriple x86_64-unknown-windows-msvc %s -o - | FileCheck %s + +define internal void @internal() { + ret void +} + +define private void @private() { + ret void +} + +; Check that the internal and private linkage symbols have IMAGE_SYM_CLASS_STATIC (3). +; CHECK: .def internal; +; CHECK: .scl 3; +; CHECK: .def .Lprivate; +; CHECK: .scl 3;