This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
vxworks test cleanups
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 23 Mar 2008 20:55:09 +0000
- Subject: vxworks test cleanups
I'm flushing out a set of vxworks patches, now we're back in stage 1. This
first one was developed some time back by Richard Sandiford.
tested on i586-wrs-vxworks, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
2008-03-23 Richard Sandiford <richard@codesourcery.com>
gcc/testsuite/
* 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.
Index: gcc/testsuite/g++.old-deja/g++.robertl/eb79.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.robertl/eb79.C (revision 196914)
+++ gcc/testsuite/g++.old-deja/g++.robertl/eb79.C (working copy)
@@ -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: gcc/testsuite/g++.old-deja/g++.brendan/new3.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.brendan/new3.C (revision 196914)
+++ gcc/testsuite/g++.old-deja/g++.brendan/new3.C (working copy)
@@ -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: gcc/testsuite/g++.old-deja/g++.other/headers1.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.other/headers1.C (revision 196914)
+++ gcc/testsuite/g++.old-deja/g++.other/headers1.C (working copy)
@@ -44,6 +44,12 @@
#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: gcc/testsuite/g++.old-deja/g++.law/missed-error2.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.law/missed-error2.C (revision 196914)
+++ gcc/testsuite/g++.old-deja/g++.law/missed-error2.C (working copy)
@@ -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: gcc/testsuite/g++.old-deja/g++.mike/p658.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.mike/p658.C (revision 196914)
+++ gcc/testsuite/g++.old-deja/g++.mike/p658.C (working copy)
@@ -12,6 +12,12 @@
#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: gcc/testsuite/g++.old-deja/g++.mike/p2736.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.mike/p2736.C (revision 196914)
+++ gcc/testsuite/g++.old-deja/g++.mike/p2736.C (working copy)
@@ -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: gcc/testsuite/g++.old-deja/g++.mike/init1.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.mike/init1.C (revision 196914)
+++ gcc/testsuite/g++.old-deja/g++.mike/init1.C (working copy)
@@ -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: gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C (revision 196914)
+++ gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C (working copy)
@@ -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: gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C (revision 196914)
+++ gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C (working copy)
@@ -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: gcc/testsuite/g++.dg/opt/20050511-1.C
===================================================================
--- gcc/testsuite/g++.dg/opt/20050511-1.C (revision 196914)
+++ gcc/testsuite/g++.dg/opt/20050511-1.C (working copy)
@@ -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: gcc/testsuite/g++.dg/warn/miss-format-1.C
===================================================================
--- gcc/testsuite/g++.dg/warn/miss-format-1.C (revision 196914)
+++ gcc/testsuite/g++.dg/warn/miss-format-1.C (working copy)
@@ -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: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp (revision 196914)
+++ gcc/testsuite/lib/target-supports.exp (working copy)
@@ -2198,7 +2198,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 {
@@ -2208,6 +2208,16 @@ proc check_effective_target_vxworks_kern
}]
}
+# 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 { } {