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.

llvm-svn: 316454

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

index d30bf1a..8ac461b 100644 (file)
@@ -24,6 +24,7 @@ PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) {
   }
   IsLittleEndian = false;
 
+  SeparatorString = "@";
   CommentString = ";";
   ExceptionsType = ExceptionHandling::DwarfCFI;
 
diff --git a/llvm/test/MC/PowerPC/ppc-separator.s b/llvm/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
+