mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[ARM] Set a non-conflicting comment character for assembly in MSVC mode
Currently, for ARMCOFFMCAsmInfoMicrosoft, no comment character is set, thus the idefault, '#', is used. The hash character doesn't work as comment character in ARM assembly, since '#' is used for immediate values. The comment character is set to ';', which is the comment character used by MS armasm.exe. (The microsoft armasm.exe uses a different directive syntax than what LLVM currently supports though, similar to ARM's armasm.) This allows inline assembly with immediate constants to be built (and brings the assembly output from clang -S closer to being possible to assemble). A test is added that verifies that ';' is correctly interpreted as comments in this mode, and verifies that assembling code that includes literal constants with a '#' works. Patch by Martin Storsjö. llvm-svn: 276859
This commit is contained in:
parent
c2c3be974e
commit
c15ac98803
@ -90,6 +90,7 @@ ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
|
||||
|
||||
PrivateGlobalPrefix = "$M";
|
||||
PrivateLabelPrefix = "$M";
|
||||
CommentString = ";";
|
||||
}
|
||||
|
||||
void ARMCOFFMCAsmInfoGNU::anchor() { }
|
||||
|
13
test/MC/ARM/Windows/literals-comments.s
Normal file
13
test/MC/ARM/Windows/literals-comments.s
Normal file
@ -0,0 +1,13 @@
|
||||
; RUN: llvm-mc -triple armv7-windows-msvc -filetype obj -o - %s
|
||||
|
||||
.syntax unified
|
||||
.thumb
|
||||
|
||||
.text
|
||||
|
||||
.global function
|
||||
.thumb_func
|
||||
function:
|
||||
; this is a comment
|
||||
mov r0, #42 ; this # was not
|
||||
bx lr
|
Loading…
Reference in New Issue
Block a user