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
5 ;llc gprel16.ll -o gprel16.o -mcpu=mips32r2 -march=mipsel -filetype=obj -relocation-model=static
7 ; RUN: llc -mcpu=mips32r2 -march=mipsel -filetype=obj -relocation-model=static %s -o - \
8 ; RUN: | llvm-objdump -disassemble -mattr +mips32r2 - \
11 target triple = "mipsel-sde--elf-gcc"
13 @var1 = internal global i32 0, align 4
14 @var2 = internal global i32 0, align 4
16 define i32 @testvar1() nounwind {
18 ; CHECK: lw ${{[0-9]+}}, 0($gp)
19 %0 = load i32* @var1, align 4
20 %tobool = icmp ne i32 %0, 0
21 %cond = select i1 %tobool, i32 1, i32 0
25 define i32 @testvar2() nounwind {
27 ; CHECK: lw ${{[0-9]+}}, 4($gp)
28 %0 = load i32* @var2, align 4
29 %tobool = icmp ne i32 %0, 0
30 %cond = select i1 %tobool, i32 1, i32 0