1 // This addresses bug 14456. We were not writing
2 // out the addend to the gprel16 relocation. The
3 // addend is stored in the instruction immediate
6 // RUN: llvm-mc -mcpu=mips32r2 -triple=mipsel-pc-linux -filetype=obj -relocation-model=static %s -o - \
7 // RUN: | llvm-objdump -disassemble -mattr +mips32r2 - \
9 // RUN: llvm-mc -mcpu=mips32r2 -triple=mips-pc-linux -filetype=obj -relocation-model=static %s -o - \
10 // RUN: | llvm-objdump -disassemble -mattr +mips32r2 - \
11 // RUN: | FileCheck %s
16 .section .mdebug.abi32,"",@progbits
17 .file "/home/espindola/llvm/llvm/test/MC/Mips/mips_gprel16.ll"
21 .type testvar1,@function
32 // CHECK: lw ${{[0-9]+}}, 0($gp)
33 lw $1, %gp_rel(var1)($gp)
41 .size testvar1, ($tmp0)-testvar1
45 .type testvar2,@function
56 // CHECK: lw ${{[0-9]+}}, 4($gp)
57 lw $1, %gp_rel(var2)($gp)
65 .size testvar2, ($tmp1)-testvar2
67 .type var1,@object # @var1
70 .type var2,@object # @var2