It's not necessary to do rounding for alloca operations when the requested
alignment is equal to the stack alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40004 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/GlobalsModRef/purecse.ll b/test/Analysis/GlobalsModRef/purecse.ll
new file mode 100644
index 0000000..0c95182
--- /dev/null
+++ b/test/Analysis/GlobalsModRef/purecse.ll
@@ -0,0 +1,23 @@
+; Test that pure functions are cse'd away
+
+; RUN: llvm-upgrade < %s | llvm-as | opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | not grep sub
+
+int %pure(int %X) {
+	%Y = add int %X, 1
+	ret int %Y
+}
+
+int %test1(int %X) {
+	%A = call int %pure(int %X)
+	%B = call int %pure(int %X)
+	%C = sub int %A, %B
+	ret int %C
+}
+
+int %test2(int %X, int* %P) {
+	%A = call int %pure(int %X)
+	store int %X, int* %P          ;; Does not invalidate 'pure' call.
+	%B = call int %pure(int %X)
+	%C = sub int %A, %B
+	ret int %C
+}