Index: llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp =================================================================== --- llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp +++ 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; Index: llvm/test/CodeGen/AArch64/local-sym-storage-class.ll =================================================================== --- /dev/null +++ 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; Index: llvm/test/CodeGen/X86/local-sym-storage-class.ll =================================================================== --- /dev/null +++ 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;