Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / ppc64-rel-so-local-calls.s
blob0be0d294deec398fcdc60e7a5124786037014ba5
1 // REQUIRES: ppc
3 // RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o
4 // RUN: ld.lld -shared %t.o -o %t.so
5 // RUN: llvm-readelf --dyn-relocations %t.so | FileCheck %s -allow-empty --implicit-check-not={{.}}
7 // RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o
8 // RUN: ld.lld -shared %t.o -o %t.so
9 // RUN: llvm-readelf --dyn-relocations %t.so | FileCheck %s -allow-empty --implicit-check-not={{.}}
11 .text
12 .abiversion 2
13 .globl baz
14 .p2align 4
15 .type baz,@function
16 baz:
17 .Lfunc_begin0:
18 .Lfunc_gep0:
19 addis 2, 12, .TOC.-.Lfunc_gep0@ha
20 addi 2, 2, .TOC.-.Lfunc_gep0@l
21 .Lfunc_lep0:
22 .localentry baz, .Lfunc_lep0-.Lfunc_gep0
23 mflr 0
24 std 0, 16(1)
25 stdu 1, -64(1)
26 std 30, 48(1)
27 std 29, 40(1)
28 mr 30, 3
29 bl foo
30 mr 29, 3
31 mr 3, 30
32 bl bar
33 mullw 3, 3, 29
34 ld 30, 48(1)
35 ld 29, 40(1)
36 extsw 3, 3
37 addi 1, 1, 64
38 ld 0, 16(1)
39 mtlr 0
40 blr
41 .long 0
42 .quad 0
43 .Lfunc_end0:
44 .size baz, .Lfunc_end0-.Lfunc_begin0
46 .p2align 4
47 .type foo,@function
48 foo:
49 .Lfunc_begin1:
50 mullw 3, 3, 3
51 extsw 3, 3
52 blr
53 .long 0
54 .quad 0
55 .Lfunc_end1:
56 .size foo, .Lfunc_end1-.Lfunc_begin1
58 .p2align 4
59 .type bar,@function
60 bar:
61 .Lfunc_begin2:
62 .Lfunc_gep2:
63 addis 2, 12, .TOC.-.Lfunc_gep2@ha
64 addi 2, 2, .TOC.-.Lfunc_gep2@l
65 .Lfunc_lep2:
66 .localentry bar, .Lfunc_lep2-.Lfunc_gep2
67 mflr 0
68 std 0, 16(1)
69 stdu 1, -48(1)
70 std 30, 32(1)
71 mr 30, 3
72 bl foo
73 mullw 3, 3, 30
74 ld 30, 32(1)
75 extsw 3, 3
76 addi 1, 1, 48
77 ld 0, 16(1)
78 mtlr 0
79 blr
80 .long 0
81 .quad 0
82 .Lfunc_end2:
83 .size bar, .Lfunc_end2-.Lfunc_begin2