1 ; RUN: llc -mtriple=hexagon-unknown-elf -hexagon-small-data-threshold=8 -relocation-model=static < %s | FileCheck --check-prefixes=CHECK,STATIC %s
2 ; RUN: llc -mtriple=hexagon-unknown-elf -hexagon-small-data-threshold=8 -relocation-model=pic < %s | FileCheck --check-prefixes=CHECK,PIC %s
4 ; If a global has a specified section, it should probably be placed in that
5 ; section, but with PIC any accesses to globals in small data should still
8 @g0 = global i32 zeroinitializer
9 @g1 = global i32 zeroinitializer, section ".sdata"
12 ; STATIC: memw(gp+#g0)
13 ; PIC: r[[R0:[0-9]+]] = add(pc,##_GLOBAL_OFFSET_TABLE_@PCREL)
14 ; PIC: = memw(r[[R0]]+##g0@GOT)
16 %v0 = load i32, i32* @g0
21 ; STATIC: memw(gp+#g1)
22 ; PIC: r[[R1:[0-9]+]] = add(pc,##_GLOBAL_OFFSET_TABLE_@PCREL)
23 ; PIC: = memw(r[[R1]]+##g1@GOT)
25 %v0 = load i32, i32* @g1
30 ; STATIC: CONST64(#123456789012345678)
31 ; PIC: r0 = ##-1506741426
32 ; PIC: r1 = ##28744523
34 ret i64 123456789012345678
37 attributes #0 = { nounwind "target-cpu"="hexagonv60" }