summaryrefslogtreecommitdiffstats
path: root/llvm/test/FrontendC++/varargs.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-22 04:47:09 +0000
committerChris Lattner <sabre@nondot.org>2009-10-22 04:47:09 +0000
commit3e630653ad1905a2318cfbb0903d5a2414e96c0f (patch)
tree18c4444619244544e2b4dc3376d271272c0d4db2 /llvm/test/FrontendC++/varargs.cpp
parent2300f65e8c3964afbb0151fe37a4a8706fb1fbb8 (diff)
downloadbcm5719-llvm-3e630653ad1905a2318cfbb0903d5a2414e96c0f.tar.gz
bcm5719-llvm-3e630653ad1905a2318cfbb0903d5a2414e96c0f.zip
testcase for PR4678 & rdar://7309675
llvm-svn: 84830
Diffstat (limited to 'llvm/test/FrontendC++/varargs.cpp')
-rw-r--r--llvm/test/FrontendC++/varargs.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/FrontendC++/varargs.cpp b/llvm/test/FrontendC++/varargs.cpp
new file mode 100644
index 00000000000..1c07aedd093
--- /dev/null
+++ b/llvm/test/FrontendC++/varargs.cpp
@@ -0,0 +1,19 @@
+// RUN: %llvmgxx -S -emit-llvm %s -o - | FileCheck %s
+// rdar://7309675
+// PR4678
+
+// test1 should be compmiled to be a varargs function in the IR even
+// though there is no way to do a va_begin. Otherwise, the optimizer
+// will warn about 'dropped arguments' at the call site.
+
+// CHECK: define i32 @_Z5test1z(...)
+int test1(...) {
+ return -1;
+}
+
+// CHECK: call i32 (...)* @_Z5test1z(i32 0)
+void test() {
+ test1(0);
+}
+
+
OpenPOWER on IntegriCloud