[libcxx] r200724 - Fix numeric.limits.members/traps.pass.cpp to pass on non-x86 architectures. Fixes bug #18468

Marshall Clow mclow.lists at gmail.com
Mon Feb 3 15:26:56 PST 2014


Author: marshall
Date: Mon Feb  3 17:26:56 2014
New Revision: 200724

URL: http://llvm.org/viewvc/llvm-project?rev=200724&view=rev
Log:
Fix numeric.limits.members/traps.pass.cpp to pass on non-x86 architectures. Fixes bug #18468

Modified:
    libcxx/trunk/test/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp

Modified: libcxx/trunk/test/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp?rev=200724&r1=200723&r2=200724&view=diff
==============================================================================
--- libcxx/trunk/test/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp (original)
+++ libcxx/trunk/test/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp Mon Feb  3 17:26:56 2014
@@ -13,6 +13,12 @@
 
 #include <limits>
 
+#if (defined(__i386__) || defined(__x86_64__))
+static const bool integral_types_trap = true;
+#else
+static const bool integral_types_trap = false;
+#endif
+
 template <class T, bool expected>
 void
 test()
@@ -26,22 +32,22 @@ test()
 int main()
 {
     test<bool, false>();
-    test<char, true>();
-    test<signed char, true>();
-    test<unsigned char, true>();
-    test<wchar_t, true>();
+    test<char, integral_types_trap>();
+    test<signed char, integral_types_trap>();
+    test<unsigned char, integral_types_trap>();
+    test<wchar_t, integral_types_trap>();
 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-    test<char16_t, true>();
-    test<char32_t, true>();
+    test<char16_t, integral_types_trap>();
+    test<char32_t, integral_types_trap>();
 #endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
-    test<short, true>();
-    test<unsigned short, true>();
-    test<int, true>();
-    test<unsigned int, true>();
-    test<long, true>();
-    test<unsigned long, true>();
-    test<long long, true>();
-    test<unsigned long long, true>();
+    test<short, integral_types_trap>();
+    test<unsigned short, integral_types_trap>();
+    test<int, integral_types_trap>();
+    test<unsigned int, integral_types_trap>();
+    test<long, integral_types_trap>();
+    test<unsigned long, integral_types_trap>();
+    test<long long, integral_types_trap>();
+    test<unsigned long long, integral_types_trap>();
     test<float, false>();
     test<double, false>();
     test<long double, false>();





More information about the cfe-commits mailing list