2009-09-09 06:34:10 +08:00
|
|
|
; RUN: opt < %s -globalopt -S | not grep G
|
2004-10-08 03:16:26 +08:00
|
|
|
|
2008-03-01 17:15:35 +08:00
|
|
|
@G = internal global i32 17 ; <i32*> [#uses=3]
|
2004-10-08 03:16:26 +08:00
|
|
|
|
2008-03-01 17:15:35 +08:00
|
|
|
define void @foo() {
|
|
|
|
store i32 17, i32* @G
|
|
|
|
ret void
|
2004-10-08 03:16:26 +08:00
|
|
|
}
|
2008-03-01 17:15:35 +08:00
|
|
|
|
|
|
|
define i32 @bar() {
|
|
|
|
%X = load i32* @G ; <i32> [#uses=1]
|
|
|
|
ret i32 %X
|
2004-10-08 03:16:26 +08:00
|
|
|
}
|
|
|
|
|
2008-03-01 17:15:35 +08:00
|
|
|
define internal void @dead() {
|
|
|
|
store i32 123, i32* @G
|
|
|
|
ret void
|
2004-10-08 03:16:26 +08:00
|
|
|
}
|
2008-03-01 17:15:35 +08:00
|
|
|
|