File: ppc32-pic.ll

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,436 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (30 lines) | stat: -rw-r--r-- 1,081 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
; RUN: llc < %s -mtriple=powerpc -relocation-model=pic | \
; RUN:    FileCheck -check-prefixes=SMALL,SMALL-BSS %s
; RUN: llc < %s -mtriple=powerpc -relocation-model=pic -mattr=+secure-plt | \
; RUN:    FileCheck -check-prefixes=SMALL,SMALL-SECUREPLT %s
@bar = common global i32 0, align 4

declare i32 @call_foo(i32, ...)

define i32 @foo() {
entry:
  %0 = load i32, i32* @bar, align 4
  %call = call i32 (i32, ...) @call_foo(i32 %0, i32 0, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64)
  ret i32 0
}

!llvm.module.flags = !{!0}
!0 = !{i32 1, !"PIC Level", i32 1}
; SMALL-LABEL: foo:
; SMALL:         stwu 1, -32(1)
; SMALL:         stw 30, 24(1)
; SMALL-BSS:     bl _GLOBAL_OFFSET_TABLE_@local-4
; SMALL-SECURE:  bl .L0$pb
; SMALL:         mflr 30
; SMALL-SECURE:  addis 30, 30, _GLOBAL_OFFSET_TABLE_-.Lo$pb@ha
; SMALL-SECURE:  addi 30, 30, _GLOBAL_OFFSET_TABLE_-.Lo$pb@l
; SMALL-DAG:     stw {{[0-9]+}}, 8(1)
; SMALL-DAG:     lwz [[VREG:[0-9]+]], bar@GOT(30)
; SMALL-DAG:     lwz {{[0-9]+}}, 0([[VREG]])
; SMALL:         bl call_foo@PLT{{$}}
; SMALL:         lwz 30, 24(1)