Home | History | Annotate | Download | only in Mips
      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 ; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32r2 -mattr=+mips16 -relocation-model=pic %s -o - | elf-dump --dump-section-data  | FileCheck -check-prefix=CHECK-LE32R2-MIPS16 %s
     29  
     30 ; 32(R1) bit with NO_REORDER and static
     31 ; CHECK-BE32: ('e_flags', 0x50001001)
     32 ;
     33 ; 32(R1) bit with NO_REORDER and PIC
     34 ; CHECK-BE32_PIC: ('e_flags', 0x50001003)
     35 ;
     36 ; 32R2 bit with NO_REORDER and static
     37 ; CHECK-BE32R2: ('e_flags', 0x70001001)
     38 ;
     39 ; 32R2 bit with NO_REORDER and PIC
     40 ; CHECK-BE32R2_PIC: ('e_flags', 0x70001003)
     41 ;
     42 ; 32R2 bit MICROMIPS with NO_REORDER and static
     43 ; CHECK-BE32R2-MICROMIPS: ('e_flags', 0x72001001)
     44 ;
     45 ; 32R2 bit MICROMIPS with NO_REORDER and PIC
     46 ;CHECK-BE32R2-MICROMIPS_PIC:  ('e_flags', 0x72001003)
     47 ;
     48 ; 64(R1) bit with NO_REORDER and static
     49 ; CHECK-BE64: ('e_flags', 0x60000001)
     50 ;
     51 ; 64(R1) bit with NO_REORDER and PIC
     52 ; CHECK-BE64_PIC: ('e_flags', 0x60000003)
     53 ;
     54 ; 64R2 bit with NO_REORDER and static
     55 ; CHECK-BE64R2: ('e_flags', 0x80000001)
     56 ;
     57 ; 64R2 bit with NO_REORDER and PIC
     58 ; CHECK-BE64R2_PIC: ('e_flags', 0x80000003)
     59 ;
     60 ; 32R2 bit MIPS16 with PIC
     61 ; CHECK-LE32R2-MIPS16: ('e_flags', 0x74001002)
     62  
     63 define i32 @main() nounwind {
     64 entry:
     65   ret i32 0
     66 }
     67