50 lines · plain
1; RUN: opt -S -passes=mergefunc < %s | FileCheck %s2 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_addr7; CHECK-NEXT: tail call void @test5()8; CHECK: define void @test4() unnamed_addr9; CHECK-NEXT: tail call void @test3()10; CHECK: define void @test2() unnamed_addr11; 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 void19}20 21define void @test2() unnamed_addr {22 call void @test4()23 call void @test4()24 ret void25}26 27define void @test3() unnamed_addr {28 call void @test5()29 call void @test5()30 ret void31}32 33define void @test4() unnamed_addr {34 call void @test6()35 call void @test6()36 ret void37}38 39define void @test5() unnamed_addr {40 call void @dummy()41 call void @dummy()42 ret void43}44 45define void @test6() unnamed_addr {46 call void @dummy()47 call void @dummy()48 ret void49}50