diff mbox

[testsuite] Fix some more C and C++ testcases on Tru64 UNIX

Message ID yddiq073cam.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Nov. 8, 2010, 6:22 p.m. UTC
This patch fixes a couple of testsuite failures on Tru64 UNIX:

* g++.dg/abi/rtti3.C and g++.dg/abi/thunk4.C need to accomodate the fact
  that the Tru64 UNIX assembler uses .weakext, not .weak.

* g++.dg/opt/combine.C requires visibility support without declaring it.

* g++.dg/other/anon5.C fails to link:

(anonymous namespace)::c::t
collect2: ld returned 1 exit status

  so XFAIL it.

* g++.dg/warn/miss-format-1.C needs to XFAIL the scanf attribute warning
  since Tru64 UNIX lacks vscanf just like Solaris 8 and Vxworks.

* g++.dg/warn/pr31246.C fails like this:

FAIL: g++.dg/warn/pr31246.C (test for excess errors)
Excess errors:
In file included from /var/gcc/regression/trunk/5.1b-gcc/build/alpha-dec-osf5.1b/libstdc++-v3/include/bits/stl_algobase.h:60:0,
                 from /var/gcc/regression/trunk/5.1b-gcc/build/alpha-dec-osf5.1b/libstdc++-v3/include/vector:61,
                 from /vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/warn/pr31246.C:4:
/var/gcc/regression/trunk/5.1b-gcc/build/alpha-dec-osf5.1b/libstdc++-v3/include/alpha-dec-osf5.1b/bits/c++config.h:235:4: warning: #warning currently using namespace associated mode which may fail without inlining due to lack of weak symbols [-Wcpp]

  I strongly suspect that this is due to the platform's lack of weak
  definitions (contrary to the `lack of weak symbols' text of the
  warning, which doesn't apply).  I tried to use dg-warning for the
  message, but while this works, I'd still need to prune the location
  lines, which seems like too much hazzle.  So I'm XFAILing the test.

* g++.dg/warn/weak1.C and gcc.dg/attr-weakref-1.c require weak
  definitions, which Tru64 UNIX lacks, so skip them.

* g++.old-deja/g++.eh/badalloc1.C needs an increased stack size, like
  several other platforms.

There are a few more I don't yet know what to do about them:

* one of the scan-assembler tests in g++.dg/other/unused1.C fail:

FAIL: g++.dg/other/unused1.C scan-assembler (string|ascii?)z?[\t ]"printer("|\\\\0)

  The assembler output includes

 #.stabs        "printer:Tt32=s4i:4,0,32;;",128,0,28,0

  While I could match this, it seems easier to xfail the test.

* gcc.dg/array-quals-1.c currently FAILs because the assembler output
  contains both .data and .rdata.  I'll have to investigate why this
  happens.

* gcc.dg/intmax_t-1.c currently fails like this:

FAIL: gcc.dg/intmax_t-1.c (test for excess errors)
Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:12:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:13:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:18:3: error: 'im_t_p' undeclared (first use in this function)
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:18:3: note: each undeclared identifier is reported only once for each function it appears in
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:24:3: error: 'uim_t_p' undeclared (first use in this function)

  The native <inttypes.h> lacks definitions of intmax_t and uintmax_t.
  One could fix this by replacing <inttypes.h> by <stdint.h>.  That file
  is now generated at build time and contains a definition of intmax_t.
  I'm not completely sure what the test is supposed to check in this
  situation, though.  Joseph?

The patch below was tested with the appropriate runtest invocations on
alpha-dec-osf5.1b.  Will commit within a day or two unless someone has
better suggestions.

	Rainer


2010-11-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* g++.dg/abi/rtti3.C: Scan for .weakext on alpha*-dec-osf*.
	* g++.dg/abi/thunk4.C: Likewise.
	* g++.dg/opt/combine.C: Add dg-require-visibility.
	* g++.dg/other/anon5.C: Skip on alpha*-dec-osf*.
	* g++.dg/warn/miss-format-1.C: XFAIL scanf attribute warning on
	alpha*-dec-osf*.
	* g++.dg/warn/pr31246.C: XFAIL on alpha*-dec-osf*.
	* g++.dg/warn/weak1.C: Skip on alpha*-dec-osf*.
	* g++.old-deja/g++.eh/badalloc1.C [!STACK_SIZE && __osf__]: Use
	large arena_size.
	* gcc.dg/attr-weakref-1.c: Skip on alpha*-dec-osf*.

Comments

Joseph Myers Nov. 8, 2010, 10:55 p.m. UTC | #1
On Mon, 8 Nov 2010, Rainer Orth wrote:

> * gcc.dg/intmax_t-1.c currently fails like this:
> 
> FAIL: gcc.dg/intmax_t-1.c (test for excess errors)
> Excess errors:
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:12:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:13:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:18:3: error: 'im_t_p' undeclared (first use in this function)
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:18:3: note: each undeclared identifier is reported only once for each function it appears in
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/intmax_t-1.c:24:3: error: 'uim_t_p' undeclared (first use in this function)
> 
>   The native <inttypes.h> lacks definitions of intmax_t and uintmax_t.
>   One could fix this by replacing <inttypes.h> by <stdint.h>.  That file
>   is now generated at build time and contains a definition of intmax_t.
>   I'm not completely sure what the test is supposed to check in this
>   situation, though.  Joseph?

The test is supposed to verify that GCC's notion of certain types agrees 
with that in the system headers.  It's effectively a subset of 
c99-stdint-6.c, dating from when GCC only knew about a few of the stdint.h 
types.  It includes <inttypes.h> because some systems (based on early C9X 
drafts) provide that without <stdint.h>.  If the system in question 
doesn't provide intmax_t and uintmax_t in <inttypes.h>, you may as well 
skip the test intmax_t-1.c as not having anything useful to test.
diff mbox

Patch

diff -r f5914a010793 gcc/testsuite/g++.dg/abi/rtti3.C
--- a/gcc/testsuite/g++.dg/abi/rtti3.C	Mon Nov 08 17:14:13 2010 +0100
+++ b/gcc/testsuite/g++.dg/abi/rtti3.C	Mon Nov 08 18:46:19 2010 +0100
@@ -3,10 +3,12 @@ 
 
 // { dg-require-weak "" }
 // { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } { "*" } { "" } }
-// { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* } } } } }
-// { dg-final { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" { target { ! { *-*-darwin* } } } } }
+// { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* alpha*-dec-osf* } } } } }
+// { dg-final { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" { target { ! { *-*-darwin* alpha*-dec-osf* } } } } }
 // { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZTSPP1A" { target { *-*-darwin* } } } }
 // { dg-final { scan-assembler-not ".weak_definition\[ \t\]_?_ZTIPP1A" { target { *-*-darwin* } } } }
+// { dg-final { scan-assembler ".weakext\[ \t\]_?_ZTSPP1A" { target { alpha*-dec-osf* } } } }
+// { dg-final { scan-assembler-not ".weakext\[ \t\]_?_ZTIPP1A" { target { alpha*-dec-osf* } } } }
 
 struct A;
 
diff -r f5914a010793 gcc/testsuite/g++.dg/abi/thunk4.C
--- a/gcc/testsuite/g++.dg/abi/thunk4.C	Mon Nov 08 17:14:13 2010 +0100
+++ b/gcc/testsuite/g++.dg/abi/thunk4.C	Mon Nov 08 18:46:19 2010 +0100
@@ -1,7 +1,8 @@ 
 // { dg-require-weak "" }
 // { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } { "*" } { "" } }
-// { dg-final { scan-assembler ".weak\[ \t\]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* } } } } }
+// { dg-final { scan-assembler ".weak\[ \t\]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* alpha*-dec-osf* } } } } }
 // { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZThn._N7Derived3FooEv" { target { *-*-darwin* } } } }
+// { dg-final { scan-assembler ".weakext\[ \t\]_?_ZThn._N7Derived3FooEv" { target { alpha*-dec-osf* } } } }
 
 struct Base 
 {
diff -r f5914a010793 gcc/testsuite/g++.dg/opt/combine.C
--- a/gcc/testsuite/g++.dg/opt/combine.C	Mon Nov 08 17:14:13 2010 +0100
+++ b/gcc/testsuite/g++.dg/opt/combine.C	Mon Nov 08 18:46:19 2010 +0100
@@ -1,5 +1,6 @@ 
 // { dg-do assemble { target fpic } }
 // { dg-options "-O2 -fweb -fPIC -fvisibility=hidden" }
+// { dg-require-visibility "" }
 
 class QBasicAtomicInt
 {
diff -r f5914a010793 gcc/testsuite/g++.dg/other/anon5.C
--- a/gcc/testsuite/g++.dg/other/anon5.C	Mon Nov 08 17:14:13 2010 +0100
+++ b/gcc/testsuite/g++.dg/other/anon5.C	Mon Nov 08 18:46:19 2010 +0100
@@ -1,5 +1,5 @@ 
 // PR c++/34094
-// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* } } } }
+// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* alpha*-dec-osf* } } } }
 // { dg-options "-g" }
 
 namespace {
diff -r f5914a010793 gcc/testsuite/g++.dg/warn/miss-format-1.C
--- a/gcc/testsuite/g++.dg/warn/miss-format-1.C	Mon Nov 08 17:14:13 2010 +0100
+++ b/gcc/testsuite/g++.dg/warn/miss-format-1.C	Mon Nov 08 18:46:19 2010 +0100
@@ -4,7 +4,7 @@ 
 /* { dg-options "-Wmissing-format-attribute" } */
 /* { dg-options "-Wmissing-format-attribute -Wno-abi" { target arm_eabi } } */
 /* VxWorks does not provide vscanf, either in kernel or RTP mode.  */
-/* { dg-error "not declared" "" { target { *-*-solaris2.8 *-*-vxworks* alpha*-dec-osf5* } } 26 } */
+/* { dg-error "not declared" "" { target { *-*-solaris2.8 *-*-vxworks* alpha*-dec-osf* } } 26 } */
 
 #include <stdio.h>
 #include <stdarg.h>
@@ -23,7 +23,7 @@ 
 {
   va_list ap;
   va_start (ap, fmt);
-  vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" { xfail *-*-solaris2.8 *-*-vxworks* } } */
+  vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" { xfail *-*-solaris2.8 *-*-vxworks* alpha*-dec-osf* } } */
   va_end (ap);
 }
 
diff -r f5914a010793 gcc/testsuite/g++.dg/warn/pr31246.C
--- a/gcc/testsuite/g++.dg/warn/pr31246.C	Mon Nov 08 17:14:13 2010 +0100
+++ b/gcc/testsuite/g++.dg/warn/pr31246.C	Mon Nov 08 18:46:19 2010 +0100
@@ -1,6 +1,7 @@ 
 // PR 31246
 // { dg-do compile }
 // { dg-options "-Wunreachable-code -D_GLIBCXX_DEBUG" }
+// { dg-xfail-if "lack of weak symbols" { alpha*-dec-osf* } }
 #include <vector>
 
 int main()
diff -r f5914a010793 gcc/testsuite/g++.dg/warn/weak1.C
--- a/gcc/testsuite/g++.dg/warn/weak1.C	Mon Nov 08 17:14:13 2010 +0100
+++ b/gcc/testsuite/g++.dg/warn/weak1.C	Mon Nov 08 18:46:19 2010 +0100
@@ -1,7 +1,8 @@ 
 // { dg-do run }
 // { dg-require-weak "" }
-// The PA HP-UX dynamic loader doesn't support unsatisfied weak symbols.
-// { dg-skip-if "No unsat" { hppa*-*-hpux* } { "*" } { "" } }
+// The PA HP-UX and Tru64 UNIX dynamic loaders don't support unsatisfied
+// weak symbols.
+// { dg-skip-if "No unsat" { alpha*-dec-osf* hppa*-*-hpux* } { "*" } { "" } }
 // The darwin loader does, but they do need to exist at link time.
 // { dg-skip-if "No link unsat" { *-*-darwin* } { "*" } { "" } }
 // For kernel modules and static RTPs, the loader treats undefined weak
diff -r f5914a010793 gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
--- a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C	Mon Nov 08 17:14:13 2010 +0100
+++ b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C	Mon Nov 08 18:46:19 2010 +0100
@@ -3,7 +3,7 @@ 
 // itself call malloc(), and will fail if there is no more
 // memory available.
 // { dg-do run { xfail { { xstormy16-*-* *-*-darwin[3-7]* } || vxworks_rtp } } }
-// Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002, 2003, 2010 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 6 June 2000 <nathan@codesourcery.com>
 
 // Check we can throw a bad_alloc exception when malloc dies.
@@ -18,8 +18,8 @@ 
 #ifdef STACK_SIZE
 const int arena_size = 256;
 #else
-#if defined(__FreeBSD__) || defined(__sun__) || defined(__hpux__)
-// FreeBSD, Solaris and HP-UX with threads require even more
+#if defined(__FreeBSD__) || defined(__sun__) || defined(__hpux__) || defined(__osf__)
+// FreeBSD, Solaris, HP-UX and Tru64 UNIX with threads require even more
 // space at initialization time.  FreeBSD 5 now requires over 131072 bytes.
 const int arena_size = 262144;
 #else
diff -r f5914a010793 gcc/testsuite/gcc.dg/attr-weakref-1.c
--- a/gcc/testsuite/gcc.dg/attr-weakref-1.c	Mon Nov 08 17:14:13 2010 +0100
+++ b/gcc/testsuite/gcc.dg/attr-weakref-1.c	Mon Nov 08 18:46:19 2010 +0100
@@ -2,9 +2,10 @@ 
 // { dg-require-weak "" }
 // On darwin, we use attr-weakref-1-darwin.c.
 // This test requires support for undefined weak symbols.  This support
-// is not available on hppa*-*-hpux*.  The test is skipped rather than
-// xfailed to suppress the warning that would otherwise arise.
-// { dg-skip-if "" { "*-*-darwin*" "hppa*-*-hpux*" } "*" { "" } }
+// is not available on alpha*-dec-osf* and hppa*-*-hpux*.  The test is
+// skipped rather than xfailed to suppress the warning that would otherwise
+// arise.
+// { dg-skip-if "" { "alpha*-dec-osf*" "*-*-darwin*" "hppa*-*-hpux*" } "*" { "" } }
 // For kernel modules and static RTPs, the loader treats undefined weak
 // symbols in the same way as undefined strong symbols.  The test
 // therefore fails to load, so skip it.