summaryrefslogtreecommitdiff
path: root/test/MC/Mips
diff options
context:
space:
mode:
authorJack Carter <jack.carter@imgtec.com>2014-01-06 23:27:31 +0000
committerJack Carter <jack.carter@imgtec.com>2014-01-06 23:27:31 +0000
commit063564c4c5655946094975abe4a89d601d02c69a (patch)
treee133467a82ad8892f2d10e6971e71bee0011f68f /test/MC/Mips
parent284c8bc4b0c1642e0feced9d9b7416b08a4d1b5d (diff)
downloadllvm-063564c4c5655946094975abe4a89d601d02c69a.tar.gz
llvm-063564c4c5655946094975abe4a89d601d02c69a.tar.bz2
llvm-063564c4c5655946094975abe4a89d601d02c69a.tar.xz
[Mips] TargetStreamer Support for .abicalls and .set pic0.
This patch adds .abicalls and .set pic0 support which affects the ELF ABI and its flags. In addition the patch uses a common interface for both the MipsTargetSteamer and MipsObjectStreamer that both the integrated and standalone assemblers will use for the output for these directives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/Mips')
-rw-r--r--test/MC/Mips/elf_eflags.ll2
-rw-r--r--test/MC/Mips/elf_eflags.s9
-rw-r--r--test/MC/Mips/mips_directives.s2
-rw-r--r--test/MC/Mips/mips_directives_bad.s49
4 files changed, 60 insertions, 2 deletions
diff --git a/test/MC/Mips/elf_eflags.ll b/test/MC/Mips/elf_eflags.ll
index 9432dcf59c..8216a90aa3 100644
--- a/test/MC/Mips/elf_eflags.ll
+++ b/test/MC/Mips/elf_eflags.ll
@@ -29,7 +29,7 @@
; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 -print-hack-directives %s -o - | FileCheck -check-prefix=CHECK-BE64R2_PIC %s
; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+mips16 -relocation-model=pic -print-hack-directives %s -o - | FileCheck -check-prefix=CHECK-LE32R2-MIPS16 %s
-
+
; 32(R1) bit with NO_REORDER and static
; CHECK-BE32: .mips_hack_elf_flags 0x50001005
;
diff --git a/test/MC/Mips/elf_eflags.s b/test/MC/Mips/elf_eflags.s
index c56596444a..c05772970a 100644
--- a/test/MC/Mips/elf_eflags.s
+++ b/test/MC/Mips/elf_eflags.s
@@ -1,5 +1,12 @@
// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux %s -o -| llvm-readobj -h | FileCheck %s
+// The initial value will be set at 0x50001003 and
+// we will override that with the negation of 0x2 (option pic0
+// the addition of 0x4 (.abicalls)
- .mips_hack_elf_flags 0x50001005
+ .mips_hack_elf_flags 0x50001003
// CHECK: Flags [ (0x50001005)
+
+ .abicalls
+
+ .option pic0
diff --git a/test/MC/Mips/mips_directives.s b/test/MC/Mips/mips_directives.s
index 7e4f937e90..0fb377edbc 100644
--- a/test/MC/Mips/mips_directives.s
+++ b/test/MC/Mips/mips_directives.s
@@ -2,8 +2,10 @@
#
# CHECK: .text
# CHECK: $BB0_2:
+# CHECK: .abicalls
$BB0_2:
.ent directives_test
+ .abicalls
.frame $sp,0,$ra
.mask 0x00000000,0
.fmask 0x00000000,0
diff --git a/test/MC/Mips/mips_directives_bad.s b/test/MC/Mips/mips_directives_bad.s
new file mode 100644
index 0000000000..7705eee55b
--- /dev/null
+++ b/test/MC/Mips/mips_directives_bad.s
@@ -0,0 +1,49 @@
+# Error checking for malformed directives
+# RUN: not llvm-mc -triple mips-unknown-unknown %s 2>&1 | FileCheck %s
+
+ .abicalls should have no operands
+# CHECK: :{{[0-9]+}}:{{[0-9]+}}: error: unexpected token in directive
+# CHECK-NEXT: .abicalls should have no operands
+# CHECK-NEXT: ^
+
+# We don't know yet how to represent a list of options
+# pic2 will eventually be legal so we will probably want
+# to change it to something silly.
+
+# Blank option operand
+ .option
+# CHECK-NEXT: :{{[0-9]+}}:{{[0-9]+}}: error: unexpected token in .option directive
+# CHECK-NEXT: .option
+# CHECK-NEXT: ^
+
+# Numeric option operand
+ .option 2
+# CHECK-NEXT: :{{[0-9]+}}:{{[0-9]+}}: error: unexpected token in .option directive
+# CHECK-NEXT: .option 2
+# CHECK-NEXT: ^
+
+# Register option operand
+ .option $2
+# CHECK-NEXT: :{{[0-9]+}}:{{[0-9]+}}: error: unexpected token in .option directive
+# CHECK-NEXT: .option $2
+# CHECK-NEXT: ^
+
+ .option WithBadOption
+# CHECK-NEXT: :{{[0-9]+}}:{{[0-9]+}}: warning: unknown option in .option directive
+# CHECK-NEXT: .option WithBadOption
+# CHECK-NEXT: ^
+
+ .option pic0,
+# CHECK-NEXT: :{{[0-9]+}}:{{[0-9]+}}: error: unexpected token in .option pic0 directive
+# CHECK-NEXT: .option pic0,
+# CHECK-NEXT: ^
+
+ .option pic0,pic2
+# CHECK-NEXT: :{{[0-9]+}}:{{[0-9]+}}: error: unexpected token in .option pic0 directive
+# CHECK-NEXT: .option pic0,pic2
+# CHECK-NEXT: ^
+
+ .option pic0 pic2
+# CHECK-NEXT: :{{[0-9]+}}:{{[0-9]+}}: error: unexpected token in .option pic0 directive
+# CHECK-NEXT: .option pic0 pic2
+# CHECK-NEXT: ^