1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll
Duncan Sands 26567dea82 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
2009-03-06 10:21:56 +00:00

12 lines
179 B
LLVM

; 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
}