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() {
|
2015-02-28 05:17:42 +08:00
|
|
|
%X = load i32, i32* @G ; <i32> [#uses=1]
|
2008-03-01 17:15:35 +08:00
|
|
|
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
|
|
|
|