brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 9f2d5e4 Raw
56 lines · plain
1; RUN: opt -S -passes=mergefunc < %s | FileCheck %s2 3; We should normalize to test2 rather than test1,4; because it allows us to drop test1 entirely5 6; CHECK-NOT: define internal void @test1() unnamed_addr7; CHECK: define void @test3() unnamed_addr8; CHECK-NEXT: call void @test2()9; CHECK-NEXT: call void @test2()10 11declare void @dummy()12 13define internal void @test1() unnamed_addr {14    call void @dummy()15    call void @dummy()16    ret void17}18 19define void @test2() unnamed_addr {20    call void @dummy()21    call void @dummy()22    ret void23}24 25define void @test3() unnamed_addr {26    call void @test1()27    call void @test2()28    ret void29}30 31; We should normalize to the existing test6 rather than32; to a new anonymous strong backing function33 34; CHECK: define weak void @test5()35; CHECK-NEXT: tail call void @test6()36; CHECK: define weak void @test4()37; CHECK-NEXT: tail call void @test6()38 39declare void @dummy2()40 41define weak void @test4() {42    call void @dummy2()43    call void @dummy2()44    ret void45}46define weak void @test5() {47    call void @dummy2()48    call void @dummy2()49    ret void50}51define void @test6() {52    call void @dummy2()53    call void @dummy2()54    ret void55}56