When rewriting a call to a K&R function to lead to a well-prototyped
function, be sure to drop parameter attributes when dropping their
associated arguments.  Patch by Aaron Landwehr!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136753 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/kr-call.c b/test/CodeGen/kr-call.c
new file mode 100644
index 0000000..97068bc
--- /dev/null
+++ b/test/CodeGen/kr-call.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple s390x-unknown-linux -emit-llvm -o - %s | FileCheck %s
+
+// Test that we don't crash.  The s390x-unknown-linux target happens
+// to need to set a sext argument attribute on this call, and we need
+// to make sure that rewriting it correctly drops that attribute when
+// also dropping the spurious argument.
+void test0_helper();
+void test0() {
+  // CHECK: call void @test0_helper()
+  test0_helper(1);
+}
+void test0_helper() {}
+