diff options
author | Jack Carter <jack.carter@imgtec.com> | 2014-01-06 23:27:31 +0000 |
---|---|---|
committer | Jack Carter <jack.carter@imgtec.com> | 2014-01-06 23:27:31 +0000 |
commit | 0cd3c19f33a7bf73511a1a498ef489d07265ef35 (patch) | |
tree | 0943cbc22b4adc7971ac937533038262fe9ccb1d /llvm/test/MC/Mips | |
parent | b2166d8ef3b8456a50e425a7cf2ed1bd6ad93319 (diff) | |
download | bcm5719-llvm-0cd3c19f33a7bf73511a1a498ef489d07265ef35.tar.gz bcm5719-llvm-0cd3c19f33a7bf73511a1a498ef489d07265ef35.zip |
[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.
llvm-svn: 198646
Diffstat (limited to 'llvm/test/MC/Mips')
-rw-r--r-- | llvm/test/MC/Mips/elf_eflags.ll | 2 | ||||
-rw-r--r-- | llvm/test/MC/Mips/elf_eflags.s | 9 | ||||
-rw-r--r-- | llvm/test/MC/Mips/mips_directives.s | 2 | ||||
-rw-r--r-- | llvm/test/MC/Mips/mips_directives_bad.s | 49 |
4 files changed, 60 insertions, 2 deletions
diff --git a/llvm/test/MC/Mips/elf_eflags.ll b/llvm/test/MC/Mips/elf_eflags.ll index 9432dcf59c3..8216a90aa30 100644 --- a/llvm/test/MC/Mips/elf_eflags.ll +++ b/llvm/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/llvm/test/MC/Mips/elf_eflags.s b/llvm/test/MC/Mips/elf_eflags.s index c56596444ae..c05772970a7 100644 --- a/llvm/test/MC/Mips/elf_eflags.s +++ b/llvm/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/llvm/test/MC/Mips/mips_directives.s b/llvm/test/MC/Mips/mips_directives.s index 7e4f937e907..0fb377edbc4 100644 --- a/llvm/test/MC/Mips/mips_directives.s +++ b/llvm/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/llvm/test/MC/Mips/mips_directives_bad.s b/llvm/test/MC/Mips/mips_directives_bad.s new file mode 100644 index 00000000000..7705eee55b0 --- /dev/null +++ b/llvm/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: ^ |