diff options
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: ^ |