[llvm-commits] [llvm] r84830 - in /llvm/trunk/test/FrontendC++: 2009-08-03-Varargs.cpp varargs.cpp

Chris Lattner sabre at nondot.org
Wed Oct 21 21:47:09 PDT 2009


Author: lattner
Date: Wed Oct 21 23:47:09 2009
New Revision: 84830

URL: http://llvm.org/viewvc/llvm-project?rev=84830&view=rev
Log:
testcase for PR4678 & rdar://7309675


Added:
    llvm/trunk/test/FrontendC++/varargs.cpp
Removed:
    llvm/trunk/test/FrontendC++/2009-08-03-Varargs.cpp

Removed: llvm/trunk/test/FrontendC++/2009-08-03-Varargs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2009-08-03-Varargs.cpp?rev=84829&view=auto

==============================================================================
--- llvm/trunk/test/FrontendC++/2009-08-03-Varargs.cpp (original)
+++ llvm/trunk/test/FrontendC++/2009-08-03-Varargs.cpp (removed)
@@ -1,5 +0,0 @@
-// RUN: %llvmgxx %s -S -emit-llvm -o - | grep _Z1az\(\.\.\.\)
-// XFAIL: *
-// PR4678
-void a(...) {
-}

Added: llvm/trunk/test/FrontendC++/varargs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/varargs.cpp?rev=84830&view=auto

==============================================================================
--- llvm/trunk/test/FrontendC++/varargs.cpp (added)
+++ llvm/trunk/test/FrontendC++/varargs.cpp Wed Oct 21 23:47:09 2009
@@ -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);
+}
+
+





More information about the llvm-commits mailing list