]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++.exp (check_v3_target_stdint): New.
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 8 Jul 2008 01:11:18 +0000 (01:11 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 8 Jul 2008 01:11:18 +0000 (01:11 +0000)
2008-07-07  Paolo Carlini  <paolo.carlini@oracle.com>

* testsuite/lib/libstdc++.exp (check_v3_target_stdint): New.
* testsuite/lib/dg-options.exp (dg-require-cstdint): New.
* testsuite/20_util/ratio/cons/cons1.cc: Use it.
* testsuite/20_util/ratio/cons/cons_overflow.cc: Likewise.
* testsuite/20_util/ratio/operations/ops1.cc: Likewise.
* testsuite/20_util/ratio/operations/ops2.cc: Likewise.
* testsuite/20_util/ratio/operations/ops3.cc: Likewise.
* testsuite/20_util/ratio/operations/ops_overflow.cc: Likewise.
* testsuite/20_util/ratio/comparisons/comp1.cc: Likewise.
* testsuite/20_util/ratio/comparisons/comp2.cc: Likewise.

* include/std/type_traits: Fix comment typo.

From-SVN: r137612

12 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/type_traits
libstdc++-v3/testsuite/20_util/ratio/comparisons/comp1.cc
libstdc++-v3/testsuite/20_util/ratio/comparisons/comp2.cc
libstdc++-v3/testsuite/20_util/ratio/cons/cons1.cc
libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow.cc
libstdc++-v3/testsuite/20_util/ratio/operations/ops1.cc
libstdc++-v3/testsuite/20_util/ratio/operations/ops2.cc
libstdc++-v3/testsuite/20_util/ratio/operations/ops3.cc
libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow.cc
libstdc++-v3/testsuite/lib/dg-options.exp
libstdc++-v3/testsuite/lib/libstdc++.exp

index db08bef03c249c1a8ff40b8416ca3846c709a302..d4c02c747e7c1a33c01025d3841d6a70ce9aa35b 100644 (file)
@@ -1,3 +1,18 @@
+2008-07-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * testsuite/lib/libstdc++.exp (check_v3_target_stdint): New.
+       * testsuite/lib/dg-options.exp (dg-require-cstdint): New.
+       * testsuite/20_util/ratio/cons/cons1.cc: Use it.
+       * testsuite/20_util/ratio/cons/cons_overflow.cc: Likewise.
+       * testsuite/20_util/ratio/operations/ops1.cc: Likewise.
+       * testsuite/20_util/ratio/operations/ops2.cc: Likewise.
+       * testsuite/20_util/ratio/operations/ops3.cc: Likewise.
+       * testsuite/20_util/ratio/operations/ops_overflow.cc: Likewise.
+       * testsuite/20_util/ratio/comparisons/comp1.cc: Likewise.
+       * testsuite/20_util/ratio/comparisons/comp2.cc: Likewise.
+
+       * include/std/type_traits: Fix comment typo.
+
 2008-07-06  Roger Sayle  <roger@eyesopen.com>
 
        * include/std/system_error (is_error_code_enum): Use identifier
index 5fdc95ecad98875cd93f09fa8730d47c0a0f39a6..6c97280a41bd1c3c708feaea22d85b4b45170e17 100644 (file)
@@ -203,13 +203,13 @@ namespace std
     : public integral_constant<bool, __has_trivial_destructor(_Tp)>
     { };
 
-  /// has_nothrow_default_destructor
+  /// has_nothrow_default_constructor
   template<typename _Tp>
     struct has_nothrow_default_constructor
     : public integral_constant<bool, __has_nothrow_constructor(_Tp)>
     { };
 
-  /// has_nothrow_copy_destructor
+  /// has_nothrow_copy_constructor
   template<typename _Tp>
     struct has_nothrow_copy_constructor
     : public integral_constant<bool, __has_nothrow_copy(_Tp)>
index 73064c70919aaa99d32456a62ac08187072f42e0..c916b3099984089da00205f6319a1d278e73a61f 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
 
 // Copyright (C) 2008 Free Software Foundation
 //
@@ -21,8 +22,6 @@
 #include <ratio>
 #include <testsuite_hooks.h>
 
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
-
 void
 test01()
 {
@@ -31,10 +30,10 @@ test01()
   VERIFY(( std::ratio_equal<std::ratio<2,6>, std::ratio<1,3>>::value == 1 ));
   VERIFY(( std::ratio_equal<std::ratio<2,6>, std::ratio<1,4>>::value == 0 ));
   
-  VERIFY(std::ratio_not_equal<std::ratio<2,6>, 
-           std::ratio<1,3>>::value == 0 ));
-  VERIFY(std::ratio_not_equal<std::ratio<2,6>, 
-           std::ratio<1,4>>::value == 1 ));
+  VERIFY( (std::ratio_not_equal<std::ratio<2,6>, 
+           std::ratio<1,3>>::value == 0);
+  VERIFY( (std::ratio_not_equal<std::ratio<2,6>, 
+           std::ratio<1,4>>::value == 1);
 }
 
 void
@@ -42,46 +41,42 @@ test02()
 {
   bool test __attribute__((unused)) = true;
  
-  VERIFY(( std::ratio_less<std::ratio<1,4>, std::ratio<1,3>>::value == 1 ));
-  VERIFY(( std::ratio_less<std::ratio<-1,3>, std::ratio<1,3>>::value == 1 ));
+  VERIFY( (std::ratio_less<std::ratio<1,4>, std::ratio<1,3>>::value == 1) );
+  VERIFY( (std::ratio_less<std::ratio<-1,3>, std::ratio<1,3>>::value == 1) );
   
-  VERIFY(( std::ratio_less<std::ratio<1,3>, std::ratio<1,4>>::value == 0 ));
-  VERIFY(( std::ratio_less<std::ratio<1,3>, std::ratio<-1,3>>::value == 0 ));
+  VERIFY( (std::ratio_less<std::ratio<1,3>, std::ratio<1,4>>::value == 0) );
+  VERIFY( (std::ratio_less<std::ratio<1,3>, std::ratio<-1,3>>::value == 0) );
       
-  VERIFY(std::ratio_less_equal<std::ratio<-1,3>, 
-           std::ratio<-1,3>>::value == 1 ));
-  VERIFY(( std::ratio_less_equal<std::ratio<1,4>, 
-           std::ratio<1,3>>::value == 1 ));
+  VERIFY( (std::ratio_less_equal<std::ratio<-1,3>, 
+           std::ratio<-1,3>>::value == 1);
+  VERIFY( ( std::ratio_less_equal<std::ratio<1,4>, 
+           std::ratio<1,3>>::value == 1);
   
-  VERIFY(std::ratio_less_equal<std::ratio<1,4>, 
-           std::ratio<-1,3>>::value == 0 ));
-  VERIFY(std::ratio_less_equal<std::ratio<1,3>, 
-           std::ratio<-1,3>>::value == 0 ));
+  VERIFY( (std::ratio_less_equal<std::ratio<1,4>, 
+           std::ratio<-1,3>>::value == 0);
+  VERIFY( (std::ratio_less_equal<std::ratio<1,3>, 
+           std::ratio<-1,3>>::value == 0);
   
-  VERIFY(( std::ratio_greater<std::ratio<1,3>, std::ratio<1,4>>::value == 1 ));
-  VERIFY(( std::ratio_greater<std::ratio<1,3>, std::ratio<-1,3>>::value == 1 ));
+  VERIFY( (std::ratio_greater<std::ratio<1,3>, std::ratio<1,4>>::value == 1) );
+  VERIFY( (std::ratio_greater<std::ratio<1,3>, std::ratio<-1,3>>::value == 1) );
   
-  VERIFY(( std::ratio_greater<std::ratio<1,4>, std::ratio<1,3>>::value == 0 ));
-  VERIFY(( std::ratio_greater<std::ratio<-1,3>, std::ratio<1,3>>::value == 0 ));
+  VERIFY( (std::ratio_greater<std::ratio<1,4>, std::ratio<1,3>>::value == 0) );
+  VERIFY( (std::ratio_greater<std::ratio<-1,3>, std::ratio<1,3>>::value == 0) );
 
-  VERIFY(( std::ratio_greater_equal<std::ratio<1,3>, 
-           std::ratio<1,3>>::value == 1 ));
-  VERIFY(( std::ratio_greater_equal<std::ratio<1,3>, 
-           std::ratio<-1,3>>::value == 1 ));
-  
-  VERIFY(( std::ratio_greater_equal<std::ratio<-1,3>, 
-           std::ratio<1,3>>::value == 0 ));
-  VERIFY(( std::ratio_greater_equal<std::ratio<1,4>, 
-           std::ratio<1,3>>::value == 0 ));
-}
+  VERIFY( (std::ratio_greater_equal<std::ratio<1,3>, 
+           std::ratio<1,3>>::value == 1) );
+  VERIFY( (std::ratio_greater_equal<std::ratio<1,3>, 
+           std::ratio<-1,3>>::value == 1) );
 
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
+  VERIFY( (std::ratio_greater_equal<std::ratio<-1,3>, 
+           std::ratio<1,3>>::value == 0) );
+  VERIFY( (std::ratio_greater_equal<std::ratio<1,4>, 
+           std::ratio<1,3>>::value == 0) );
+}
 
 int main()
 {
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
   test01();
   test02();
-#endif
   return 0;
 }
index 1d378d528802951f88ae59b6d730a6e28d459679..56052e45328e23d8beb7c20f893946b2220e9b4e 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
 
 // Copyright (C) 2008 Free Software Foundation
 //
@@ -21,8 +22,6 @@
 #include <ratio>
 #include <testsuite_hooks.h>
 
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
-
 static const std::intmax_t M = INTMAX_MAX;
 
 void
@@ -30,27 +29,23 @@ test01()
 {
   bool test __attribute__((unused)) = true;
  
-  //no overflow with same denominator
-  VERIFY(std::ratio_less<std::ratio<M - 2, M>,
-           std::ratio<M - 1, M>>::value == 1 ) );
+  // No overflow with same denominator
+  VERIFY( (std::ratio_less<std::ratio<M - 2, M>,
+           std::ratio<M - 1, M>>::value == 1) );
   
-  VERIFY(std::ratio_less<std::ratio<M - 1, M>,
-           std::ratio<M - 2, M>>::value == 0 ) );
-           
-  //no overflow if signs differ
-  VERIFY(std::ratio_less<std::ratio<-M, M - 1>,
-           std::ratio<M - 1, M - 2>>::value == 1 ) );
+  VERIFY( (std::ratio_less<std::ratio<M - 1, M>,
+           std::ratio<M - 2, M>>::value == 0) );
+     
+  // No overflow if signs differ
+  VERIFY( (std::ratio_less<std::ratio<-M, M - 1>,
+           std::ratio<M - 1, M - 2>>::value == 1) );
   
-  VERIFY(std::ratio_less<std::ratio<M - 1, M - 2>,
-           std::ratio<-M, M - 1>>::value == 0 ) );
+  VERIFY( (std::ratio_less<std::ratio<M - 1, M - 2>,
+           std::ratio<-M, M - 1>>::value == 0) );
 }
 
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
-
 int main()
 {
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
   test01();
-#endif
   return 0;
 }
index dc2f0dabd70457e3969c120bc16fa1607879cf37..84860699ac8fab2ee39cd0a47f8e74ad9322b537 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
 
 // 2008-07-03 Chris Fairles <chris.fairles@gmail.com>
 
@@ -23,8 +24,6 @@
 #include <ratio>
 #include <testsuite_hooks.h>
 
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
-
 void
 test01()
 {
@@ -46,12 +45,8 @@ test01()
   VERIFY( r3.den == r0.den );  
 }
 
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
-
 int main()
 {
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
   test01();
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
   return 0;
 }
index 05daee5ea32b756f00ca5ec4348d123be1bfb005..570ea6cbc7d52558e151b20598ffba7d85ae8731 100644 (file)
@@ -1,5 +1,6 @@
-// { dg-options "-std=gnu++0x" }
 // { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
 
 // Copyright (C) 2008 Free Software Foundation
 //
@@ -21,8 +22,6 @@
 
 #include <ratio>
 
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
-
 void
 test01()
 {
@@ -48,11 +47,9 @@ test04()
   std::ratio<1,0> r1;
 }
 
-// { dg-error "instantiated from here" "" { target *-*-* } 36 }
-// { dg-error "instantiated from here" "" { target *-*-* } 42 }
-// { dg-error "instantiated from here" "" { target *-*-* } 48 }
+// { dg-error "instantiated from here" "" { target *-*-* } 35 }
+// { dg-error "instantiated from here" "" { target *-*-* } 41 }
+// { dg-error "instantiated from here" "" { target *-*-* } 47 }
 // { dg-error "denominator cannot be zero" "" { target *-*-* } 150 }
 // { dg-error "out of range" "" { target *-*-* } 151 }
 // { dg-excess-errors "In instantiation of" }
-
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
index 3f6a91d2180f8f6c16055ad697eb60ab5c3cdada..b05092dd8e9d22ff2ad288bacc8f2cffb2a1c736 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
 
 // 2008-07-03 Chris Fairles <chris.fairles@gmail.com>
 
@@ -23,8 +24,6 @@
 #include <ratio>
 #include <testsuite_hooks.h>
 
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
-
 void
 test01()
 {
@@ -32,8 +31,8 @@ test01()
 
   std::ratio_add<std::ratio<3,8>, std::ratio<5,12>>::type r;
 
-  VERIFY( r.num == 19);
-  VERIFY( r.den == 24);
+  VERIFY( r.num == 19 );
+  VERIFY( r.den == 24 );
 }
 
 void
@@ -42,8 +41,8 @@ test02()
   bool test __attribute__((unused)) = true;
   std::ratio_subtract<std::ratio<3,8>, std::ratio<5,12>>::type r;
 
-  VERIFY( r.num == -1);
-  VERIFY( r.den == 24);
+  VERIFY( r.num == -1 );
+  VERIFY( r.den == 24 );
 }
 
 void
@@ -52,8 +51,8 @@ test03()
   bool test __attribute__((unused)) = true;
   std::ratio_multiply<std::ratio<3,8>, std::ratio<5,12>>::type r;
 
-  VERIFY( r.num == 5);
-  VERIFY( r.den == 32);
+  VERIFY( r.num == 5 );
+  VERIFY( r.den == 32 );
 }
 
 void
@@ -62,19 +61,15 @@ test04()
   bool test __attribute__((unused)) = true;
   std::ratio_divide<std::ratio<3,8>, std::ratio<5,12>>::type r;
 
-  VERIFY( r.num == 9);
-  VERIFY( r.den == 10);
+  VERIFY( r.num == 9 );
+  VERIFY( r.den == 10 );
 }
 
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
-
 int main()
 {
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
   test01();
   test02();
   test03();
   test04();
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
   return 0;
 }
index 2dc2be6b6d88026e46298c69a87296dfcc81eb70..3d3241f31284fe63ed3c4e2dc18cd6c361e0a204 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
 
 // 2008-07-03 Chris Fairles <chris.fairles@gmail.com>
 
@@ -23,8 +24,6 @@
 #include <ratio>
 #include <testsuite_hooks.h>
 
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
-
 typedef std::ratio<1, INTMAX_MAX> one_over_max;
 typedef std::ratio<2, INTMAX_MAX> two_over_max;
 typedef std::ratio<INTMAX_MAX, 1> max_over_one;
@@ -44,8 +43,8 @@ test01()
     std::ratio<INTMAX_MAX / 2, INTMAX_MAX / 2>,
     std::ratio<INTMAX_MAX / 2 , INTMAX_MAX / 2 + 1>>::type r2;
   
-  VERIFY( r2.num == INTMAX_MAX);
-  VERIFY( r2.den == (INTMAX_MAX / 2) + 1);
+  VERIFY( r2.num == INTMAX_MAX );
+  VERIFY( r2.den == (INTMAX_MAX / 2) + 1 );
 }
 
 void
@@ -62,17 +61,13 @@ test02()
     std::ratio<INTMAX_MAX / 2, INTMAX_MAX / 2>,
     std::ratio<INTMAX_MAX / 2 , INTMAX_MAX / 2 + 1>>::type r2;
   
-  VERIFY( r2.num == 1);
-  VERIFY( r2.den == (INTMAX_MAX / 2) + 1);
+  VERIFY( r2.num == 1 );
+  VERIFY( r2.den == (INTMAX_MAX / 2) + 1 );
 }
 
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
-
 int main()
 {
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
   test01();
   test02();
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
   return 0;
 }
index d66c37cf383878749fb527ec9df53bc20bd0c395..2008275a216785748170cb418d3c611e084d2366 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
 
 // 2008-07-03 Chris Fairles <chris.fairles@gmail.com>
 
@@ -23,8 +24,6 @@
 #include <ratio>
 #include <testsuite_hooks.h>
 
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
-
 void
 test01()
 {
@@ -34,15 +33,15 @@ test01()
     std::ratio<2, INTMAX_MAX>,
     std::ratio<INTMAX_MAX, 2>>::type r1;
 
-  VERIFY( r1.num == 1);
-  VERIFY( r1.den == 1);
+  VERIFY( r1.num == 1 );
+  VERIFY( r1.den == 1 );
 
   std::ratio_multiply<
     std::ratio<INTMAX_MAX, 2>,
     std::ratio<2 , INTMAX_MAX - 1>>::type r2;
   
-  VERIFY( r2.num == INTMAX_MAX);
-  VERIFY( r2.den == INTMAX_MAX - 1);
+  VERIFY( r2.num == INTMAX_MAX );
+  VERIFY( r2.den == INTMAX_MAX - 1 );
 }
 
 void
@@ -54,24 +53,20 @@ test02()
     std::ratio<INTMAX_MAX, 2>,
     std::ratio<INTMAX_MAX, 2>>::type r1;
 
-  VERIFY( r1.num == 1);
-  VERIFY( r1.den == 1);
+  VERIFY( r1.num == 1 );
+  VERIFY( r1.den == 1 );
 
   std::ratio_divide<
     std::ratio<INTMAX_MAX-1, 2>,
     std::ratio<INTMAX_MAX, 2>>::type r2;
   
-  VERIFY( r2.num == INTMAX_MAX - 1);
-  VERIFY( r2.den == INTMAX_MAX);
+  VERIFY( r2.num == INTMAX_MAX - 1 );
+  VERIFY( r2.den == INTMAX_MAX );
 }
 
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
-
 int main()
 {
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
   test01();
   test02();
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
   return 0;
 }
index 7dffda39da2a6ec31d1c8d0f3ad4f70619f430ac..860f9f253b2804496aa0edf4c75ffcc1933b127c 100644 (file)
@@ -1,5 +1,6 @@
-// { dg-options "-std=gnu++0x" }
 // { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
 
 // 2008-07-03 Chris Fairles <chris.fairles@gmail.com>
 
@@ -23,8 +24,6 @@
 
 #include <ratio>
 
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
-
 void
 test01()
 {
@@ -38,14 +37,12 @@ test02()
   std::ratio_multiply<std::ratio<INTMAX_MAX>, std::ratio<INTMAX_MAX>>::type r2;
 }
 
-// { dg-error "instantiated from here" "" { target *-*-* } 31 }
+// { dg-error "instantiated from here" "" { target *-*-* } 30 }
+// { dg-error "instantiated from here" "" { target *-*-* } 36 }
 // { dg-error "instantiated from here" "" { target *-*-* } 37 }
-// { dg-error "instantiated from here" "" { target *-*-* } 38 }
 // { dg-error "overflow in addition" "" { target *-*-* } 127 }
 // { dg-error "overflow in multiplication" "" { target *-*-* } 95 }
 // { dg-error "overflow in multiplication" "" { target *-*-* } 97 }
 // { dg-error "overflow in multiplication" "" { target *-*-* } 99 }
 // { dg-excess-errors "In instantiation of" }
 // { dg-excess-errors "out of range" }
-
-#endif //_GLIBCXX_USE_C99_STDINT_TR1
index 327b691fc0f600c549c2333334c5f31bd5299493..e2d22ae598bc6d019f10ae8f149cac45ec71f5b8 100644 (file)
@@ -88,3 +88,12 @@ proc dg-require-rvalref { args } {
     }
     return
 }
+
+proc dg-require-cstdint { args } {
+    if { ![ check_v3_target_cstdint ] } {
+       upvar dg-do-what dg-do-what
+       set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+       return
+    }
+    return
+}
index d6b372b80ef14f1ad70a34e2130726223fea90f4..d8c168defacfab31e3067cf38a51f7334b9f89fe 100644 (file)
@@ -1,6 +1,6 @@
 # libstdc++ "tool init file" for DejaGNU
 
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 # Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -939,7 +939,7 @@ proc check_v3_target_debug_mode { } {
     } else {
        set et_debug_mode 0
 
-       # Set up, compile, and execute a C++ test program that depends
+       # Set up and compile a C++ test program that depends
        # on debug mode working.
        set src debug_mode[pid].cc
        set exe debug_mode[pid].exe
@@ -993,7 +993,7 @@ proc check_v3_target_parallel_mode { } {
     } else {
        set et_parallel_mode 0
 
-       # Set up, compile, and execute a C++ test program that depends
+       # Set up and compile a C++ test program that depends
        # on parallel mode working.
        set src parallel_mode[pid].cc
        set exe parallel_mode[pid].exe
@@ -1021,3 +1021,61 @@ proc check_v3_target_parallel_mode { } {
     verbose "check_v3_target_parallel_mode: $et_parallel_mode" 2
     return $et_parallel_mode
 }
+
+proc check_v3_target_cstdint { } {
+    global cxxflags
+    global DEFAULT_CXXFLAGS
+    global et_cstdint
+
+    global tool        
+
+    if { ![info exists et_cstdint_target_name] } {
+       set et_cstdint_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_cstdint_target_name } {
+       verbose "check_v3_target_cstdint: `$et_cstdint_target_name'" 2
+       set et_cstdint_target_name $current_target
+       if [info exists et_cstdint] {
+           verbose "check_v3_target_cstdint: removing cached result" 2
+           unset et_cstdint
+       }
+    }
+
+    if [info exists et_cstdint] {
+       verbose "check_v3_target_cstdint: using cached result" 2
+    } else {
+       set et_cstdint 0
+
+       # Set up and compile a C++0x test program that depends
+       # on the C99 stdint facilities to be available.
+       set src cstdint[pid].cc
+       set exe cstdint[pid].exe
+
+       set f [open $src "w"]
+       puts $f "#include <cstdint>"
+       puts $f "int main()"
+       puts $f "#ifdef _GLIBCXX_USE_C99_STDINT_TR1"
+       puts $f "{ return 0; }"
+       puts $f "#endif"
+       close $f
+
+       set cxxflags_saved $cxxflags
+       set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -std=gnu++0x -Werror"
+
+       set lines [v3_target_compile $src $exe executable ""]
+       set cxxflags $cxxflags_saved
+       file delete $src
+
+       if [string match "" $lines] {
+           # No error message, compilation succeeded.
+           set et_cstdint 1
+       } else {
+           verbose "check_v3_target_cstdint: compilation failed" 2
+       }
+    }
+    verbose "check_v3_target_cstdint: $et_cstdint" 2
+    return $et_cstdint
+}