Have some testcases
authorChris Lattner <sabre@nondot.org>
Tue, 27 Jul 2004 06:26:08 +0000 (06:26 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 27 Jul 2004 06:26:08 +0000 (06:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15258 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/GlobalsModRef/aliastest.ll [new file with mode: 0644]
test/Analysis/GlobalsModRef/modreftest.ll [new file with mode: 0644]

diff --git a/test/Analysis/GlobalsModRef/aliastest.ll b/test/Analysis/GlobalsModRef/aliastest.ll
new file mode 100644 (file)
index 0000000..19def38
--- /dev/null
@@ -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 (file)
index 0000000..a08eef1
--- /dev/null
@@ -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
+}