diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/Mips/start-asm-file.ll | 91 | ||||
-rw-r--r-- | test/MC/Mips/elf_eflags.s | 41 | ||||
-rw-r--r-- | test/MC/Mips/elf_eflags_nan2008.s | 12 | ||||
-rw-r--r-- | test/MC/Mips/elf_eflags_nanlegacy.s | 15 |
4 files changed, 158 insertions, 1 deletions
diff --git a/test/CodeGen/Mips/start-asm-file.ll b/test/CodeGen/Mips/start-asm-file.ll new file mode 100644 index 0000000000..8872464316 --- /dev/null +++ b/test/CodeGen/Mips/start-asm-file.ll @@ -0,0 +1,91 @@ +; Check the emission of directives at the start of an asm file. +; This test is XFAILED until we fix the emission of '.option pic0' on +; N32. At the moment we check if subtarget is Mips64 when we should be +; checking the Subtarget's ABI. + +; ### O32 ABI ### +; RUN: llc -filetype=asm -mtriple mips-unknown-linux -mcpu=mips32 \ +; RUN: -relocation-model=static %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-STATIC-O32 -check-prefix=CHECK-STATIC-O32-NLEGACY %s + +; RUN: llc -filetype=asm -mtriple mips-unknown-linux -mcpu=mips32 \ +; RUN: -relocation-model=pic %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-PIC-O32 -check-prefix=CHECK-PIC-O32-NLEGACY %s + +; RUN: llc -filetype=asm -mtriple mips-unknown-linux -mcpu=mips32 \ +; RUN: -relocation-model=static -mattr=+nan2008 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-STATIC-O32 -check-prefix=CHECK-STATIC-O32-N2008 %s + +; RUN: llc -filetype=asm -mtriple mips-unknown-linux -mcpu=mips32 \ +; RUN: -relocation-model=pic -mattr=+nan2008 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-PIC-O32 -check-prefix=CHECK-PIC-O32-N2008 %s + +; ### N32 ABI ### +; RUN: llc -filetype=asm -mtriple mips64-unknown-linux -mcpu=mips64 \ +; RUN: -relocation-model=static -mattr=-n64,+n32 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-STATIC-N32 -check-prefix=CHECK-STATIC-N32-NLEGACY %s + +; RUN: llc -filetype=asm -mtriple mips64-unknown-linux -mcpu=mips64 \ +; RUN: -relocation-model=pic -mattr=-n64,+n32 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-PIC-N32 -check-prefix=CHECK-PIC-N32-NLEGACY %s + +; RUN: llc -filetype=asm -mtriple mips64-unknown-linux -mcpu=mips64 \ +; RUN: -relocation-model=static -mattr=-n64,+n32,+nan2008 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-STATIC-N32 -check-prefix=CHECK-STATIC-N32-N2008 %s + +; RUN: llc -filetype=asm -mtriple mips64-unknown-linux -mcpu=mips64 \ +; RUN: -relocation-model=pic -mattr=-n64,+n32,+nan2008 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-PIC-N32 -check-prefix=CHECK-PIC-N32-N2008 %s + +; ### N64 ABI ### +; RUN: llc -filetype=asm -mtriple mips64-unknown-linux -mcpu=mips64 \ +; RUN: -relocation-model=static -mattr=+n64 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-STATIC-N64 -check-prefix=CHECK-STATIC-N64-NLEGACY %s + +; RUN: llc -filetype=asm -mtriple mips64-unknown-linux -mcpu=mips64 \ +; RUN: -relocation-model=pic -mattr=+n64 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-PIC-N64 -check-prefix=CHECK-PIC-N64-NLEGACY %s + +; RUN: llc -filetype=asm -mtriple mips64-unknown-linux -mcpu=mips64 \ +; RUN: -relocation-model=static -mattr=+n64,+nan2008 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-STATIC-N64 -check-prefix=CHECK-STATIC-N64-N2008 %s + +; RUN: llc -filetype=asm -mtriple mips64-unknown-linux -mcpu=mips64 \ +; RUN: -relocation-model=pic -mattr=+n64,+nan2008 %s -o - | \ +; RUN: FileCheck -check-prefix=CHECK-PIC-N64 -check-prefix=CHECK-PIC-N64-N2008 %s + +; CHECK-STATIC-O32: .abicalls +; CHECK-STATIC-O32: .option pic0 +; CHECK-STATIC-O32: .section .mdebug.abi32 +; CHECK-STATIC-O32-NLEGACY: .nan legacy +; CHECK-STATIC-O32-N2008: .nan 2008 + +; CHECK-PIC-O32: .abicalls +; CHECK-PIC-O32-NOT: .option pic0 +; CHECK-PIC-O32: .section .mdebug.abi32 +; CHECK-PIC-O32-NLEGACY: .nan legacy +; CHECK-PIC-O32-N2008: .nan 2008 + +; CHECK-STATIC-N32: .abicalls +; CHECK-STATIC-N32: .option pic0 +; CHECK-STATIC-N32: .section .mdebug.abiN32 +; CHECK-STATIC-N32-NLEGACY: .nan legacy +; CHECK-STATIC-N32-N2008: .nan 2008 + +; CHECK-PIC-N32: .abicalls +; CHECK-PIC-N32-NOT: .option pic0 +; CHECK-PIC-N32: .section .mdebug.abiN32 +; CHECK-PIC-N32-NLEGACY: .nan legacy +; CHECK-PIC-N32-N2008: .nan 2008 + +; CHECK-STATIC-N64: .abicalls +; CHECK-STATIC-N64-NOT: .option pic0 +; CHECK-STATIC-N64: .section .mdebug.abi64 +; CHECK-STATIC-N64-NLEGACY: .nan legacy +; CHECK-STATIC-N64-N2008: .nan 2008 + +; CHECK-PIC-N64: .abicalls +; CHECK-PIC-N64-NOT: .option pic0 +; CHECK-PIC-N64: .section .mdebug.abi64 +; CHECK-PIC-N64-NLEGACY: .nan legacy +; CHECK-PIC-N64-N2008: .nan 2008 diff --git a/test/MC/Mips/elf_eflags.s b/test/MC/Mips/elf_eflags.s index c789428b42..8cf4960e17 100644 --- a/test/MC/Mips/elf_eflags.s +++ b/test/MC/Mips/elf_eflags.s @@ -4,40 +4,79 @@ # RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips64r2 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPSEL-MIPS64R2 %s # MIPSEL-MIPS64R2: Flags [ (0x80001100) +# RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips64r2 -mattr=+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPSEL-MIPS64R2-NAN2008 %s +# MIPSEL-MIPS64R2-NAN2008: Flags [ (0x80001500) + # RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips64 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPSEL-MIPS64 %s # MIPSEL-MIPS64: Flags [ (0x60001100) +# RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips64 -mattr=+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPSEL-MIPS64-NAN2008 %s +# MIPSEL-MIPS64-NAN2008: Flags [ (0x60001500) + # RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips32r2 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPSEL-MIPS32R2 %s # MIPSEL-MIPS32R2: Flags [ (0x70001000) +# RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPSEL-MIPS32R2-NAN2008 %s +# MIPSEL-MIPS32R2-NAN2008: Flags [ (0x70001400) + # RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips32 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPSEL-MIPS32 %s # MIPSEL-MIPS32: Flags [ (0x50001000) +# RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips32 -mattr=+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPSEL-MIPS32-NAN2008 %s +# MIPSEL-MIPS32-NAN2008: Flags [ (0x50001400) + # RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64r2 -mattr=-n64,n32 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64R2-N32 %s # MIPS64EL-MIPS64R2-N32: Flags [ (0x80000020) +# RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64r2 -mattr=-n64,n32,+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64R2-N32-NAN2008 %s +# MIPS64EL-MIPS64R2-N32-NAN2008: Flags [ (0x80000420) + # RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64 -mattr=-n64,n32 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64-N32 %s # MIPS64EL-MIPS64-N32: Flags [ (0x60000020) +# RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64 -mattr=-n64,n32,+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64-N32-NAN2008 %s +# MIPS64EL-MIPS64-N32-NAN2008: Flags [ (0x60000420) + # RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64r2 -mattr=n64 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64R2-N64 %s # MIPS64EL-MIPS64R2-N64: Flags [ (0x80000000) +# RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64r2 -mattr=n64,+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64R2-N64-NAN2008 %s +# MIPS64EL-MIPS64R2-N64-NAN2008: Flags [ (0x80000400) + # RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64 %s -mattr=n64 -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64-N64 %s # MIPS64EL-MIPS64-N64: Flags [ (0x60000000) +# RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64 %s -mattr=n64,+nan2008 -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64-N64-NAN2008 %s +# MIPS64EL-MIPS64-N64-NAN2008: Flags [ (0x60000400) + # RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64r2 -mattr=-n64,o32 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64R2-O32 %s # MIPS64EL-MIPS64R2-O32: Flags [ (0x80001100) +# RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64r2 -mattr=-n64,o32,+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64R2-O32-NAN2008 %s +# MIPS64EL-MIPS64R2-O32-NAN2008: Flags [ (0x80001500) + # RUN: llvm-mc -filetype=obj -triple mips64-unknown-linux -mcpu=mips4 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS4 %s # MIPS4: Flags [ (0x30000000) + # RUN: llvm-mc -filetype=obj -triple mips64-unknown-linux -mcpu=mips4 -mattr=+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS4-NAN2008 %s +# MIPS4-NAN2008: Flags [ (0x30000400) + # RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64 %s -mattr=-n64,o32 -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64-O32 %s # MIPS64EL-MIPS64-O32: Flags [ (0x60001100) - + +# RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64 %s -mattr=-n64,o32,+nan2008 -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64-O32-NAN2008 %s +# MIPS64EL-MIPS64-O32-NAN2008: Flags [ (0x60001500) + # Default ABI for MIPS64 is N64 as opposed to GCC/GAS (N32) # RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64r2 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64R2 %s # MIPS64EL-MIPS64R2: Flags [ (0x80000000) +# RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64r2 -mattr=+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64R2-NAN2008 %s +# MIPS64EL-MIPS64R2-NAN2008: Flags [ (0x80000400) + # Default ABI for MIPS64 is N64 as opposed to GCC/GAS (N32) # RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64 %s # MIPS64EL-MIPS64: Flags [ (0x60000000) + +# RUN: llvm-mc -filetype=obj -triple mips64el-unknown-linux -mcpu=mips64 -mattr=+nan2008 %s -o -| llvm-readobj -h | FileCheck --check-prefix=MIPS64EL-MIPS64-NAN2008 %s +# MIPS64EL-MIPS64-NAN2008: Flags [ (0x60000400) diff --git a/test/MC/Mips/elf_eflags_nan2008.s b/test/MC/Mips/elf_eflags_nan2008.s new file mode 100644 index 0000000000..71a22be2b4 --- /dev/null +++ b/test/MC/Mips/elf_eflags_nan2008.s @@ -0,0 +1,12 @@ +# RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips32 %s -o - | \ +# RUN: llvm-readobj -h | \ +# RUN: FileCheck %s -check-prefix=CHECK-OBJ +# RUN: llvm-mc -triple mipsel-unknown-linux -mcpu=mips32 %s -o -| \ +# RUN: FileCheck %s -check-prefix=CHECK-ASM + +# This *MUST* match the output of gas compiled with the same triple. +# CHECK-OBJ: Flags [ (0x50001400) + +# CHECK-ASM: .nan 2008 + +.nan 2008 diff --git a/test/MC/Mips/elf_eflags_nanlegacy.s b/test/MC/Mips/elf_eflags_nanlegacy.s new file mode 100644 index 0000000000..6897ad2bda --- /dev/null +++ b/test/MC/Mips/elf_eflags_nanlegacy.s @@ -0,0 +1,15 @@ +# RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux -mcpu=mips32 %s -o - | \ +# RUN: llvm-readobj -h | \ +# RUN: FileCheck %s -check-prefix=CHECK-OBJ +# RUN: llvm-mc -triple mipsel-unknown-linux -mcpu=mips32 %s -o -| \ +# RUN: FileCheck %s -check-prefix=CHECK-ASM + +# This *MUST* match the output of gas compiled with the same triple. +# CHECK-OBJ: Flags [ (0x50001000) + +# CHECK-ASM: .nan 2008 +# CHECK-ASM: .nan legacy + +.nan 2008 +// Let's override the previous directive! +.nan legacy |