From c6fee2278be28235116e38574cc5078e2d0a7289 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 9 Apr 2008 09:13:23 +0000 Subject: [PATCH] target-supports.exp (check_effective_target_vxworks_kernel): Fix comment. * 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 --- gcc/testsuite/ChangeLog | 19 +++++++++++++++++++ gcc/testsuite/g++.dg/opt/20050511-1.C | 5 +++++ gcc/testsuite/g++.dg/warn/miss-format-1.C | 5 +++-- gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C | 7 ++++++- gcc/testsuite/g++.old-deja/g++.brendan/new3.C | 7 ++++++- gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C | 6 +++++- .../g++.old-deja/g++.law/missed-error2.C | 6 ++++++ gcc/testsuite/g++.old-deja/g++.mike/init1.C | 4 +++- gcc/testsuite/g++.old-deja/g++.mike/p2736.C | 4 +++- gcc/testsuite/g++.old-deja/g++.mike/p658.C | 6 ++++++ .../g++.old-deja/g++.other/headers1.C | 6 ++++++ gcc/testsuite/g++.old-deja/g++.robertl/eb79.C | 6 ++++++ gcc/testsuite/lib/target-supports.exp | 12 +++++++++++- 13 files changed, 85 insertions(+), 8 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 49601612d22..008bc865401 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,22 @@ +2008-04-09 Richard Sandiford + + * 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 * gfortran.dg/namelist_47.f90: New test. diff --git a/gcc/testsuite/g++.dg/opt/20050511-1.C b/gcc/testsuite/g++.dg/opt/20050511-1.C index 2fbd3e1be5e..a8929030af4 100644 --- a/gcc/testsuite/g++.dg/opt/20050511-1.C +++ b/gcc/testsuite/g++.dg/opt/20050511-1.C @@ -4,6 +4,11 @@ #include #include +// 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 ; diff --git a/gcc/testsuite/g++.dg/warn/miss-format-1.C b/gcc/testsuite/g++.dg/warn/miss-format-1.C index 56a5c7b1383..ec9dbc1c3bd 100644 --- a/gcc/testsuite/g++.dg/warn/miss-format-1.C +++ b/gcc/testsuite/g++.dg/warn/miss-format-1.C @@ -2,7 +2,8 @@ /* Origin: Joseph Myers */ /* { 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 #include @@ -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); } diff --git a/gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C b/gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C index 7be9185638b..5370fb8981d 100644 --- a/gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C +++ b/gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C @@ -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. diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/new3.C b/gcc/testsuite/g++.old-deja/g++.brendan/new3.C index b5bfb4a83b0..791d00bac96 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/new3.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/new3.C @@ -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 diff --git a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C index 3c9941d65c8..b2e7f62b9b3 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C @@ -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 diff --git a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C index d9d6195dfe8..a26f456f20a 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C +++ b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C @@ -8,6 +8,12 @@ #include +// 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 diff --git a/gcc/testsuite/g++.old-deja/g++.mike/init1.C b/gcc/testsuite/g++.old-deja/g++.mike/init1.C index 0b47fb7e705..5bc1ea4a9ac 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/init1.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/init1.C @@ -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); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2736.C b/gcc/testsuite/g++.old-deja/g++.mike/p2736.C index a0a8b314338..6ae61e89260 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2736.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p2736.C @@ -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 diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p658.C b/gcc/testsuite/g++.old-deja/g++.mike/p658.C index 1a4fefddc07..8fc7cd51b2b 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p658.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p658.C @@ -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(); diff --git a/gcc/testsuite/g++.old-deja/g++.other/headers1.C b/gcc/testsuite/g++.old-deja/g++.other/headers1.C index 31de3558f1e..1080fe38c8a 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/headers1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/headers1.C @@ -44,6 +44,12 @@ #include #include #include +// 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 #include diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C index e5905ffbec0..8d1c94d168f 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C @@ -2,6 +2,12 @@ // Makes bogus x86 assembly code. #include +// 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 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 2d50643485b..c1bdc79b5e5 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -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 { } { -- 2.30.2