ARM IAS: add support for the .pool directive
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 20 Dec 2013 07:21:16 +0000 (07:21 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 20 Dec 2013 07:21:16 +0000 (07:21 +0000)
The .pool directive is an alias for the .ltorg directive used to create a
literal pool.  Simply treat .pool as if .ltorg was passed.

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

lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/pool.s [new file with mode: 0644]

index e67311f655de92f7f02d4f64a4105d305a92637d..d3b6c78e17c3bc81ef64f90637994d527e060f94 100644 (file)
@@ -7910,7 +7910,7 @@ bool ARMAsmParser::ParseDirective(AsmToken DirectiveID) {
     return parseDirectiveInst(DirectiveID.getLoc(), 'n');
   else if (IDVal == ".inst.w")
     return parseDirectiveInst(DirectiveID.getLoc(), 'w');
-  else if (IDVal == ".ltorg")
+  else if (IDVal == ".ltorg" || IDVal == ".pool")
     return parseDirectiveLtorg(DirectiveID.getLoc());
   return true;
 }
@@ -8464,7 +8464,7 @@ bool ARMAsmParser::parseDirectiveInst(SMLoc Loc, char Suffix) {
 }
 
 /// parseDirectiveLtorg
-///  ::= .ltorg
+///  ::= .ltorg | .pool
 bool ARMAsmParser::parseDirectiveLtorg(SMLoc L) {
   MCStreamer &Streamer = getParser().getStreamer();
   const MCSection *Section = Streamer.getCurrentSection().first;
diff --git a/test/MC/ARM/pool.s b/test/MC/ARM/pool.s
new file mode 100644 (file)
index 0000000..926b4f1
--- /dev/null
@@ -0,0 +1,18 @@
+@ RUN: llvm-mc -triple thumbv7-linux-gnueabi -o - %s | FileCheck %s
+
+       .syntax unified
+
+       .align 2
+       .global pool
+       .type pool,%function
+pool:
+       ldr r0, =0xba5eba11
+       bx lr
+       .pool
+
+@ CHECK-LABEL: pool
+@ CHECK: ldr r0, .Ltmp0
+@ CHECK: .align        2
+@ CHECK-LABEL: .Ltmp0:
+@ CHECK: .long 3126770193
+