Home | History | Annotate | Download | only in Mips
      1 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s
      2 # Check that the assembler can handle the documented syntax
      3 # for relocations.
      4 # CHECK: .section __TEXT,__text,regular,pure_instructions
      5 # CHECK:  lui   $2, %hi(_gp_disp)     # encoding: [A,A,0x02,0x3c]
      6 # CHECK:                              #   fixup A - offset: 0, value: _gp_disp@ABS_HI, kind: fixup_Mips_HI16
      7 # CHECK:  addiu $2, $2, %lo(_gp_disp) # encoding: [A,A,0x42,0x24]
      8 # CHECK:                              #   fixup A - offset: 0, value: _gp_disp@ABS_LO, kind: fixup_Mips_LO16
      9 # CHECK:  lw    $25, %call16(strchr)($gp)   # encoding: [A,A,0x99,0x8f]
     10 # CHECK:                                    #   fixup A - offset: 0, value: strchr@GOT_CALL, kind: fixup_Mips_CALL16
     11 # CHECK:  lw      $3, %got(loop_1)($2)    # encoding: [A,A,0x43,0x8c]
     12 # CHECK:                                  #   fixup A - offset: 0, value: loop_1@GOT, kind: fixup_Mips_GOT_Local
     13 # CHECK:  lui     $2, %dtprel_hi(_gp_disp) # encoding: [A,A,0x02,0x3c]
     14 # CHECK:                                        #   fixup A - offset: 0, value: _gp_disp@DTPREL_HI, kind: fixup_Mips_DTPREL_HI
     15 # CHECK:  addiu   $2, $2, %dtprel_hi(_gp_disp) # encoding: [A,A,0x42,0x24]
     16 # CHECK:                                  #   fixup A - offset: 0, value: _gp_disp@DTPREL_HI, kind: fixup_Mips_DTPREL_HI
     17 # CHECK:  lw      $3, %got(loop_1)($2)      # encoding: [A,A,0x43,0x8c]
     18 # CHECK:                                    #   fixup A - offset: 0, value: loop_1@GOT, kind: fixup_Mips_GOT_Local
     19 # CHECK:  lw      $4, %got_disp(loop_2)($3) # encoding: [A,A,0x64,0x8c]
     20 # CHECK:                                    #   fixup A - offset: 0, value: loop_2@GOT_DISP, kind: fixup_Mips_GOT_DISP
     21 # CHECK:  lw      $5, %got_page(loop_3)($4) # encoding: [A,A,0x85,0x8c]
     22 # CHECK:                                    #   fixup A - offset: 0, value: loop_3@GOT_PAGE, kind: fixup_Mips_GOT_PAGE
     23 # CHECK:  lw      $6, %got_ofst(loop_4)($5) # encoding: [A,A,0xa6,0x8c]
     24 # CHECK:                                    #   fixup A - offset: 0, value: loop_4@GOT_OFST, kind: fixup_Mips_GOT_OFST
     25 # CHECK:  lui     $2, %tprel_hi(_gp_disp)   # encoding: [A,A,0x02,0x3c]
     26 # CHECK:                                    #   fixup A - offset: 0, value: _gp_disp@TPREL_HI, kind: fixup_Mips_TPREL_HI
     27 # CHECK:  addiu   $2, $2, %tprel_lo(_gp_disp) # encoding: [A,A,0x42,0x24]
     28 # CHECK:                                      #   fixup A - offset: 0, value: _gp_disp@TPREL_LO, kind: fixup_Mips_TPREL_LO
     29 
     30     lui	$2, %hi(_gp_disp)
     31 	  addiu	$2, $2, %lo(_gp_disp)
     32     lw	$25, %call16(strchr)($gp)
     33     lw      $3, %got(loop_1)($2)
     34     lui	$2, %dtprel_hi(_gp_disp)
     35 	  addiu	$2, $2, %dtprel_hi(_gp_disp)
     36     lw	$3, %got(loop_1)($2)
     37     lw	$4, %got_disp(loop_2)($3)
     38     lw	$5, %got_page(loop_3)($4)
     39     lw	$6, %got_ofst(loop_4)($5)
     40     lui	$2, %tprel_hi(_gp_disp)
     41 	  addiu	$2, $2, %tprel_lo(_gp_disp)
     42