diff options
author | Chris Lattner <sabre@nondot.org> | 2004-07-27 06:26:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-07-27 06:26:08 +0000 |
commit | 059f5a5e0579e8e45748ef1404612cfabe61c01c (patch) | |
tree | 06ca04247d100ab581ec43336152f0d13dea86f4 /test | |
parent | 1c2b1294d3f992aaee5262e62380ce2e730e6aa3 (diff) | |
download | llvm-059f5a5e0579e8e45748ef1404612cfabe61c01c.tar.gz llvm-059f5a5e0579e8e45748ef1404612cfabe61c01c.tar.bz2 llvm-059f5a5e0579e8e45748ef1404612cfabe61c01c.tar.xz |
Have some testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15258 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/GlobalsModRef/aliastest.ll | 9 | ||||
-rw-r--r-- | test/Analysis/GlobalsModRef/modreftest.ll | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/Analysis/GlobalsModRef/aliastest.ll b/test/Analysis/GlobalsModRef/aliastest.ll new file mode 100644 index 0000000000..19def38595 --- /dev/null +++ b/test/Analysis/GlobalsModRef/aliastest.ll @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse | llvm-dis | not grep load +%X = internal global int 4 + +int %test(int *%P) { + store int 7, int* %P + store int 12, int* %X ;; cannot alias P, X's addr isn't taken + %V = load int* %P + ret int %V +} diff --git a/test/Analysis/GlobalsModRef/modreftest.ll b/test/Analysis/GlobalsModRef/modreftest.ll new file mode 100644 index 0000000000..a08eef1b66 --- /dev/null +++ b/test/Analysis/GlobalsModRef/modreftest.ll @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse | llvm-dis | not grep load +%X = internal global int 4 + +int %test(int *%P) { + store int 12, int* %X + call void %doesnotmodX() + %V = load int* %X + ret int %V +} + +void %doesnotmodX() { + ret void +} |