[testsuite] Skip several UCN tests on systems without ASCII locale (PR testsuite/47400)

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Thu Feb 3 11:02:00 GMT 2011


Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> As Joseph mentioned in the PR, a couple of UCN testcases require an
> ASCII locale to pass.  As far as I've been able to find out, neither
> IRIX 6.5 nor Tru64 UNIX V5.1B have such (cf. the PR for details).
>
> To avoid the failures, I'm introducing a new dg-require-* keyword that
> skips the affected tests on problematic systems.
>
> So far bootstrapped on i386-pc-solaris2.11 without regressions to make
> sure that the testsuite code is syntactically correct, and tried with
> runtest --target alpha-dec-osf5.1b to check that the tests are correctly
> skipped.
>
> I may have missed one or two affected testcases; I'll check this in
> detail with a regtest on both mips-sgi-irix6.5 and alpha-dec-osf5.1b.

Those bootstraps have now passed without regression, and the testcases
annotated below are really the only ones.

> Ok for mainline (and eventually the 4.5 branch) if that passes?

Based on those results, the fact that this only affects my targets and
has passed regtest on i386-pc-solaris2.11 without regressions, I'm
tempted to check this in.  On the other hand, no one has ever commented
on the approach, though I don't yet see a ready alternative.

Comments?

	Rainer


> 2011-01-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	gcc/testsuite:
>         PR testsuite/47400
> 	* lib/target-supports.exp (check_ascii_locale_available): New proc.
> 	* lib/target-supports-dg.exp (dg-require-ascii-locale): New proc.
> 	* gcc.dg/attr-alias-5.c: Use dg-require-ascii-locale.
> 	* gcc.dg/ucnid-10.c: Likewise.
> 	* gcc.dg/ucnid-13.c: Likewise.
> 	* gcc.dg/ucnid-7.c: Likewise.
> 	* gcc.dg/ucnid-8.c: Likewise.
> 	* Adapt dg-warning line number.
>
> 	gcc:
>         PR testsuite/47400
> 	* doc/sourcebuild.texi (Require Support): Document
> 	dg-require-ascii-locale.
>
> diff -r 6be0386b1fb8 gcc/doc/sourcebuild.texi
> --- a/gcc/doc/sourcebuild.texi	Sun Jan 30 10:29:25 2011 +0100
> +++ b/gcc/doc/sourcebuild.texi	Sun Jan 30 11:20:17 2011 +0100
> @@ -1,4 +1,4 @@
> -@c Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
> +@c Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
>  @c Free Software Foundation, Inc.
>  @c This is part of the GCC manual.
>  @c For copying conditions, see the file gcc.texi.
> @@ -1936,6 +1936,9 @@
>  @item dg-require-alias ""
>  Skip the test if the target does not support the @samp{alias} attribute.
>  
> +@item dg-require-ascii-locale ""
> +Skip the test if the host does not support an ASCII locale.
> +
>  @item dg-require-compat-dfp ""
>  Skip this test unless both compilers in a @file{compat} testsuite
>  support decimal floating point.
> diff -r 6be0386b1fb8 gcc/testsuite/gcc.dg/attr-alias-5.c
> --- a/gcc/testsuite/gcc.dg/attr-alias-5.c	Sun Jan 30 10:29:25 2011 +0100
> +++ b/gcc/testsuite/gcc.dg/attr-alias-5.c	Sun Jan 30 11:20:17 2011 +0100
> @@ -3,6 +3,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-std=gnu99" } */
>  /* { dg-require-alias "" } */
> +/* { dg-require-ascii-locale "" } */
>  
>  void f0 (void) __attribute__((alias("\xa1"))); /* { dg-error "undefined symbol '\\\\241'" } */
>  void f1 (void) __attribute__((alias("\u00e9"))); /* { dg-error "undefined symbol '\\\\U000000e9'" } */
> diff -r 6be0386b1fb8 gcc/testsuite/gcc.dg/ucnid-10.c
> --- a/gcc/testsuite/gcc.dg/ucnid-10.c	Sun Jan 30 10:29:25 2011 +0100
> +++ b/gcc/testsuite/gcc.dg/ucnid-10.c	Sun Jan 30 11:20:17 2011 +0100
> @@ -2,6 +2,7 @@
>     locale).  Test #pragma pack diagnostics.  */
>  /* { dg-do compile } */
>  /* { dg-options "-std=gnu99 -fextended-identifiers" } */
> +/* { dg-require-ascii-locale "" } */
>  
>  #pragma pack(push)
>  #pragma pack(pop, \u00f3) /* { dg-warning "pop, \\\\U000000f3.*push, \\\\U000000f3" } */
> diff -r 6be0386b1fb8 gcc/testsuite/gcc.dg/ucnid-13.c
> --- a/gcc/testsuite/gcc.dg/ucnid-13.c	Sun Jan 30 10:29:25 2011 +0100
> +++ b/gcc/testsuite/gcc.dg/ucnid-13.c	Sun Jan 30 11:20:17 2011 +0100
> @@ -2,6 +2,7 @@
>     locale).  Miscellaneous diagnostics.  */
>  /* { dg-do compile } */
>  /* { dg-options "-std=gnu99 -fextended-identifiers -Wpacked" } */
> +/* { dg-require-ascii-locale "" } */
>  
>  int a __attribute__((\u00c0)); /* { dg-warning "'\\\\U000000c0' attribute directive ignored" } */
>  
> diff -r 6be0386b1fb8 gcc/testsuite/gcc.dg/ucnid-7.c
> --- a/gcc/testsuite/gcc.dg/ucnid-7.c	Sun Jan 30 10:29:25 2011 +0100
> +++ b/gcc/testsuite/gcc.dg/ucnid-7.c	Sun Jan 30 11:20:17 2011 +0100
> @@ -2,6 +2,7 @@
>     locale).  */
>  /* { dg-do compile } */
>  /* { dg-options "-std=c99 -fextended-identifiers" } */
> +/* { dg-require-ascii-locale "" } */
>  
>  void *p = &\u00e9; /* { dg-error "'\\\\U000000e9' undeclared" } */
>  void *q = &\u1e00; /* { dg-error "'\\\\U00001e00' undeclared" } */
> diff -r 6be0386b1fb8 gcc/testsuite/gcc.dg/ucnid-8.c
> --- a/gcc/testsuite/gcc.dg/ucnid-8.c	Sun Jan 30 10:29:25 2011 +0100
> +++ b/gcc/testsuite/gcc.dg/ucnid-8.c	Sun Jan 30 11:20:17 2011 +0100
> @@ -2,6 +2,7 @@
>     locale).  Further tests of C front-end diagnostics.  */
>  /* { dg-do compile } */
>  /* { dg-options "-std=gnu99 -fextended-identifiers -Wvla" } */
> +/* { dg-require-ascii-locale "" } */
>  
>  int a __attribute__((__mode__(\u00e9))); /* { dg-error "unknown machine mode '\\\\U000000e9'" } */
>  struct s1 { int \u00e9 : 0; }; /* { dg-error "zero width for bit-field '\\\\U000000e9'" } */
> @@ -11,4 +12,4 @@
>  void g (static int \u00e9); /* { dg-error "storage class specified for parameter '\\\\U000000e9'" } */
>  
>  struct s2 { int \u00e1; } \u00e9 = { { 0 } }; /* { dg-warning "braces around scalar initializer" } */
> -/* { dg-warning "near initialization for '\\\\U000000e9\\.\\\\U000000e1'" "UCN diag" { target *-*-* } 13 } */
> +/* { dg-warning "near initialization for '\\\\U000000e9\\.\\\\U000000e1'" "UCN diag" { target *-*-* } 14 } */
> diff -r 6be0386b1fb8 gcc/testsuite/lib/target-supports-dg.exp
> --- a/gcc/testsuite/lib/target-supports-dg.exp	Sun Jan 30 10:29:25 2011 +0100
> +++ b/gcc/testsuite/lib/target-supports-dg.exp	Sun Jan 30 11:20:17 2011 +0100
> @@ -1,5 +1,5 @@
> -#   Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005, 2007, 2008, 2009, 2010
> -#   Free Software Foundation, Inc.
> +#   Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
> +#   2011 Free Software Foundation, Inc.
>  
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> @@ -138,6 +138,15 @@
>      set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
>  }
>  
> +# If this host does not support an ASCII locale, skip this test.
> +
> +proc dg-require-ascii-locale { args } {
> +    if { ![ check_ascii_locale_available] } {
> +	upvar dg-do-what dg-do-what
> +        set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
> +    }
> +}
> +
>  proc dg-require-iconv { args } {
>      if { ![ check_iconv_available ${args} ] } {
>  	upvar dg-do-what dg-do-what
> diff -r 6be0386b1fb8 gcc/testsuite/lib/target-supports.exp
> --- a/gcc/testsuite/lib/target-supports.exp	Sun Jan 30 10:29:25 2011 +0100
> +++ b/gcc/testsuite/lib/target-supports.exp	Sun Jan 30 11:20:17 2011 +0100
> @@ -1,5 +1,5 @@
> -#   Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
> -#    Free Software Foundation, Inc.
> +#   Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
> +#   2011 Free Software Foundation, Inc.
>  
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> @@ -922,6 +922,17 @@
>      }] $libiconv]
>  }
>  
> +# Return 1 if an ASCII locale is supported on this host, 0 otherwise.
> +
> +proc check_ascii_locale_available { } {
> +    if { ([ishost alpha*-dec-osf*] || [ishost mips-sgi-irix*]) } {
> +	# Neither Tru64 UNIX nor IRIX support an ASCII locale.
> +	return 0
> +    } else {
> +	return 1
> +    }
> +}
> +
>  # Return true if named sections are supported on this target.
>  
>  proc check_named_sections_available { } {

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



More information about the Gcc-patches mailing list