This patch that sets the Mips ELF header flag for
[oota-llvm.git] / test / MC / Mips / elf_eflags.ll
1 ; This tests ELF EFLAGS setting with direct object.
2 ; When the assembler is ready a .s file for it will
3 ; be created.
4
5 ; Non-shared (static) is the absence of pic and or cpic.
6
7 ; EF_MIPS_NOREORDER (0x00000001) is always on by default currently
8 ; EF_MIPS_PIC (0x00000002)
9 ; EF_MIPS_CPIC (0x00000004) - not tested yet
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)
15
16 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32 -relocation-model=static %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE32 %s
17 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32 %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE32_PIC %s
18 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32r2 -relocation-model=static %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE32R2 %s
19 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32r2 %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE32R2_PIC %s
20 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips -relocation-model=static %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS %s
21 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+micromips %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE32R2-MICROMIPS_PIC %s
22
23 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips64 -relocation-model=static %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE64 %s
24 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips64 %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE64_PIC %s
25 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips64r2 -relocation-model=static %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE64R2 %s
26 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips64r2 %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-BE64R2_PIC %s
27
28
29 ; 32(R1) bit with NO_REORDER and static
30 ; CHECK-BE32: ('e_flags', 0x50000001)
31 ;
32 ; 32(R1) bit with NO_REORDER and PIC
33 ; CHECK-BE32_PIC: ('e_flags', 0x50000003)
34 ;
35 ; 32R2 bit with NO_REORDER and static
36 ; CHECK-BE32R2: ('e_flags', 0x70000001)
37 ;
38 ; 32R2 bit with NO_REORDER and PIC
39 ; CHECK-BE32R2_PIC: ('e_flags', 0x70000003)
40 ;
41 ; 32R2 bit MICROMIPS with NO_REORDER and static
42 ; CHECK-BE32R2-MICROMIPS: ('e_flags', 0x72000001)
43 ;
44 ; 32R2 bit MICROMIPS with NO_REORDER and PIC
45 ;CHECK-BE32R2-MICROMIPS_PIC:  ('e_flags', 0x72000003)
46 ;
47 ; 64(R1) bit with NO_REORDER and static
48 ; CHECK-BE64: ('e_flags', 0x60000001)
49 ;
50 ; 64(R1) bit with NO_REORDER and PIC
51 ; CHECK-BE64_PIC: ('e_flags', 0x60000003)
52 ;
53 ; 64R2 bit with NO_REORDER and static
54 ; CHECK-BE64R2: ('e_flags', 0x80000001)
55 ;
56 ; 64R2 bit with NO_REORDER and PIC
57 ; CHECK-BE64R2_PIC: ('e_flags', 0x80000003)
58 ;
59
60 define i32 @main() nounwind {
61 entry:
62   ret i32 0
63 }