summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/GlobalsModRef/aliastest.ll9
-rw-r--r--test/Analysis/GlobalsModRef/modreftest.ll13
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
+}