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/Transforms/DeadArgElim/basictest.ll b/test/Transforms/DeadArgElim/basictest.ll
new file mode 100644
index 0000000..a3a4235
--- /dev/null
+++ b/test/Transforms/DeadArgElim/basictest.ll
@@ -0,0 +1,37 @@
+; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim | llvm-dis | not grep DEADARG
+
+implementation
+
+; test - an obviously dead argument
+internal int %test(int %v, int %DEADARG1, int* %p) {
+	store int %v, int* %p
+	ret int %v
+}
+
+; hardertest - an argument which is only used by a call of a function with a 
+; dead argument.
+internal int %hardertest(int %DEADARG2) {
+	%p = alloca int
+	%V = call int %test(int 5, int %DEADARG2, int* %p)
+	ret int %V
+}
+
+; evenhardertest - recursive dead argument...
+internal void %evenhardertest(int %DEADARG3) {
+	call void %evenhardertest(int %DEADARG3)
+	ret void
+}
+
+internal void %needarg(int %TEST) {
+	call int %needarg2(int %TEST)
+	ret void
+}
+
+internal int %needarg2(int %TEST) {
+	ret int %TEST
+}
+
+internal void %needarg3(int %TEST3) {
+	call void %needarg(int %TEST3)
+	ret void
+}