From: Chris Lattner Date: Tue, 27 Jul 2004 06:26:08 +0000 (+0000) Subject: Have some testcases X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=059f5a5e0579e8e45748ef1404612cfabe61c01c;p=oota-llvm.git Have some testcases git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15258 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/GlobalsModRef/aliastest.ll b/test/Analysis/GlobalsModRef/aliastest.ll new file mode 100644 index 00000000000..19def385953 --- /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 00000000000..a08eef1b666 --- /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 +}