xref: /llvm-project/llvm/test/Transforms/MergeFunc/unnamed-addr-reprocessing.ll (revision f38f99bd7671cee44c2a6a751fcab8685dbc3996)
1; RUN: opt -S -passes=mergefunc < %s | FileCheck %s
2
3; After the merge of test5 and test6, we can merge test3 and test4,
4; then test1 and test2.
5
6; CHECK: define void @test6() unnamed_addr
7; CHECK-NEXT: tail call void @test5()
8; CHECK: define void @test4() unnamed_addr
9; CHECK-NEXT: tail call void @test3()
10; CHECK: define void @test2() unnamed_addr
11; CHECK-NEXT: tail call void @test1()
12
13declare void @dummy()
14
15define void @test1() unnamed_addr {
16    call void @test3()
17    call void @test3()
18    ret void
19}
20
21define void @test2() unnamed_addr {
22    call void @test4()
23    call void @test4()
24    ret void
25}
26
27define void @test3() unnamed_addr {
28    call void @test5()
29    call void @test5()
30    ret void
31}
32
33define void @test4() unnamed_addr {
34    call void @test6()
35    call void @test6()
36    ret void
37}
38
39define void @test5() unnamed_addr {
40    call void @dummy()
41    call void @dummy()
42    ret void
43}
44
45define void @test6() unnamed_addr {
46    call void @dummy()
47    call void @dummy()
48    ret void
49}
50