diff options
author | Zoran Jovanovic <zoran.jovanovic@imgtec.com> | 2013-10-29 16:38:59 +0000 |
---|---|---|
committer | Zoran Jovanovic <zoran.jovanovic@imgtec.com> | 2013-10-29 16:38:59 +0000 |
commit | 1aaf43c2a2ec0fd4c8dbfe56558237219c5f8af7 (patch) | |
tree | 890ba96553a8309fa262ff4a6c307f0fd1b19dbb /test/MC/Mips | |
parent | 54328c772c5519e56c13667c2b1d1e830580c44d (diff) | |
download | external_llvm-1aaf43c2a2ec0fd4c8dbfe56558237219c5f8af7.zip external_llvm-1aaf43c2a2ec0fd4c8dbfe56558237219c5f8af7.tar.gz external_llvm-1aaf43c2a2ec0fd4c8dbfe56558237219c5f8af7.tar.bz2 |
Support for microMIPS jump instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193623 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/Mips')
-rw-r--r-- | test/MC/Mips/micromips-jump-instructions.s | 40 | ||||
-rw-r--r-- | test/MC/Mips/micromips-jump26.s | 23 | ||||
-rw-r--r-- | test/MC/Mips/micromips-tailr.s | 26 |
3 files changed, 89 insertions, 0 deletions
diff --git a/test/MC/Mips/micromips-jump-instructions.s b/test/MC/Mips/micromips-jump-instructions.s new file mode 100644 index 0000000..6f571b6 --- /dev/null +++ b/test/MC/Mips/micromips-jump-instructions.s @@ -0,0 +1,40 @@ +# RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips \ +# RUN: | FileCheck %s -check-prefix=CHECK-EL +# RUN: llvm-mc %s -triple=mips -show-encoding -mattr=micromips \ +# RUN: | FileCheck %s -check-prefix=CHECK-EB +# Check that the assembler can handle the documented syntax +# for jump and branch instructions. +#------------------------------------------------------------------------------ +# Jump instructions +#------------------------------------------------------------------------------ +# Little endian +#------------------------------------------------------------------------------ +# CHECK-EL: j 1328 # encoding: [0x00,0xd4,0x98,0x02] +# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EL: jal 1328 # encoding: [0x00,0xf4,0x98,0x02] +# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EL: jalr $6 # encoding: [0xe6,0x03,0x3c,0x0f] +# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EL: jr $7 # encoding: [0x07,0x00,0x3c,0x0f] +# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EL: jr $7 # encoding: [0x07,0x00,0x3c,0x0f] +# CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00] +#------------------------------------------------------------------------------ +# Big endian +#------------------------------------------------------------------------------ +# CHECK-EB: j 1328 # encoding: [0xd4,0x00,0x02,0x98] +# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EB: jal 1328 # encoding: [0xf4,0x00,0x02,0x98] +# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EB: jalr $6 # encoding: [0x03,0xe6,0x0f,0x3c] +# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EB: jr $7 # encoding: [0x00,0x07,0x0f,0x3c] +# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK-EB: jr $7 # encoding: [0x00,0x07,0x0f,0x3c] +# CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00] + + j 1328 + jal 1328 + jalr $6 + jr $7 + j $7 diff --git a/test/MC/Mips/micromips-jump26.s b/test/MC/Mips/micromips-jump26.s new file mode 100644 index 0000000..936a998 --- /dev/null +++ b/test/MC/Mips/micromips-jump26.s @@ -0,0 +1,23 @@ +# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding \ +# RUN: -mattr=micromips | FileCheck %s -check-prefix=CHECK-FIXUP +# RUN: llvm-mc %s -filetype=obj -triple=mipsel-unknown-linux \ +# RUN: -mattr=micromips | llvm-readobj -r \ +# RUN: | FileCheck %s -check-prefix=CHECK-ELF +#------------------------------------------------------------------------------ +# Check that the assembler can handle the documented syntax +# for relocations. +#------------------------------------------------------------------------------ +# CHECK-FIXUP: foo: +# CHECK-FIXUP: jal bar # encoding: [A,0xf4'A',A,0b000000AA] +# CHECK-FIXUP: # fixup A - offset: 0, +# CHECK-FIXUP: value: bar, kind: fixup_MICROMIPS_26_S1 +# CHECK-FIXUP: nop # encoding: [0x00,0x00,0x00,0x00] +#------------------------------------------------------------------------------ +# Check that the appropriate relocations were created. +#------------------------------------------------------------------------------ +# CHECK-ELF: Relocations [ +# CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_26_S1 +# CHECK-ELF: ] + +foo: + jal bar diff --git a/test/MC/Mips/micromips-tailr.s b/test/MC/Mips/micromips-tailr.s new file mode 100644 index 0000000..0c21a7b --- /dev/null +++ b/test/MC/Mips/micromips-tailr.s @@ -0,0 +1,26 @@ +# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding \ +# RUN: -mattr=micromips | FileCheck %s -check-prefix=CHECK-FIXUP +# RUN: llvm-mc %s -filetype=obj -triple=mipsel-unknown-linux \ +# RUN: -mattr=micromips | llvm-readobj -r \ +# RUN: | FileCheck %s -check-prefix=CHECK-ELF +#------------------------------------------------------------------------------ +# Check that the assembler can handle the documented syntax +# for relocations. +#------------------------------------------------------------------------------ +# CHECK-FIXUP: foo: +# CHECK-FIXUP: addiu $2, $zero, 1332 +# CHECK-FIXUP: # encoding: [0x40,0x30,0x34,0x05] +# CHECK-FIXUP: j foo # encoding: [A,0xd4'A',A,0b000000AA] +# CHECK-FIXUP: # fixup A - offset: 0, +# CHECK-FIXUP: value: foo, kind: fixup_MICROMIPS_26_S1 +# CHECK-FIXUP: nop # encoding: [0x00,0x00,0x00,0x00] +#------------------------------------------------------------------------------ +# Check that the appropriate relocations were created. +#------------------------------------------------------------------------------ +# CHECK-ELF: Relocations [ +# CHECK-ELF: 0x{{[0-9,A-F]+}} R_MICROMIPS_26_S1 +# CHECK-ELF: ] + +foo: + addiu $2, $0, 1332 + j foo |