aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-06-12 15:56:56 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-06-12 15:56:56 +0000
commit8728d7a3ea7cad3297f9ab0984358007238ae83a (patch)
tree90aabaabcaa37310a279b03150c147cfa9126b44 /test/Transforms
parent7e0842fb21791d2600ac763cc41931003ae4d878 (diff)
Given two identical weak functions, produce one internal function and two weak
thunks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73230 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/MergeFunc/fold-weak.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/MergeFunc/fold-weak.ll b/test/Transforms/MergeFunc/fold-weak.ll
new file mode 100644
index 0000000000..cea49fb1ce
--- /dev/null
+++ b/test/Transforms/MergeFunc/fold-weak.ll
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | opt -mergefunc | llvm-dis > %t
+; RUN: grep {define weak} %t | count 2
+; RUN: grep {call} %t | count 2
+
+define weak i32 @sum(i32 %x, i32 %y) {
+ %sum = add i32 %x, %y
+ ret i32 %sum
+}
+
+define weak i32 @add(i32 %x, i32 %y) {
+ %sum = add i32 %x, %y
+ ret i32 %sum
+}