| Justin Hibbits | a88b605 | 2014-11-12 15:16:30 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=pic | FileCheck -check-prefix=SMALL-BSS %s |
| 2 | @bar = common global i32 0, align 4 |
| Hal Finkel | 3ee2af7 | 2014-07-18 23:29:49 +0000 | [diff] [blame] | 3 | |
| Justin Hibbits | 654346e | 2015-01-10 01:57:21 +0000 | [diff] [blame] | 4 | declare i32 @call_foo(i32, ...) |
| 5 | |
| Hal Finkel | 3ee2af7 | 2014-07-18 23:29:49 +0000 | [diff] [blame] | 6 | define i32 @foo() { |
| 7 | entry: |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 8 | %0 = load i32, i32* @bar, align 4 |
| David Blaikie | 23af648 | 2015-04-16 23:24:18 +0000 | [diff] [blame] | 9 | %call = call i32 (i32, ...) @call_foo(i32 %0, i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64) |
| Justin Hibbits | 654346e | 2015-01-10 01:57:21 +0000 | [diff] [blame] | 10 | ret i32 0 |
| Hal Finkel | 3ee2af7 | 2014-07-18 23:29:49 +0000 | [diff] [blame] | 11 | } |
| 12 | |
| Justin Hibbits | a88b605 | 2014-11-12 15:16:30 +0000 | [diff] [blame] | 13 | !llvm.module.flags = !{!0} |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 14 | !0 = !{i32 1, !"PIC Level", i32 1} |
| Justin Hibbits | a88b605 | 2014-11-12 15:16:30 +0000 | [diff] [blame] | 15 | ; SMALL-BSS-LABEL:foo: |
| Justin Hibbits | 654346e | 2015-01-10 01:57:21 +0000 | [diff] [blame] | 16 | ; SMALL-BSS: stwu 1, -32(1) |
| Krzysztof Parzyszek | 020ec29 | 2016-09-06 12:30:00 +0000 | [diff] [blame] | 17 | ; SMALL-BSS: stw 30, 24(1) |
| Justin Hibbits | a88b605 | 2014-11-12 15:16:30 +0000 | [diff] [blame] | 18 | ; SMALL-BSS: bl _GLOBAL_OFFSET_TABLE_@local-4 |
| 19 | ; SMALL-BSS: mflr 30 |
| Justin Hibbits | 654346e | 2015-01-10 01:57:21 +0000 | [diff] [blame] | 20 | ; SMALL-BSS-DAG: stw {{[0-9]+}}, 8(1) |
| 21 | ; SMALL-BSS-DAG: lwz [[VREG:[0-9]+]], bar@GOT(30) |
| Justin Hibbits | 98a532d | 2015-01-08 15:47:19 +0000 | [diff] [blame] | 22 | ; SMALL-BSS-DAG: lwz {{[0-9]+}}, 0([[VREG]]) |
| Justin Hibbits | 654346e | 2015-01-10 01:57:21 +0000 | [diff] [blame] | 23 | ; SMALL-BSS: bl call_foo@PLT |
| Krzysztof Parzyszek | b66efb8 | 2016-09-22 17:22:43 +0000 | [diff] [blame^] | 24 | ; SMALL-BSS: lwz 30, 24(1) |