]> granicus.if.org Git - llvm/commitdiff
PowerPC: support the separator character in the IAS
authorSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 24 Oct 2017 16:19:56 +0000 (16:19 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 24 Oct 2017 16:19:56 +0000 (16:19 +0000)
PowerPC uses ; as a comment leader and the @ as a separator character.
Support this properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316454 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
test/MC/PowerPC/ppc-separator.s [new file with mode: 0644]

index d30bf1a56e8aa34a29e6c0003fed0b60f533b84e..8ac461b96b88c5b723f7f5132b6ec0d4312723f8 100644 (file)
@@ -24,6 +24,7 @@ PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) {
   }
   IsLittleEndian = false;
 
+  SeparatorString = "@";
   CommentString = ";";
   ExceptionsType = ExceptionHandling::DwarfCFI;
 
diff --git a/test/MC/PowerPC/ppc-separator.s b/test/MC/PowerPC/ppc-separator.s
new file mode 100644 (file)
index 0000000..d2291ec
--- /dev/null
@@ -0,0 +1,10 @@
+; RUN: llvm-mc -triple powerpc-apple-darwin -show-encoding -o - %s | FileCheck %s
+; RUN: llvm-mc -triple powerpc64-apple-darwin -show-encoding -o - %s | FileCheck %s
+
+_label:
+       li r0, 0 @ li r1, 1
+
+; CHECK: _label:
+; CHECK: li r0, 0 ; encoding
+; CHECK: li r1, 1 ; encoding
+