diff options
author | Chris Lattner <sabre@nondot.org> | 2003-06-28 21:56:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-06-28 21:56:22 +0000 |
commit | 607411bfbb6a6e2a5def32066722e6a655dfe01d (patch) | |
tree | 428cb4b9ce5c8aa28c5b835bd5ad15c9fe7d98cd /test | |
parent | 934fe856b58de326c9bca98b1493745d1c99727d (diff) | |
download | external_llvm-607411bfbb6a6e2a5def32066722e6a655dfe01d.zip external_llvm-607411bfbb6a6e2a5def32066722e6a655dfe01d.tar.gz external_llvm-607411bfbb6a6e2a5def32066722e6a655dfe01d.tar.bz2 |
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6942 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/DSGraph/buglobals.ll | 21 | ||||
-rw-r--r-- | test/Analysis/DSGraph/constantize.ll | 13 |
2 files changed, 34 insertions, 0 deletions
diff --git a/test/Analysis/DSGraph/buglobals.ll b/test/Analysis/DSGraph/buglobals.ll new file mode 100644 index 0000000..11fc72c --- /dev/null +++ b/test/Analysis/DSGraph/buglobals.ll @@ -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 +} diff --git a/test/Analysis/DSGraph/constantize.ll b/test/Analysis/DSGraph/constantize.ll new file mode 100644 index 0000000..08f0338 --- /dev/null +++ b/test/Analysis/DSGraph/constantize.ll @@ -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 +} |