summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-09-09 19:04:59 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-09-09 19:04:59 +0000
commite4c6b61ebd8f2dbb6a2e51fe1d0e2bdbe17986c4 (patch)
tree5af548f33ed717c5eba0d3b48da5f1e796198ba4 /test/Transforms
parentbd297bcd4a69dd14e97afae555b593a25071fb6f (diff)
downloadllvm-e4c6b61ebd8f2dbb6a2e51fe1d0e2bdbe17986c4.tar.gz
llvm-e4c6b61ebd8f2dbb6a2e51fe1d0e2bdbe17986c4.tar.bz2
llvm-e4c6b61ebd8f2dbb6a2e51fe1d0e2bdbe17986c4.tar.xz
Resolve aliases, when possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/GlobalOpt/alias-resolve.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/GlobalOpt/alias-resolve.ll b/test/Transforms/GlobalOpt/alias-resolve.ll
new file mode 100644
index 0000000000..3cae4138fd
--- /dev/null
+++ b/test/Transforms/GlobalOpt/alias-resolve.ll
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | opt -globalopt | llvm-dis > %t
+; RUN: cat %t | grep foo1 | count 1
+; RUN: cat %t | grep foo2 | count 4
+; RUN: cat %t | grep bar1 | count 1
+; RUN: cat %t | grep bar2 | count 4
+
+@foo1 = alias void ()* @foo2
+@foo2 = alias weak void()* @bar1
+@bar1 = alias void ()* @bar2
+
+declare void @bar2()
+
+define void @baz() {
+entry:
+ call void @foo1()
+ call void @foo2()
+ call void @bar1()
+ ret void
+}