1 ; RUN: llc -march=mipsel -relocation-model=pic < %s | FileCheck %s -check-prefix=CHECK-PIC 2 ; RUN: llc -march=mipsel -relocation-model=static < %s | FileCheck %s -check-prefix=CHECK-STATIC 3 4 @reg = common global i8* null, align 4 5 6 define i8* @dummy(i8* %x) nounwind readnone noinline { 7 entry: 8 ret i8* %x 9 } 10 11 ; CHECK-PIC: lw $[[R0:[0-9]+]], %got($tmp[[T0:[0-9]+]])($gp) 12 ; CHECK-PIC: addiu ${{[0-9]+}}, $[[R0]], %lo($tmp[[T0]]) 13 ; CHECK-PIC: lw $[[R1:[0-9]+]], %got($tmp[[T1:[0-9]+]])($gp) 14 ; CHECK-PIC: addiu ${{[0-9]+}}, $[[R1]], %lo($tmp[[T1]]) 15 ; CHECK-STATIC: lui $[[R2:[0-9]+]], %hi($tmp[[T0:[0-9]+]]) 16 ; CHECK-STATIC: addiu ${{[0-9]+}}, $[[R2]], %lo($tmp[[T0]]) 17 ; CHECK-STATIC: lui $[[R3:[0-9]+]], %hi($tmp[[T1:[0-9]+]]) 18 ; CHECK-STATIC: addiu ${{[0-9]+}}, $[[R3]], %lo($tmp[[T1]]) 19 define void @f() nounwind { 20 entry: 21 %call = tail call i8* @dummy(i8* blockaddress(@f, %baz)) 22 indirectbr i8* %call, [label %baz, label %foo] 23 24 foo: ; preds = %foo, %entry 25 store i8* blockaddress(@f, %foo), i8** @reg, align 4 26 br label %foo 27 28 baz: ; preds = %entry 29 store i8* null, i8** @reg, align 4 30 ret void 31 } 32