108 lines · plain
1; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=pic | FileCheck --check-prefixes=LARGE,LARGE-BSS %s2; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -mattr=+secure-plt -relocation-model=pic | FileCheck --check-prefixes=LARGE,LARGE-SECUREPLT %s3; RUN: llc < %s -mtriple=powerpc-unknown-netbsd -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s4; RUN: llc < %s -mtriple=powerpc-unknown-netbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s5; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s6; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s7; RUN: llc < %s -mtriple=powerpc-linux-musl -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s8; RUN: llc < %s -mtriple=powerpc-linux-musl -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s9$bar1 = comdat any10 11@bar = common global i32 0, align 412@bar1 = global i32 0, align 4, comdat($bar1)13@bar2 = global i32 0, align 4, comdat($bar1)14 15declare i32 @call_foo(i32, ...)16declare i32 @call_strictfp() strictfp17declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg)18 19define i32 @foo() {20entry:21 %0 = load i32, ptr @bar, align 422 %call = call i32 (i32, ...) @call_foo(i32 %0, i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64)23 ret i32 %024}25 26define i32 @foo1() strictfp {27entry:28 %call = call i32 (i32, ...) @call_foo(i32 0)29 ret i32 %call30}31 32define i32 @foo1_strictfp() strictfp {33entry:34 %call = call i32 () @call_strictfp()35 ret i32 %call36}37 38define void @foo2(ptr %a) {39 call void @llvm.memset.p0.i64(ptr align 1 %a, i8 1, i64 1000, i1 false)40 ret void41}42 43define i32 @load() {44entry:45 %0 = load i32, ptr @bar146 %1 = load i32, ptr @bar247 %2 = add i32 %0, %148 ret i32 %249}50 51!llvm.module.flags = !{!0}52!0 = !{i32 1, !"PIC Level", i32 2}53; LARGE-BSS: [[POFF:\.L[0-9]+\$poff]]:54; LARGE-BSS-NEXT: .long .LTOC-[[PB:\.L[0-9]+\$pb]]55; LARGE-BSS-NEXT: foo:56; LARGE-BSS: stwu 1, -32(1)57; LARGE-BSS: stw 30, 24(1)58; LARGE-BSS: bcl 20, 31, [[PB]]59; LARGE-BSS-NEXT: [[PB]]:60; LARGE-BSS: mflr 3061; LARGE-BSS: lwz [[REG:[0-9]+]], [[POFF]]-[[PB]](30)62; LARGE-BSS-NEXT: add 30, [[REG]], 3063; LARGE-BSS-DAG: lwz [[VREG:[0-9]+]], [[VREF:\.LC[0-9]+]]-.LTOC(30)64; LARGE-BSS-DAG: lwz {{[0-9]+}}, 0([[VREG]])65; LARGE-BSS-DAG: stw {{[0-9]+}}, 8(1)66; LARGE-BSS: lwz 30, 24(1)67; LARGE-SECUREPLT: addis 30, 30, .LTOC-.L0$pb@ha68; LARGE-SECUREPLT: addi 30, 30, .LTOC-.L0$pb@l69; LARGE-SECUREPLT: bl call_foo@PLT+3276870 71; LARGE-SECUREPLT-LABEL: foo1:72; LARGE-SECUREPLT: .L1$pb:73; LARGE-SECUREPLT-NEXT: crxor 6, 6, 674; LARGE-SECUREPLT-NEXT: mflr 3075; LARGE-SECUREPLT-NEXT: addis 30, 30, .LTOC-.L1$pb@ha76; LARGE-SECUREPLT-NEXT: addi 30, 30, .LTOC-.L1$pb@l77; LARGE-SECUREPLT-NEXT: li 3, 078; LARGE-SECUREPLT-NEXT: bl call_foo@PLT+3276879 80; LARGE-SECUREPLT-LABEL: foo1_strictfp:81; LARGE-SECUREPLT: .L2$pb:82; LARGE-SECUREPLT-NEXT: mflr 3083; LARGE-SECUREPLT-NEXT: addis 30, 30, .LTOC-.L2$pb@ha84; LARGE-SECUREPLT-NEXT: addi 30, 30, .LTOC-.L2$pb@l85; LARGE-SECUREPLT-NEXT: bl call_strictfp@PLT+3276886 87; LARGE-SECUREPLT-LABEL: foo2:88; LARGE-SECUREPLT: .L3$pb:89; LARGE-SECUREPLT: mflr 3090; LARGE-SECUREPLT-NEXT: addis 30, 30, .LTOC-.L3$pb@ha91; LARGE-SECUREPLT-NEXT: addi 30, 30, .LTOC-.L3$pb@l92; LARGE-SECUREPLT: bl memset@PLT+3276893 94; LARGE-SECUREPLT-LABEEL: load:95 96; LARGE: .section .bss.bar1,"awG",@nobits,bar1,comdat97; LARGE: bar1:98; LARGE: .section .bss.bar2,"awG",@nobits,bar1,comdat99; LARGE: bar2:100; LARGE: .section .got2,"aw",@progbits101; LARGE-NEXT: .p2align 2102; LARGE-NEXT: .LC0:103; LARGE-NEXT: .long bar104; LARGE-NEXT: .LC1:105; LARGE-NEXT: .long bar1106; LARGE-NEXT: .LC2:107; LARGE-NEXT: .long bar2108