aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis/DSGraph/buglobals.ll
blob: 11fc72c429e55eeb8dfc65e5217c53010436f9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; This tests to make sure that G ends up in the globals graph of the BU pass.
; If it is not, then %G will get converted to a 'constant' from a 'global'
;
; RUN: as < %s | opt -ds-opt -globaldce | dis | grep %G


%G = internal global int 0		; <int*> [#uses=2]

implementation   ; Functions:

internal void %foo() {
	%tmp.0 = load int* %G		; <int> [#uses=1]
	%tmp.1 = add int %tmp.0, 1		; <int> [#uses=1]
	store int %tmp.1, int* %G
	ret void
}

int %main() {
	call void %foo( )
	ret int 0
}