aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-02-15 09:56:08 +0000
committerDuncan Sands <baldrick@free.fr>2009-02-15 09:56:08 +0000
commit4782b305c2ccc2b2e5a4cad65d7ffd15395d0727 (patch)
treec9e51598d061acb8b270194c8b42c6bbff341feb /test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll
parentb599979ab591a6f4557337a4190153094725ef45 (diff)
downloadexternal_llvm-4782b305c2ccc2b2e5a4cad65d7ffd15395d0727.zip
external_llvm-4782b305c2ccc2b2e5a4cad65d7ffd15395d0727.tar.gz
external_llvm-4782b305c2ccc2b2e5a4cad65d7ffd15395d0727.tar.bz2
If the target of an alias has internal linkage, then the
alias can be morphed into the target. Implement this transform, and fix a crash in the existing transform at the same time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll')
-rw-r--r--test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll b/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll
new file mode 100644
index 0000000..e59c8df
--- /dev/null
+++ b/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | opt -globalopt
+
+@g = external global i32
+
+@a = alias bitcast (i32* @g to i8*)
+
+define void @f() {
+ %tmp = load i8* @a
+ ret void
+}