summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-03-06 10:21:56 +0000
committerDuncan Sands <baldrick@free.fr>2009-03-06 10:21:56 +0000
commited7228319a639eb8b542c1bd89218efd2d82d7a3 (patch)
tree05161854901886f59163e41094387cc749fc1ebf /llvm/test
parent55f46f6aabb1487ddeabe841713eb9f17b4533ba (diff)
downloadbcm5719-llvm-ed7228319a639eb8b542c1bd89218efd2d82d7a3.tar.gz
bcm5719-llvm-ed7228319a639eb8b542c1bd89218efd2d82d7a3.zip
While thinking about the one-definition-rule and trying
to find a tiny mouse hole to squeeze through, it struck me that globals without a name can be considered internal since they can't be referenced from outside the current module. This patch makes GlobalOpt give them internal linkage. Also done for aliases even though they always have names, since in my opinion anonymous aliases should be allowed for consistency with global variables and functions. So if that happens one day, this code is ready! llvm-svn: 66267
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll b/llvm/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll
new file mode 100644
index 00000000000..ea13d293d5f
--- /dev/null
+++ b/llvm/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep internal | count 2
+
+global i32 0
+define i32* @1() {
+ ret i32* @0
+}
+define i32* @f() {
+entry:
+ call i32* @1()
+ ret i32* %0
+}
OpenPOWER on IntegriCloud