summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
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
+}