brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 3566466 Raw
38 lines · plain
1; RUN: llc -mtriple=hexagon-unknown-elf -hexagon-small-data-threshold=8 -relocation-model=static < %s | FileCheck --check-prefixes=CHECK,STATIC %s2; RUN: llc -mtriple=hexagon-unknown-elf -hexagon-small-data-threshold=8 -relocation-model=pic < %s | FileCheck --check-prefixes=CHECK,PIC %s3 4; If a global has a specified section, it should probably be placed in that5; section, but with PIC any accesses to globals in small data should still6; go through GOT.7 8@g0 = global i32 zeroinitializer9@g1 = global i32 zeroinitializer, section ".sdata"10 11; CHECK-LABEL: f0:12; STATIC: memw(gp+#g0)13; PIC: r[[R0:[0-9]+]] = add(pc,##_GLOBAL_OFFSET_TABLE_@PCREL)14; PIC: = memw(r[[R0]]+##g0@GOT)15define i32 @f0() #0 {16  %v0 = load i32, ptr @g017  ret i32 %v018}19 20; CHECK-LABEL: f1:21; STATIC: memw(gp+#g1)22; PIC: r[[R1:[0-9]+]] = add(pc,##_GLOBAL_OFFSET_TABLE_@PCREL)23; PIC: = memw(r[[R1]]+##g1@GOT)24define i32 @f1() #0 {25  %v0 = load i32, ptr @g126  ret i32 %v027}28 29; CHECK-LABEL: f2:30; STATIC: CONST64(#123456789012345678)31; PIC: r0 = ##-150674142632; PIC: r1 = ##2874452333define i64 @f2() #0 {34  ret i64 12345678901234567835}36 37attributes #0 = { nounwind "target-cpu"="hexagonv60" }38