xref: /aosp_15_r20/external/llvm/test/CodeGen/Mips/elf_eflags.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; This tests ELF EFLAGS setting with direct object.
2*9880d681SAndroid Build Coastguard Worker; When the assembler is ready a .s file for it will
3*9880d681SAndroid Build Coastguard Worker; be created.
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; Non-shared (static) is the absence of pic and or cpic.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; EF_MIPS_NOREORDER (0x00000001) is always on by default currently
8*9880d681SAndroid Build Coastguard Worker; EF_MIPS_PIC (0x00000002)
9*9880d681SAndroid Build Coastguard Worker; EF_MIPS_CPIC (0x00000004) - See note below
10*9880d681SAndroid Build Coastguard Worker; EF_MIPS_ABI2 (0x00000020) - n32 not tested yet
11*9880d681SAndroid Build Coastguard Worker; EF_MIPS_ARCH_32 (0x50000000)
12*9880d681SAndroid Build Coastguard Worker; EF_MIPS_ARCH_64 (0x60000000)
13*9880d681SAndroid Build Coastguard Worker; EF_MIPS_ARCH_32R2 (0x70000000)
14*9880d681SAndroid Build Coastguard Worker; EF_MIPS_ARCH_64R2 (0x80000000)
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker; Note that EF_MIPS_CPIC is set by -mabicalls which is the default on Linux
17*9880d681SAndroid Build Coastguard Worker; TODO need to support -mno-abicalls
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-LE32 %s
20*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 %s -o - | FileCheck -check-prefix=CHECK-LE32_PIC %s
21*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-LE32R2 %s
22*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 %s -o - | FileCheck -check-prefix=CHECK-LE32R2_PIC %s
23*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-LE32R2-MICROMIPS %s
24*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips %s -o - | FileCheck -check-prefix=CHECK-LE32R2-MICROMIPS_PIC %s
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips4 -target-abi n64 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-LE64 %s
27*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips4 -target-abi n64 %s -o - | FileCheck -check-prefix=CHECK-LE64_PIC %s
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 -target-abi n64 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-LE64 %s
30*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 -target-abi n64 %s -o - | FileCheck -check-prefix=CHECK-LE64_PIC %s
31*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 -target-abi n64 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-LE64R2 %s
32*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 -target-abi n64 %s -o - | FileCheck -check-prefix=CHECK-LE64R2_PIC %s
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+mips16 -relocation-model=pic %s -o - | FileCheck -check-prefix=CHECK-LE32R2-MIPS16 %s
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Worker; 32(R1) bit with NO_REORDER and static
37*9880d681SAndroid Build Coastguard Worker; CHECK-LE32: .abicalls
38*9880d681SAndroid Build Coastguard Worker; CHECK-LE32: .option	pic0
39*9880d681SAndroid Build Coastguard Worker; CHECK-LE32: .set	noreorder
40*9880d681SAndroid Build Coastguard Worker;
41*9880d681SAndroid Build Coastguard Worker; 32(R1) bit with NO_REORDER and PIC
42*9880d681SAndroid Build Coastguard Worker; CHECK-LE32_PIC: .abicalls
43*9880d681SAndroid Build Coastguard Worker; CHECK-LE32_PIC: .set	noreorder
44*9880d681SAndroid Build Coastguard Worker;
45*9880d681SAndroid Build Coastguard Worker; 32R2 bit with NO_REORDER and static
46*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2: .abicalls
47*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2: .option pic0
48*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2: .set noreorder
49*9880d681SAndroid Build Coastguard Worker;
50*9880d681SAndroid Build Coastguard Worker; 32R2 bit with NO_REORDER and PIC
51*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2_PIC: .abicalls
52*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2_PIC: .set noreorder
53*9880d681SAndroid Build Coastguard Worker;
54*9880d681SAndroid Build Coastguard Worker; 32R2 bit MICROMIPS with NO_REORDER and static
55*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2-MICROMIPS: .abicalls
56*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2-MICROMIPS: .option pic0
57*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2-MICROMIPS: .set	micromips
58*9880d681SAndroid Build Coastguard Worker;
59*9880d681SAndroid Build Coastguard Worker; 32R2 bit MICROMIPS with NO_REORDER and PIC
60*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2-MICROMIPS_PIC: .abicalls
61*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2-MICROMIPS_PIC: .set micromips
62*9880d681SAndroid Build Coastguard Worker;
63*9880d681SAndroid Build Coastguard Worker; 64(R1) bit with NO_REORDER and static
64*9880d681SAndroid Build Coastguard Worker; CHECK-LE64: .abicalls
65*9880d681SAndroid Build Coastguard Worker; CHECK-LE64: .set noreorder
66*9880d681SAndroid Build Coastguard Worker;
67*9880d681SAndroid Build Coastguard Worker; 64(R1) bit with NO_REORDER and PIC
68*9880d681SAndroid Build Coastguard Worker; CHECK-LE64_PIC: .abicalls
69*9880d681SAndroid Build Coastguard Worker; CHECK-LE64_PIC: .set noreorder
70*9880d681SAndroid Build Coastguard Worker;
71*9880d681SAndroid Build Coastguard Worker; 64R2 bit with NO_REORDER and static
72*9880d681SAndroid Build Coastguard Worker; CHECK-LE64R2: .abicalls
73*9880d681SAndroid Build Coastguard Worker; CHECK-LE64R2: .set noreorder
74*9880d681SAndroid Build Coastguard Worker;
75*9880d681SAndroid Build Coastguard Worker; 64R2 bit with NO_REORDER and PIC
76*9880d681SAndroid Build Coastguard Worker; CHECK-LE64R2_PIC: .abicalls
77*9880d681SAndroid Build Coastguard Worker; CHECK-LE64R2_PIC: .set noreorder
78*9880d681SAndroid Build Coastguard Worker;
79*9880d681SAndroid Build Coastguard Worker; 32R2 bit MIPS16 with PIC
80*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2-MIPS16: .abicalls
81*9880d681SAndroid Build Coastguard Worker; CHECK-LE32R2-MIPS16: .set mips16
82*9880d681SAndroid Build Coastguard Worker
83*9880d681SAndroid Build Coastguard Workerdefine i32 @main() nounwind {
84*9880d681SAndroid Build Coastguard Workerentry:
85*9880d681SAndroid Build Coastguard Worker  ret i32 0
86*9880d681SAndroid Build Coastguard Worker}
87