target-supports.exp (check_effective_target_vxworks_kernel): Fix comment.
authorRichard Sandiford <richard@codesourcery.com>
Wed, 9 Apr 2008 09:13:23 +0000 (09:13 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 9 Apr 2008 09:13:23 +0000 (09:13 +0000)
* lib/target-supports.exp (check_effective_target_vxworks_kernel):
Fix comment.
(check_effective_target_vxworks_rtp): New procedure.
* g++.dg/opt/20050511-1.C: Rename UINT32 for VxWorks kernel mode.
* g++.dg/warn/miss-format-1.C: XFAIL for VxWorks.
* g++.old-deja/g++.abi/cxa_vec.C: XFAIL for VxWorks kernels.
* g++.old-deja/g++.brendan/new3.C: Likewise.
* g++.old-deja/g++.eh/badalloc1.C: XFAIL for VxWorks RTPs.
* g++.old-deja/g++.law/missed-error2.C: Undefine max for
VxWorks kernel mode.
* g++.old-deja/g++.mike/init1.C: XFAIL for VxWorks kernel mode.
* g++.old-deja/g++.mike/p2736.C: Likewise.
* g++.old-deja/g++.mike/p658.C: Undefine OK for VxWorks kernel mode.
* g++.old-deja/g++.other/headers1.C: Likewise min and max.
* g++.old-deja/g++.robertl/eb79.C: Undefine max for VxWorks
kernel mode.

From-SVN: r134134

13 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/20050511-1.C
gcc/testsuite/g++.dg/warn/miss-format-1.C
gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C
gcc/testsuite/g++.old-deja/g++.brendan/new3.C
gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
gcc/testsuite/g++.old-deja/g++.law/missed-error2.C
gcc/testsuite/g++.old-deja/g++.mike/init1.C
gcc/testsuite/g++.old-deja/g++.mike/p2736.C
gcc/testsuite/g++.old-deja/g++.mike/p658.C
gcc/testsuite/g++.old-deja/g++.other/headers1.C
gcc/testsuite/g++.old-deja/g++.robertl/eb79.C
gcc/testsuite/lib/target-supports.exp

index 4960161..008bc86 100644 (file)
@@ -1,3 +1,22 @@
+2008-04-09  Richard Sandiford  <richard@codesourcery.com>
+
+       * lib/target-supports.exp (check_effective_target_vxworks_kernel):
+       Fix comment.
+       (check_effective_target_vxworks_rtp): New procedure.
+       * g++.dg/opt/20050511-1.C: Rename UINT32 for VxWorks kernel mode.
+       * g++.dg/warn/miss-format-1.C: XFAIL for VxWorks.
+       * g++.old-deja/g++.abi/cxa_vec.C: XFAIL for VxWorks kernels.
+       * g++.old-deja/g++.brendan/new3.C: Likewise.
+       * g++.old-deja/g++.eh/badalloc1.C: XFAIL for VxWorks RTPs.
+       * g++.old-deja/g++.law/missed-error2.C: Undefine max for
+       VxWorks kernel mode.
+       * g++.old-deja/g++.mike/init1.C: XFAIL for VxWorks kernel mode.
+       * g++.old-deja/g++.mike/p2736.C: Likewise.
+       * g++.old-deja/g++.mike/p658.C: Undefine OK for VxWorks kernel mode.
+       * g++.old-deja/g++.other/headers1.C: Likewise min and max.
+       * g++.old-deja/g++.robertl/eb79.C: Undefine max for VxWorks
+       kernel mode.
+
 2008-04-09  Jakub Jelinek  <jakub@redhat.com>
 
        * gfortran.dg/namelist_47.f90: New test.
index 2fbd3e1..a892903 100644 (file)
@@ -4,6 +4,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+// The VxWorks kernel headers define their own UINT32
+#if defined __vxworks && !defined __RTP__
+#define UINT32 my_UINT32
+#endif
+
 typedef signed short SINT16 ;
 typedef unsigned long UINT32 ;
 typedef unsigned int UINT ;
index 56a5c7b..ec9dbc1 100644 (file)
@@ -2,7 +2,8 @@
 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
 /* { dg-do compile } */
 /* { dg-options "-Wmissing-format-attribute" } */
-/* { dg-error "not declared" "" { target *-*-solaris2.5.1 *-*-solaris2.[5-8] } 24 } */
+/* VxWorks does not provide vscanf, either in kernel or RTP mode.  */
+/* { dg-error "not declared" "" { target *-*-solaris2.5.1 *-*-solaris2.[5-8] *-*-vxworks* } 25 } */
 
 #include <stdio.h>
 #include <stdarg.h>
@@ -21,7 +22,7 @@ bar (const char *fmt, ...)
 {
   va_list ap;
   va_start (ap, fmt);
-  vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" { xfail *-*-solaris2.5.1 *-*-solaris2.[5-8] } } */
+  vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" { xfail *-*-solaris2.5.1 *-*-solaris2.[5-8] *-*-vxworks* } } */
   va_end (ap);
 }
 
index 7be9185..5370fb8 100644 (file)
@@ -1,4 +1,9 @@
-// { dg-do run { xfail powerpc-ibm-aix* } }
+// This test fails on VxWorks in kernel mode because it depends on the
+// library version of "::operator new[]" calling the "::operator new"
+// defined in this module.  This doesn't work because the library version
+// of "::operator new[]" is built into the kernel itself; library relocations
+// are resolved when the kernel is linked.
+// { dg-do run { xfail { powerpc-ibm-aix* || vxworks_kernel } } }
 // { dg-options "-flat_namespace" { target *-*-darwin[67]* } }
 // Test __cxa_vec routines
 // Copyright (C) 2000, 2005 Free Software Foundation, Inc.
index b5bfb4a..791d00b 100644 (file)
@@ -1,4 +1,9 @@
-// { dg-do run { xfail powerpc-ibm-aix* } }
+// This test fails on VxWorks in kernel mode because it depends on the
+// library version of "::operator new[]" calling the "::operator new"
+// defined in this module.  This doesn't work because the library version
+// of "::operator new[]" is built into the kernel itself; library relocations
+// are resolved when the kernel is linked.
+// { dg-do run { xfail { powerpc-ibm-aix* || vxworks_kernel } } }
 // { dg-options "-flat_namespace" { target *-*-darwin[67]* } }
 // GROUPS passed operator-new
 #include <stdio.h>
index 3c9941d..b2e7f62 100644 (file)
@@ -1,4 +1,8 @@
-// { dg-do run { xfail xstormy16-*-* *-*-darwin[1-7]* } }
+// This fails for VxWorks RTPs because the initialization of
+// __cxa_allocate_exception's emergency buffer mutex will
+// itself call malloc(), and will fail if there is no more
+// memory available.
+// { dg-do run { xfail { { xstormy16-*-* *-*-darwin[1-7]* } || vxworks_rtp } } }
 // Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 6 June 2000 <nathan@codesourcery.com>
 
index d9d6195..a26f456 100644 (file)
@@ -8,6 +8,12 @@
 
 #include <iostream>
 
+// The VxWorks kernel-mode headers define a macro named "max", which is not
+// ISO-compliant, but is part of the VxWorks API.
+#if defined __vxworks && !defined __RTP__
+#undef max
+#endif
+
 inline int max(int a, int b) {return a > b ? a : b;}; // { dg-error "" } candidate
 inline double max(double a, double b) {return a > b ? a : b;}; // { dg-error "" } candidate
 
index 0b47fb7..5bc1ea4 100644 (file)
@@ -1,4 +1,6 @@
-// { dg-do run  }
+// The VxWorks kernel has no implementation of atexit, so local statics
+// are never destroyed. 
+// { dg-do run { xfail vxworks_kernel } }
 int count;
 
 extern "C" void _exit(int);
index a0a8b31..6ae61e8 100644 (file)
@@ -1,4 +1,6 @@
-// { dg-do run  }
+// The VxWorks kernel has no implementation of atexit, so local statics
+// are never destroyed. 
+// { dg-do run { xfail vxworks_kernel } }
 // This is a poor test case, it is meant to ensure that function local
 // statics are destroyed at the right time.  See PR 2736 for details.
 // prms-id: 2736
index 1a4fefd..8fc7cd5 100644 (file)
 #define TRUE true
 #endif
 
+// The VxWorks kernel-mode headers define a macro named "OK", which is not
+// ISO-compliant, but is part of the VxWorks API.
+#if defined __vxworks && !defined __RTP__
+#undef OK
+#endif
+
 class Object {
 public:
     Object();
index 31de355..1080fe3 100644 (file)
 #include <string>
 #include <typeinfo>
 #include <utility>
+// The VxWorks kernel-mode headers define macros named "max" and
+// "min", which is not ISO-compliant, but is part of the VxWorks API.
+#if defined __vxworks && !defined __RTP__
+#undef max
+#undef min
+#endif
 #include <valarray>
 #include <vector>
 
index e5905ff..8d1c94d 100644 (file)
@@ -2,6 +2,12 @@
 // Makes bogus x86 assembly code.
 #include <iostream>
 
+// The VxWorks kernel-mode headers define a macro named "max", which is not
+// ISO-compliant, but is part of the VxWorks API.
+#if defined __vxworks && !defined __RTP__
+#undef max
+#endif
+
 using namespace std;
 
 template<class T>
index 2d50643..c1bdc79 100644 (file)
@@ -2221,7 +2221,7 @@ proc check_effective_target_simulator { } {
     return 0
 }
 
-# Return 1 if the target is a VxWorks RTP.
+# Return 1 if the target is a VxWorks kernel.
 
 proc check_effective_target_vxworks_kernel { } {
     return [check_no_compiler_messages vxworks_kernel assembly {
@@ -2231,6 +2231,16 @@ proc check_effective_target_vxworks_kernel { } {
     }]
 }
 
+# Return 1 if the target is a VxWorks RTP.
+
+proc check_effective_target_vxworks_rtp { } {
+    return [check_no_compiler_messages vxworks_rtp assembly {
+       #if !defined __vxworks || !defined __RTP__
+       #error NO
+       #endif
+    }]
+}
+
 # Return 1 if the target is expected to provide wide character support.
 
 proc check_effective_target_wchar { } {