1 ; RUN: llc -mtriple=thumbv7-linux-gnueabihf -relocation-model=pic %s -o - | FileCheck %s
3 @var = thread_local global i32 0, align 4
5 define void @func(i32 %n) {
7 ; CHECK: ldr [[REF1:r[0-9]+]], [[CP1:.LCPI[0-9]+_[0-9]+]]
8 ; CHECK: ldr [[REF2:r[0-9]+]], [[CP2:.LCPI[0-9]+_[0-9]+]]
10 ; CHECK: [[PCPOS1:.LPC[0-9]+_[0-9]+]]:
11 ; CHECK-NEXT: add [[REF1]], pc
13 ; CHECK: [[PCPOS2:.LPC[0-9]+_[0-9]+]]:
14 ; CHECK-NEXT: add [[REF2]], pc
17 ; CHECK-NEXT: [[CP1_TMP:.Ltmp[0-9]+]]:
18 ; CHECK-NEXT: .long var(TLSGD)-(([[PCPOS1]]+4)-[[CP1_TMP]])
21 ; CHECK-NEXT: [[CP2_TMP:.Ltmp[0-9]+]]:
22 ; CHECK-NEXT: .long var(TLSGD)-(([[PCPOS2]]+4)-[[CP2_TMP]])
28 %i = phi i32 [ %inc, %next ], [ 0, %entry ]
29 %val = load i32, i32* @var
30 %tst = icmp eq i32 %val, 0
31 br i1 %tst, label %next, label %call
34 tail call void @foo(i32* nonnull @var) #2
39 %stop = icmp eq i32 %inc, %n
40 br i1 %stop, label %done, label %loop
46 declare void @foo(i32*)