aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/GlobalOpt/deadglobal.ll
blob: cad5a91488ab0af9aa909a3fe5cc50e6624df05f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; RUN: opt < %s -globalopt -S | FileCheck %s

@G1 = internal global i32 123            ; <i32*> [#uses=1]

; CHECK-NOT: @G1
; CHECK: @G2
; CHECK-NOT: @G3

define void @foo1() {
; CHECK: define void @foo
; CHECK-NEXT: ret
        store i32 1, i32* @G1
        ret void
}

@G2 = linkonce_odr constant i32 42

define void @foo2() {
; CHECK: define void @foo2
; CHECK-NEXT: store
        store i32 1, i32* @G2
        ret void
}

@G3 = linkonce_odr constant i32 42