From 441ba12986ffaed283012f4938fbbee7ece65e4c Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 29 Aug 2019 21:15:02 +0000 Subject: [PATCH] Allow '@' to appear in x86 mingw symbols Summary: There is no reason to differ in assembler behavior here between -msvc and -gnu targets. Without this setting, the text after the '@' is interpreted as a symbol variable, like foo@IMGREL. Reviewers: mstorsjo Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66974 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370408 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp | 2 ++ test/MC/X86/stdcall.s | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/MC/X86/stdcall.s diff --git a/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp b/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp index e1125c176b2..d986c829d98 100644 --- a/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp +++ b/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp @@ -163,5 +163,7 @@ X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const Triple &Triple) { TextAlignFillValue = 0x90; + AllowAtInName = true; + UseIntegratedAssembler = true; } diff --git a/test/MC/X86/stdcall.s b/test/MC/X86/stdcall.s new file mode 100644 index 00000000000..7302dc3363a --- /dev/null +++ b/test/MC/X86/stdcall.s @@ -0,0 +1,19 @@ +# RUN: llvm-mc %s -filetype=obj -o - -triple i686-windows-msvc | llvm-nm - | FileCheck %s +# RUN: llvm-mc %s -filetype=obj -o - -triple i686-windows-gnu | llvm-nm - | FileCheck %s + +# CHECK: T _mystdcall@8{{$}} +# CHECK: T foo + +.text +.global _mystdcall@8 +_mystdcall@8: + movl 4(%esp), %eax + addl 8(%esp), %eax + retl $8 + +.global foo +foo: + pushl $1 + pushl $2 + calll _mystdcall@8 + retl -- 2.50.1