[Mips] TargetStreamer ELF flag Support for default and commandline options.
[oota-llvm.git] / test / MC / Mips / elf_eflags.ll
1 ; This tests for directives that will result in
2 ; ELF EFLAGS setting with direct object.
3
4 ; Non-shared (static) is the absence of pic and or cpic.
5
6 ; EF_MIPS_NOREORDER (0x00000001) is always on by default currently
7 ; EF_MIPS_PIC (0x00000002)
8 ; EF_MIPS_CPIC (0x00000004) - See note below
9 ; EF_MIPS_ABI2 (0x00000020) - n32 not tested yet
10 ; EF_MIPS_ARCH_32 (0x50000000)
11 ; EF_MIPS_ARCH_64 (0x60000000)
12 ; EF_MIPS_ARCH_32R2 (0x70000000)
13 ; EF_MIPS_ARCH_64R2 (0x80000000)
14
15 ; Note that EF_MIPS_CPIC is set by -mabicalls which is the default on Linux
16 ; TODO need to support -mno-abicalls
17
18 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 \
19 ; RUN: -relocation-model=static %s -o - | \
20 ; RUN: FileCheck -check-prefix=CHECK-BE32 %s
21 ;
22 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32 %s -o - | \
23 ; RUN: FileCheck -check-prefix=CHECK-BE32_PIC %s
24 ;
25 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 \
26 ; RUN: -relocation-model=static %s -o - | \
27 ; RUN: FileCheck -check-prefix=CHECK-BE32R2 %s
28 ;
29 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 %s -o - | \
30 ; RUN: FileCheck -check-prefix=CHECK-BE32R2_PIC %s
31 ;
32 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 \
33 ; RUN: -mattr=+micromips -relocation-model=static %s -o - | \
34 ; RUN: FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS %s
35 ;
36 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 \
37 ; RUN: -mattr=+micromips %s -o - | \
38 ; RUN: FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS_PIC %s
39
40 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 \
41 ; RUN: -relocation-model=static %s -o - | \
42 ; RUN: FileCheck -check-prefix=CHECK-BE64 %s
43 ;
44 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64 %s -o - | \
45 ; RUN: FileCheck -check-prefix=CHECK-BE64_PIC %s
46 ;
47 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 \
48 ; RUN: -relocation-model=static %s -o - | \
49 ; RUN: FileCheck -check-prefix=CHECK-BE64R2 %s
50 ;
51 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips64r2 %s -o - | \
52 ; RUN: FileCheck -check-prefix=CHECK-BE64R2_PIC %s
53
54 ; RUN: llc -mtriple mipsel-unknown-linux -mcpu=mips32r2 \
55 ; RUN: -mattr=+mips16 -relocation-model=pic %s -o - | \
56 ; RUN: FileCheck -check-prefix=CHECK-LE32R2-MIPS16 %s
57
58 ; 32(R1) bit with NO_REORDER and static
59 ; CHECK-BE32: .abicalls
60 ; CHECK-BE32: .option pic0
61 ; CHECK-BE32: .set noreorder
62 ; TODO: Need .set mips32
63 ;
64 ; 32(R1) bit with NO_REORDER and PIC
65 ; CHECK-BE32_PIC: .abicalls
66 ; CHECK-BE32_PIC: .set noreorder
67 ; TODO: Need .set mips32 and check absence of .option pic0
68 ;
69 ; 32R2 bit with NO_REORDER and static
70 ; CHECK-BE32R2: .abicalls
71 ; CHECK-BE32R2: .option pic0
72 ; CHECK-BE32R2: .set noreorder
73 ; TODO: Need .set mips32r2
74 ;
75 ; 32R2 bit with NO_REORDER and PIC
76 ; CHECK-BE32R2_PIC:.abicalls
77 ; CHECK-BE32R2_PIC:.set noreorder
78 ; TODO: Need .set mips32r2 and check absence of .option pic0
79 ;
80 ; 32R2 bit MICROMIPS with NO_REORDER and static
81 ; CHECK-BE32R2-MICROMIPS: .abicalls
82 ; CHECK-BE32R2-MICROMIPS: .option pic0
83 ; CHECK-BE32R2-MICROMIPS: .set micromips
84 ; CHECK-BE32R2-MICROMIPS: .set noreorder
85 ; TODO: Need .set mips32r2
86 ;
87 ; 32R2 bit MICROMIPS with NO_REORDER and PIC
88 ; CHECK-BE32R2-MICROMIPS_PIC: .abicalls
89 ; CHECK-BE32R2-MICROMIPS_PIC: .set micromips
90 ; CHECK-BE32R2-MICROMIPS_PIC: .set noreorder
91 ; TODO: Need .set mips32r2 and check absence of .option pic0
92 ;
93 ; 64(R1) bit with NO_REORDER and static
94 ; CHECK-BE64: .abicalls
95 ; CHECK-BE64: .set noreorder
96 ; TODO: Need .set mips64 and .option pic0
97 ;
98 ; 64(R1) bit with NO_REORDER and PIC
99 ; CHECK-BE64_PIC: .abicalls
100 ; CHECK-BE64_PIC: .set noreorder
101 ; TODO: Need .set mips64 and check absence of .option pic0
102 ;
103 ; 64R2 bit with NO_REORDER and static
104 ; CHECK-BE64R2: .abicalls
105 ; CHECK-BE64R2: .set noreorder
106 ; TODO: Need .set mips64r2 and .option pic0
107 ;
108 ; 64R2 bit with NO_REORDER and PIC
109 ; CHECK-BE64R2_PIC: .abicalls
110 ; CHECK-BE64R2_PIC: .set noreorder
111 ; TODO: Need .set mips64r2 and check absence of .option pic0
112 ;
113 ; 32R2 bit MIPS16 with PIC
114 ; CHECK-LE32R2-MIPS16: .abicalls
115 ; CHECK-LE32R2-MIPS16: .set mips16
116 ; TODO: Need .set mips32r2 and check absence of .option pic0 and noreorder
117
118 define i32 @main() nounwind {
119 entry:
120   ret i32 0
121 }