1 ; PR35221. Test that external global address is not reloaded from GOT in each BB.
2 ; RUN: llc < %s -mtriple=armv7-linux-gnueabi -relocation-model=pic | FileCheck %s -check-prefix=LINUX-PIC
4 @x = external global i8, align 1
6 define signext i8 @foo() {
8 ; LINUX-PIC: ldr r[[A:.]], .LCPI0_0
9 ; LINUX-PIC: ldr r[[B:.]], [pc, r[[A]]]
10 ; LINUX-PIC: ldrb r{{.}}, [r[[B]]]
12 %tobool = icmp eq i8 %0, 0
13 br i1 %tobool, label %bb1, label %bb2
17 ; No more pc-relative loads! Reuse r[[B]].
19 ; LINUX-PIC-NOT: ldr{{.*}}[pc,
20 ; LINUX-PIC: ldrsb r{{.}}, [r[[B]]]