From e30d3c8292bbdcc9e01b28541aac86bf56fa5956 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 27 Jul 2004 06:26:08 +0000 Subject: [PATCH] Have some testcases llvm-svn: 15258 --- .../Regression/Analysis/GlobalsModRef/aliastest.ll | 9 +++++++++ .../Regression/Analysis/GlobalsModRef/modreftest.ll | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 llvm/test/Regression/Analysis/GlobalsModRef/aliastest.ll create mode 100644 llvm/test/Regression/Analysis/GlobalsModRef/modreftest.ll diff --git a/llvm/test/Regression/Analysis/GlobalsModRef/aliastest.ll b/llvm/test/Regression/Analysis/GlobalsModRef/aliastest.ll new file mode 100644 index 000000000000..19def3859532 --- /dev/null +++ b/llvm/test/Regression/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/llvm/test/Regression/Analysis/GlobalsModRef/modreftest.ll b/llvm/test/Regression/Analysis/GlobalsModRef/modreftest.ll new file mode 100644 index 000000000000..a08eef1b6661 --- /dev/null +++ b/llvm/test/Regression/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 +}