aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/SCCP/ipsccp-gvar.ll
blob: ecbd9596952130bf55c33f3c37292b1b89592272 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
; RUN: opt < %s -ipsccp -S | not grep global

@G = internal global i32 undef		; <i32*> [#uses=5]

define void @foo() {
	%X = load i32* @G		; <i32> [#uses=1]
	store i32 %X, i32* @G
	ret void
}

define i32 @bar() {
	%V = load i32* @G		; <i32> [#uses=2]
	%C = icmp eq i32 %V, 17		; <i1> [#uses=1]
	br i1 %C, label %T, label %F
T:		; preds = %0
	store i32 17, i32* @G
	ret i32 %V
F:		; preds = %0
	store i32 123, i32* @G
	ret i32 0
}