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 4 ; field. 5 ;llc gprel16.ll -o gprel16.o -mcpu=mips32r2 -march=mipsel -filetype=obj -relocation-model=static 6 7 ; RUN: llc -mcpu=mips32r2 -march=mipsel -filetype=obj -relocation-model=static %s -o - \ 8 ; RUN: | llvm-objdump -disassemble -mattr +mips32r2 - \ 9 ; RUN: | FileCheck %s 10 11 target triple = "mipsel-sde--elf-gcc" 12 13 @var1 = internal global i32 0, align 4 14 @var2 = internal global i32 0, align 4 15 16 define i32 @testvar1() nounwind { 17 entry: 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 22 ret i32 %cond 23 } 24 25 define i32 @testvar2() nounwind { 26 entry: 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 31 ret i32 %cond 32 } 33 34