1 ; This tests ELF EFLAGS setting with direct object.
2 ; When the assembler is ready a .s file for it will
5 ; Non-shared (static) is the absence of pic and or cpic.
7 ; EF_MIPS_NOREORDER (0x00000001) is always on by default currently
8 ; EF_MIPS_PIC (0x00000002)
9 ; EF_MIPS_CPIC (0x00000004) - See note below
10 ; EF_MIPS_ABI2 (0x00000020) - n32 not tested yet
11 ; EF_MIPS_ARCH_32 (0x50000000)
12 ; EF_MIPS_ARCH_64 (0x60000000)
13 ; EF_MIPS_ARCH_32R2 (0x70000000)
14 ; EF_MIPS_ARCH_64R2 (0x80000000)
16 ; Note that EF_MIPS_CPIC is set by -mabicalls which is the default on Linux
17 ; TODO need to support -mno-abicalls
19 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE32 %s
20 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 %s -o - | FileCheck -check-prefix=CHECK-BE32_PIC %s
21 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE32R2 %s
22 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 %s -o - | FileCheck -check-prefix=CHECK-BE32R2_PIC %s
23 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS %s
24 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips %s -o - | FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS_PIC %s
26 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE64 %s
27 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 %s -o - | FileCheck -check-prefix=CHECK-BE64_PIC %s
28 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-BE64R2 %s
29 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 %s -o - | FileCheck -check-prefix=CHECK-BE64R2_PIC %s
31 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+mips16 -relocation-model=pic %s -o - | FileCheck -check-prefix=CHECK-LE32R2-MIPS16 %s
33 ; 32(R1) bit with NO_REORDER and static
34 ; CHECK-BE32: .abicalls
35 ; CHECK-BE32: .option pic0
36 ; CHECK-BE32: .set noreorder
38 ; 32(R1) bit with NO_REORDER and PIC
39 ; CHECK-BE32_PIC: .abicalls
40 ; CHECK-BE32_PIC: .set noreorder
42 ; 32R2 bit with NO_REORDER and static
43 ; CHECK-BE32R2: .abicalls
44 ; CHECK-BE32R2: .option pic0
45 ; CHECK-BE32R2: .set noreorder
47 ; 32R2 bit with NO_REORDER and PIC
48 ; CHECK-BE32R2_PIC: .abicalls
49 ; CHECK-BE32R2_PIC: .set noreorder
51 ; 32R2 bit MICROMIPS with NO_REORDER and static
52 ; CHECK-BE32R2-MICROMIPS: .abicalls
53 ; CHECK-BE32R2-MICROMIPS: .option pic0
54 ; CHECK-BE32R2-MICROMIPS: .set micromips
56 ; 32R2 bit MICROMIPS with NO_REORDER and PIC
57 ; CHECK-BE32R2-MICROMIPS_PIC: .abicalls
58 ; CHECK-BE32R2-MICROMIPS_PIC: .set micromips
60 ; 64(R1) bit with NO_REORDER and static
61 ; CHECK-BE64: .abicalls
62 ; CHECK-BE64: .set noreorder
64 ; 64(R1) bit with NO_REORDER and PIC
65 ; CHECK-BE64_PIC: .abicalls
66 ; CHECK-BE64_PIC: .set noreorder
68 ; 64R2 bit with NO_REORDER and static
69 ; CHECK-BE64R2: .abicalls
70 ; CHECK-BE64R2: .set noreorder
72 ; 64R2 bit with NO_REORDER and PIC
73 ; CHECK-BE64R2_PIC: .abicalls
74 ; CHECK-BE64R2_PIC: .set noreorder
76 ; 32R2 bit MIPS16 with PIC
77 ; CHECK-LE32R2-MIPS16: .abicalls
78 ; CHECK-LE32R2-MIPS16: .set mips16
80 define i32 @main() nounwind {