mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-03 02:43:51 +00:00
New testcase
llvm-svn: 6942
This commit is contained in:
parent
cf6df3ef6b
commit
b70198e66b
21
test/Regression/Analysis/DSGraph/buglobals.ll
Normal file
21
test/Regression/Analysis/DSGraph/buglobals.ll
Normal file
@ -0,0 +1,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
|
||||
}
|
13
test/Regression/Analysis/DSGraph/constantize.ll
Normal file
13
test/Regression/Analysis/DSGraph/constantize.ll
Normal file
@ -0,0 +1,13 @@
|
||||
; Make sure that the ds-opt pass is constantizing globals
|
||||
;
|
||||
; RUN: as < %s | opt -ds-opt | dis | grep %G | grep constant
|
||||
|
||||
|
||||
%G = internal global int 0 ; <int*> [#uses=2]
|
||||
|
||||
implementation ; Functions:
|
||||
|
||||
int %main() {
|
||||
%A = load int* %G
|
||||
ret int %A
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user