This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Skip some UCN tests unless supported


UCN support on Solaris 2 is very much dependent on whether the assembler
used supports non-US-ASCII identifiers.  Sun as does not

Assembler: ucnid-11.c
	"/var/tmp//cc2waO.M.s", line 2 : Illegal character: <c3>
	"/var/tmp//cc2waO.M.s", line 2 : Illegal character: <80>
	"/var/tmp//cc2waO.M.s", line 2 : Syntax error

while GNU as does.  Several of the testcases were already XFAILed on
Solaris 2, leading to confusing XPASSes with gas, or to warnings like
the following with Sun as:

WARNING: g++.dg/other/ucnid-1.C compilation failed to produce executable

To improve this and avoid the XFAIL business altogether, I've introduced
a new effective_target test, ucn, which checks if the target supports
UCNs for compiling *and* assembling.  If not, the affected testcases are
skipped instead of XFAILing them, avoiding the noise described above.

To do so, I've removed *-*-solaris2.* from the target part of
dg-xfail-if, leaving the rest in place for the AIX maintainer to sort
out.

Unfortunately, I don't know if the testsuite framework supports several
independant dg-skip-if statements in a single testcase.  If it does not,
they'd have to be merged before committing.

With those changes, UCN test results are clean with both Sun as and GNU
as on i386-pc-solaris2.11.

Ok for mainline?

Btw, there's one caveat about Sun as: I wondered why Sun cc doesn't
error out on my testcase in check_effective_target_ucn_nocache, and
found that it doesn't pass the identifier unencoded to as (in fact, it
usually doesn't use an external as/fbe at all, but directly goes to
object code), but instead uses an encoding of its own.  I haven't yet
tried and find documentation about that, but it would be quite useful
for GCC and the vendor tools to be interoperable in this regard.  This
is an aspect of the ABI that should be followed, though I've no idea yet
if GCC supports platform-dependent encodings here.

	Rainer

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


2010-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* lib/target-supports.exp (check_effective_target_ucn_nocache):
	New function.
	(check_effective_target_ucn): Likewise.

	* g++.dg/other/ucnid-1.C: Don't XFAIL on *-*-solaris2.*, but skip
	if !ucn.
	* gcc.dg/ucnid-2.c: Likewise.
	* gcc.dg/ucnid-3.c: Likewise.
	* gcc.dg/ucnid-4.c: Likewise.
	* gcc.dg/ucnid-11.c: Likewise.
	* gcc.dg/ucnid-12.c: Likewise.
	* gcc.dg/ucnid-6.c: Skip if !ucn.
	* gcc.dg/ucnid-9.c: Likewise.

diff -r 0956202ff759 -r 2db82b177868 gcc/testsuite/g++.dg/other/ucnid-1.C
--- a/gcc/testsuite/g++.dg/other/ucnid-1.C	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/testsuite/g++.dg/other/ucnid-1.C	Thu Feb 11 23:19:26 2010 +0100
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-fextended-identifiers" } */
-/* { dg-xfail-if "" { powerpc-ibm-aix* *-*-solaris2.* } { "*" } { "" } } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
 #include <cstdlib>
 
 int \u00C0(void) { return 1; }
diff -r 0956202ff759 -r 2db82b177868 gcc/testsuite/gcc.dg/ucnid-11.c
--- a/gcc/testsuite/gcc.dg/ucnid-11.c	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/testsuite/gcc.dg/ucnid-11.c	Thu Feb 11 23:19:26 2010 +0100
@@ -1,5 +1,6 @@
 /* { dg-do run } */
-/* { dg-xfail-if "" { powerpc-ibm-aix* *-*-solaris2.* } { "*" } { "" } } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
 /* { dg-skip-if "-fdata-sections not supported" { { hppa*-*-hpux* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
 /* { dg-options "-std=c99 -fextended-identifiers -fdata-sections" } */
 
diff -r 0956202ff759 -r 2db82b177868 gcc/testsuite/gcc.dg/ucnid-12.c
--- a/gcc/testsuite/gcc.dg/ucnid-12.c	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/testsuite/gcc.dg/ucnid-12.c	Thu Feb 11 23:19:26 2010 +0100
@@ -1,5 +1,6 @@
 /* { dg-do run } */
-/* { dg-xfail-if "" { powerpc-ibm-aix* *-*-solaris2.* } { "*" } { "" } } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
 /* { dg-skip-if "-ffunction-sections not supported" { { hppa*-*-hpux* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
 /* { dg-options "-std=c99 -fextended-identifiers -ffunction-sections" } */
 
diff -r 0956202ff759 -r 2db82b177868 gcc/testsuite/gcc.dg/ucnid-2.c
--- a/gcc/testsuite/gcc.dg/ucnid-2.c	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/testsuite/gcc.dg/ucnid-2.c	Thu Feb 11 23:19:26 2010 +0100
@@ -1,5 +1,6 @@
 /* { dg-do run } */
-/* { dg-xfail-if "" { powerpc-ibm-aix* *-*-solaris2.* } { "*" } { "" } } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
 /* { dg-options "-std=c99 -fextended-identifiers" } */
 void abort (void);
 
diff -r 0956202ff759 -r 2db82b177868 gcc/testsuite/gcc.dg/ucnid-3.c
--- a/gcc/testsuite/gcc.dg/ucnid-3.c	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/testsuite/gcc.dg/ucnid-3.c	Thu Feb 11 23:19:26 2010 +0100
@@ -1,5 +1,6 @@
 /* { dg-do run } */
-/* { dg-xfail-if "" { powerpc-ibm-aix* *-*-solaris2.* } { "*" } { "" } } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
 /* { dg-options "-std=c99 -fextended-identifiers" } */
 void abort (void);
 
diff -r 0956202ff759 -r 2db82b177868 gcc/testsuite/gcc.dg/ucnid-4.c
--- a/gcc/testsuite/gcc.dg/ucnid-4.c	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/testsuite/gcc.dg/ucnid-4.c	Thu Feb 11 23:19:26 2010 +0100
@@ -1,5 +1,6 @@
 /* { dg-do run } */
-/* { dg-xfail-if "" { powerpc-ibm-aix* *-*-solaris2.* } { "*" } { "" } } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
 /* { dg-options "-std=c99 -fextended-identifiers" } */
 void abort (void);
 
diff -r 0956202ff759 -r 2db82b177868 gcc/testsuite/gcc.dg/ucnid-6.c
--- a/gcc/testsuite/gcc.dg/ucnid-6.c	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/testsuite/gcc.dg/ucnid-6.c	Thu Feb 11 23:19:26 2010 +0100
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
 /* { dg-options "-std=c99 -fextended-identifiers -save-temps" } */
 void abort (void);
 
diff -r 0956202ff759 -r 2db82b177868 gcc/testsuite/gcc.dg/ucnid-9.c
--- a/gcc/testsuite/gcc.dg/ucnid-9.c	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/testsuite/gcc.dg/ucnid-9.c	Thu Feb 11 23:19:26 2010 +0100
@@ -2,6 +2,7 @@
    conversions.  */
 /* { dg-do run } */
 /* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
 /* { dg-options "-std=c99 -fextended-identifiers -fexec-charset=ISO-8859-1" } */
 /* { dg-require-iconv "ISO-8859-1" } */
 
diff -r 0956202ff759 -r 2db82b177868 gcc/testsuite/lib/target-supports.exp
--- a/gcc/testsuite/lib/target-supports.exp	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/testsuite/lib/target-supports.exp	Thu Feb 11 23:19:26 2010 +0100
@@ -1,4 +1,4 @@
-#   Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 #    Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -1336,7 +1336,7 @@
 }
 
 # Return 1 if the target supports linking and executing Decimal Floating
-# Point, # 0 otherwise.
+# Point, 0 otherwise.
 #
 # This won't change for different subtargets so cache the result.
 
@@ -1346,6 +1346,32 @@
     }]
 }
 
+# Return 1 if the target supports compiling and assembling UCN, 0 otherwise.
+
+proc check_effective_target_ucn_nocache { } {
+    # -std=c99 is only valid for C
+    if [check_effective_target_c] {
+	set ucnopts "-std=c99"
+    }
+    append ucnopts " -fextended-identifiers"
+    verbose "check_effective_target_ucn_nocache: compiling source" 2
+    set ret [check_no_compiler_messages_nocache ucn object {
+	int \u00C0;
+    } $ucnopts]
+    verbose "check_effective_target_ucn_nocache: returning $ret" 2
+    return $ret
+}
+
+# Return 1 if the target supports compiling and assembling UCN, 0 otherwise.
+#
+# This won't change for different subtargets, so cache the result.
+
+proc check_effective_target_ucn { } {
+    return [check_cached_effective_target ucn {
+	check_effective_target_ucn_nocache
+    }]
+}
+
 # Return 1 if the target needs a command line argument to enable a SIMD
 # instruction set.
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]