[libcxx] r222298 - Cleanup quick_exit tests and get them passing in C++03.

Eric Fiselier eric at efcs.ca
Tue Nov 18 17:45:12 PST 2014


Author: ericwf
Date: Tue Nov 18 19:45:12 2014
New Revision: 222298

URL: http://llvm.org/viewvc/llvm-project?rev=222298&view=rev
Log:
Cleanup quick_exit tests and get them passing in C++03.

Wrap the original test in _LIBCPP_HAS_QUICK_EXIT so it only runs when we have
quick_exit and add two new tests that check that when _LIBCPP_HAS_QUICK_EXIT
is not defined then no definition of std::at_quick_exit or std::quick_exit are
available.

Added:
    libcxx/trunk/test/language.support/support.start.term/quick_exit_check1.fail.cpp
    libcxx/trunk/test/language.support/support.start.term/quick_exit_check2.fail.cpp
Modified:
    libcxx/trunk/test/language.support/support.start.term/quick_exit.pass.cpp

Modified: libcxx/trunk/test/language.support/support.start.term/quick_exit.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/language.support/support.start.term/quick_exit.pass.cpp?rev=222298&r1=222297&r2=222298&view=diff
==============================================================================
--- libcxx/trunk/test/language.support/support.start.term/quick_exit.pass.cpp (original)
+++ libcxx/trunk/test/language.support/support.start.term/quick_exit.pass.cpp Tue Nov 18 19:45:12 2014
@@ -12,12 +12,13 @@
 // test quick_exit and at_quick_exit
 
 #include <cstdlib>
-#include <type_traits>
 
 void f() {}
 
 int main()
 {
+#ifdef _LIBCPP_HAS_QUICK_EXIT
     std::at_quick_exit(f);
-    quick_exit(0);
+    std::quick_exit(0);
+#endif
 }

Added: libcxx/trunk/test/language.support/support.start.term/quick_exit_check1.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/language.support/support.start.term/quick_exit_check1.fail.cpp?rev=222298&view=auto
==============================================================================
--- libcxx/trunk/test/language.support/support.start.term/quick_exit_check1.fail.cpp (added)
+++ libcxx/trunk/test/language.support/support.start.term/quick_exit_check1.fail.cpp Tue Nov 18 19:45:12 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+
+// test that referencing at_quick_exit when _LIBCPP_HAS_QUICK_EXIT is not defined
+// results in a compile error.
+
+#include <cstdlib>
+
+void f() {}
+
+int main()
+{
+#ifndef _LIBCPP_HAS_QUICK_EXIT
+    std::at_quick_exit(f);
+#else
+#error
+#endif
+}

Added: libcxx/trunk/test/language.support/support.start.term/quick_exit_check2.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/language.support/support.start.term/quick_exit_check2.fail.cpp?rev=222298&view=auto
==============================================================================
--- libcxx/trunk/test/language.support/support.start.term/quick_exit_check2.fail.cpp (added)
+++ libcxx/trunk/test/language.support/support.start.term/quick_exit_check2.fail.cpp Tue Nov 18 19:45:12 2014
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+
+// test that referencing quick_exit when _LIBCPP_HAS_QUICK_EXIT is not defined
+// results in a compile error.
+
+#include <cstdlib>
+
+void f() {}
+
+int main()
+{
+#ifndef _LIBCPP_HAS_QUICK_EXIT
+    std::quick_exit(0);
+#else
+#error
+#endif
+}





More information about the cfe-commits mailing list