llvm.org GIT mirror llvm / b9c61f0
[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ö. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276859 91177308-0d34-0410-b5e6-96231b3b80d8 Renato Golin 4 years ago
2 changed file(s) with 14 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
8989
9090 PrivateGlobalPrefix = "$M";
9191 PrivateLabelPrefix = "$M";
92 CommentString = ";";
9293 }
9394
9495 void ARMCOFFMCAsmInfoGNU::anchor() { }
0 ; RUN: llvm-mc -triple armv7-windows-msvc -filetype obj -o - %s
1
2 .syntax unified
3 .thumb
4
5 .text
6
7 .global function
8 .thumb_func
9 function:
10 ; this is a comment
11 mov r0, #42 ; this # was not
12 bx lr