[PATCH] D22775: [ARM] Set a non-conflicting comment character for assembly in MSVC mode

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 03:58:52 PDT 2016


mstorsjo updated the summary for this revision.
mstorsjo updated this revision to Diff 65695.
mstorsjo added a comment.

Added a test for assembling code in armv7-windows mode, testing both '#' and ';'. I didn't add a test for something that would output assembly including comments (my attempt with "llvm-mc -filetype asm" didn't include any comments at all), but this test should at least cover the essentials here.


https://reviews.llvm.org/D22775

Files:
  lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
  test/MC/ARM/Windows/literals-comments.s

Index: test/MC/ARM/Windows/literals-comments.s
===================================================================
--- /dev/null
+++ test/MC/ARM/Windows/literals-comments.s
@@ -0,0 +1,25 @@
+; RUN: llvm-mc -triple armv7-windows-msvc -filetype obj -o - %s \
+; RUN:   | llvm-readobj -s - | FileCheck %s
+
+	.syntax unified
+	.thumb
+
+	.text
+
+	.global function
+	.thumb_func
+function:
+	mov r0, #42
+	bx lr
+
+; CHECK: Sections [
+; CHECK:   Section {
+; CHECK:     Name: .text
+; CHECK:     Characteristics [
+; CHECK:       IMAGE_SCN_ALIGN_4BYTES
+; CHECK:       IMAGE_SCN_CNT_CODE
+; CHECK:       IMAGE_SCN_MEM_EXECUTE
+; CHECK:       IMAGE_SCN_MEM_READ
+; CHECK:     ]
+; CHECK:   }
+; CHECK: ]
Index: lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
+++ lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
@@ -90,6 +90,7 @@
 
   PrivateGlobalPrefix = "$M";
   PrivateLabelPrefix = "$M";
+  CommentString = ";";
 }
 
 void ARMCOFFMCAsmInfoGNU::anchor() { }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22775.65695.patch
Type: text/x-patch
Size: 1069 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160727/61357aa1/attachment.bin>


More information about the llvm-commits mailing list