1
- ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=pic | FileCheck -check-prefix= LARGE-BSS %s
2
- ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix= LARGE-SECUREPLT %s
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
3
; RUN: llc < %s -mtriple=powerpc-unknown-netbsd -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
4
4
; RUN: llc < %s -mtriple=powerpc-unknown-netbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
5
5
; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
6
6
; RUN: llc < %s -mtriple=powerpc-unknown-openbsd -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
7
7
; RUN: llc < %s -mtriple=powerpc-linux-musl -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
8
8
; RUN: llc < %s -mtriple=powerpc-linux-musl -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
9
+ $bar1 = comdat any
10
+
9
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)
10
14
11
15
declare i32 @call_foo (i32 , ...)
12
16
@@ -17,6 +21,14 @@ entry:
17
21
ret i32 %0
18
22
}
19
23
24
+ define i32 @load () {
25
+ entry:
26
+ %0 = load i32 , i32* @bar1
27
+ %1 = load i32 , i32* @bar2
28
+ %2 = add i32 %0 , %1
29
+ ret i32 %2
30
+ }
31
+
20
32
!llvm.module.flags = !{!0 }
21
33
!0 = !{i32 1 , !"PIC Level" , i32 2 }
22
34
; LARGE-BSS: [[POFF:\.L[0-9]+\$poff]]:
@@ -33,10 +45,19 @@ entry:
33
45
; LARGE-BSS-DAG: lwz {{[0-9]+}}, 0([[VREG]])
34
46
; LARGE-BSS-DAG: stw {{[0-9]+}}, 8(1)
35
47
; LARGE-BSS: lwz 30, 24(1)
36
- ; LARGE-BSS: .section .got2,"aw",@progbits
37
- ; LARGE-BSS-NEXT: .p2align 2
38
- ; LARGE-BSS-NEXT: [[VREF]]:
39
- ; LARGE-BSS-NEXT: .long bar
40
48
; LARGE-SECUREPLT: addis 30, 30, .LTOC-.L0$pb@ha
41
49
; LARGE-SECUREPLT: addi 30, 30, .LTOC-.L0$pb@l
42
50
; LARGE-SECUREPLT: bl call_foo@PLT+32768
51
+
52
+ ; LARGE: .section .bss.bar1,"aGw",@nobits,bar1,comdat
53
+ ; LARGE: bar1:
54
+ ; LARGE: .section .bss.bar2,"aGw",@nobits,bar1,comdat
55
+ ; LARGE: bar2:
56
+ ; LARGE: .section .got2,"aw",@progbits
57
+ ; LARGE-NEXT: .p2align 2
58
+ ; LARGE-NEXT: .LC0:
59
+ ; LARGE-NEXT: .long bar
60
+ ; LARGE-NEXT: .LC1:
61
+ ; LARGE-NEXT: .long bar1
62
+ ; LARGE-NEXT: .LC2:
63
+ ; LARGE-NEXT: .long bar2
0 commit comments