summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/MergeFunc/unnamed-addr-reprocessing.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/MergeFunc/unnamed-addr-reprocessing.ll')
-rw-r--r--llvm/test/Transforms/MergeFunc/unnamed-addr-reprocessing.ll35
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/test/Transforms/MergeFunc/unnamed-addr-reprocessing.ll b/llvm/test/Transforms/MergeFunc/unnamed-addr-reprocessing.ll
new file mode 100644
index 00000000000..5902edc0e88
--- /dev/null
+++ b/llvm/test/Transforms/MergeFunc/unnamed-addr-reprocessing.ll
@@ -0,0 +1,35 @@
+; RUN: opt -S -mergefunc < %s | FileCheck %s
+
+; After test3 and test4 have been merged, we should detect that
+; test1 and test2 can also be merged.
+
+; CHECK: define void @test4() unnamed_addr
+; CHECK-NEXT: tail call void @test3()
+; CHECK: define void @test2() unnamed_addr
+; CHECK-NEXT: tail call void @test1()
+
+declare void @dummy()
+
+define void @test1() unnamed_addr {
+ call void @test3()
+ call void @test3()
+ ret void
+}
+
+define void @test2() unnamed_addr {
+ call void @test4()
+ call void @test4()
+ ret void
+}
+
+define void @test3() unnamed_addr {
+ call void @dummy()
+ call void @dummy()
+ ret void
+}
+
+define void @test4() unnamed_addr {
+ call void @dummy()
+ call void @dummy()
+ ret void
+}
OpenPOWER on IntegriCloud