1 ; RUN: llc < %s -mtriple=powerpc -relocation-model=pic | \
2 ; RUN: FileCheck -check-prefixes=SMALL,SMALL-BSS %s
3 ; RUN: llc < %s -mtriple=powerpc -relocation-model=pic -mattr=+secure-plt | \
4 ; RUN: FileCheck -check-prefixes=SMALL,SMALL-SECUREPLT %s
5 @bar = common global i32 0, align 4
7 declare i32 @call_foo(i32, ...)
11 %0 = load i32, i32* @bar, align 4
12 %call = call i32 (i32, ...) @call_foo(i32 %0, i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64)
16 !llvm.module.flags = !{!0}
17 !0 = !{i32 1, !"PIC Level", i32 1}
19 ; SMALL: stwu 1, -32(1)
20 ; SMALL: stw 30, 24(1)
21 ; SMALL-BSS: bl _GLOBAL_OFFSET_TABLE_@local-4
22 ; SMALL-SECURE: bl .L0$pb
24 ; SMALL-SECURE: addis 30, 30, _GLOBAL_OFFSET_TABLE_-.Lo$pb@ha
25 ; SMALL-SECURE: addi 30, 30, _GLOBAL_OFFSET_TABLE_-.Lo$pb@l
26 ; SMALL-DAG: stw {{[0-9]+}}, 8(1)
27 ; SMALL-DAG: lwz [[VREG:[0-9]+]], bar@GOT(30)
28 ; SMALL-DAG: lwz {{[0-9]+}}, 0([[VREG]])
29 ; SMALL: bl call_foo@PLT{{$}}
30 ; SMALL: lwz 30, 24(1)