68 lines · plain
1// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux %s -o - | llvm-readobj -r - | FileCheck %s2 3// Check that the appropriate relocations were created.4// For the xgot case we want to see R_MIPS_[GOT|CALL]_[HI|LO]16.5 6// CHECK: Relocations [7// CHECK: 0x0 R_MIPS_HI16 _gp_disp8// CHECK: 0x4 R_MIPS_LO16 _gp_disp9// CHECK: 0x14 R_MIPS_GOT_HI16 ext_110// CHECK: 0x1C R_MIPS_GOT_LO16 ext_111// CHECK: 0x24 R_MIPS_CALL_HI16 printf12// CHECK: 0x30 R_MIPS_CALL_LO16 printf13// CHECK: 0x2C R_MIPS_GOT16 $.str14// CHECK: 0x38 R_MIPS_LO16 $.str15// CHECK: ]16 17 .text18 .abicalls19 .section .mdebug.abi32,"",@progbits20 .file "/home/espindola/llvm/llvm/test/MC/Mips/xgot.ll"21 .text22 .globl fill23 .align 224 .type fill,@function25 .set nomips1626 .ent fill27fill: # @fill28 .frame $sp,24,$ra29 .mask 0x80000000,-430 .fmask 0x00000000,031 .set noreorder32 .set nomacro33 .set noat34# %bb.0: # %entry35 lui $2, %hi(_gp_disp)36 addiu $2, $2, %lo(_gp_disp)37 addiu $sp, $sp, -2438 sw $ra, 20($sp) # 4-byte Folded Spill39 addu $gp, $2, $2540 lui $1, %got_hi(ext_1)41 addu $1, $1, $gp42 lw $1, %got_lo(ext_1)($1)43 lw $5, 0($1)44 lui $1, %call_hi(printf)45 addu $1, $1, $gp46 lw $2, %got($.str)($gp)47 lw $25, %call_lo(printf)($1)48 jalr $2549 addiu $4, $2, %lo($.str)50 lw $ra, 20($sp) # 4-byte Folded Reload51 jr $ra52 addiu $sp, $sp, 2453 .set at54 .set macro55 .set reorder56 .end fill57$tmp0:58 .size fill, ($tmp0)-fill59 60 .type $.str,@object # @.str61 .section .rodata.str1.1,"aMS",@progbits,162$.str:63 .asciz "ext_1=%d, i=%d\n"64 .size $.str, 1665 66 67 .text68