1 ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=pic | FileCheck --check-prefixes=LARGE,LARGE-BSS %s
2 ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -mattr=+secure-plt -relocation-model=pic | FileCheck --check-prefixes=LARGE,LARGE-SECUREPLT %s
3 ; RUN: llc < %s -mtriple=powerpc-unknown-netbsd -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
4 ; RUN: llc < %s -mtriple=powerpc-unknown-netbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
5 ; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
6 ; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
7 ; RUN: llc < %s -mtriple=powerpc-linux-musl -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
8 ; RUN: llc < %s -mtriple=powerpc-linux-musl -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
11 @bar = common global i32 0, align 4
12 @bar1 = global i32 0, align 4, comdat($bar1)
13 @bar2 = global i32 0, align 4, comdat($bar1)
15 declare i32 @call_foo(i32, ...)
19 %0 = load i32, ptr @bar, align 4
20 %call = call i32 (i32, ...) @call_foo(i32 %0, i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64)
26 %0 = load i32, ptr @bar1
27 %1 = load i32, ptr @bar2
32 !llvm.module.flags = !{!0}
33 !0 = !{i32 1, !"PIC Level", i32 2}
34 ; LARGE-BSS: [[POFF:\.L[0-9]+\$poff]]:
35 ; LARGE-BSS-NEXT: .long .LTOC-[[PB:\.L[0-9]+\$pb]]
36 ; LARGE-BSS-NEXT: foo:
37 ; LARGE-BSS: stwu 1, -32(1)
38 ; LARGE-BSS: stw 30, 24(1)
39 ; LARGE-BSS: bl [[PB]]
40 ; LARGE-BSS-NEXT: [[PB]]:
42 ; LARGE-BSS: lwz [[REG:[0-9]+]], [[POFF]]-[[PB]](30)
43 ; LARGE-BSS-NEXT: add 30, [[REG]], 30
44 ; LARGE-BSS-DAG: lwz [[VREG:[0-9]+]], [[VREF:\.LC[0-9]+]]-.LTOC(30)
45 ; LARGE-BSS-DAG: lwz {{[0-9]+}}, 0([[VREG]])
46 ; LARGE-BSS-DAG: stw {{[0-9]+}}, 8(1)
47 ; LARGE-BSS: lwz 30, 24(1)
48 ; LARGE-SECUREPLT: addis 30, 30, .LTOC-.L0$pb@ha
49 ; LARGE-SECUREPLT: addi 30, 30, .LTOC-.L0$pb@l
50 ; LARGE-SECUREPLT: bl call_foo@PLT+32768
52 ; LARGE: .section .bss.bar1,"aGw",@nobits,bar1,comdat
54 ; LARGE: .section .bss.bar2,"aGw",@nobits,bar1,comdat
56 ; LARGE: .section .got2,"aw",@progbits
57 ; LARGE-NEXT: .p2align 2
59 ; LARGE-NEXT: .long bar
61 ; LARGE-NEXT: .long bar1
63 ; LARGE-NEXT: .long bar2