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]

Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc


On 01-08-14 12:35, Rainer Orth wrote:
Hi Tom,

The test-case cproj-fails-with-broken-glibc.c does not work with broken
glibcs, as the header comment mentions:
...
    Check the runtime behavior of the C library's cproj() function and
    whether it follows the standard.  Versions of GLIBC through 2.11.1
    had an incorrect implementation which will conflict with GCC's
    builtin cproj().  GLIBC 2.12+ should be okay.
...

This patch skips the test for known broken glibcs. OK for trunk?

I'm not at all happy with this patch:  unless absolutely necessary, we
shouldn't check for version numbers when there's any way to check for
working/broken features instead.

I'm all for keeping testsuite results clean, but this seems like a total
corner case to me.  Which distributions do still use affected glibc
versions?


Ubuntu 10.04 LTS

That test, even if we go the glibc version route, needs to be XFAILed
instead of requiring the working version.  Apart from that, new
effective-target keywords need documenting in doc/sourcebuild.texi.


I've made it an xfail, and added documentation in attached follow-up patch.

OK? Or do we go with the removal suggestion of Mike?

Thanks,
- Tom

2014-08-01  Tom de Vries  <tom@codesourcery.com>

	* gcc.dg/cproj-fails-with-broken-glibc.c: Use xfail for broken glibc
	version instead of required-target.
	* lib/target-supports.exp
	(check_effective_target_not_glibc_2_11_or_earlier): Replace by ...
	(check_effective_target_glibc_2_11_or_earlier): ... this.

	* doc/sourcebuild.texi (glibc, glibc_2_12_or_later)
	(glibc_2_11_or_earlier): Document effective-target keywords.

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 39152df..0793f80 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1804,6 +1804,15 @@ Target is a VxWorks RTP.
 
 @item wchar
 Target supports wide characters.
+
+@item glibc
+Target supports glibc
+
+@item glibc_2_12_or_later
+Target supports glibc 2.12 or later
+
+@item glibc_2_11_or_earlier
+Target supports glibc 2.11 or earlier
 @end table
 
 @subsubsection Other attributes
diff --git a/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c b/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c
index 1df29f9..fc37fac 100644
--- a/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c
+++ b/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c
@@ -7,11 +7,10 @@
 
    Origin: Kaveh R. Ghazi,  April 20, 2010.  */
 
-/* { dg-do run } */
+/* { dg-do run { xfail glibc_2_11_or_earlier } } */
 /* { dg-options "-fno-builtin-cproj" } */
 /* { dg-add-options c99_runtime } */
 /* { dg-require-effective-target c99_runtime } */
-/* { dg-require-effective-target not_glibc_2_11_or_earlier } */
 
 extern void abort(void);
 extern void exit(int);
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index cbe2930..7157d2a 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5061,19 +5061,19 @@ proc check_effective_target_glibc_2_12_or_later {} {
     }]
 }
 
-# Return true if this is a not a glibc 2.11 or earlier target.
+# Return true if this is a glibc 2.11 or earlier target.
 
-proc check_effective_target_not_glibc_2_11_or_earlier {} {
+proc check_effective_target_glibc_2_11_or_earlier {} {
 
     if { ![check_effective_target_glibc] } {
 	return 1
     }
     
     if { [check_effective_target_glibc_2_12_or_later] } {
-	return 1
+	return 0
     }
 
-    return 0
+    return 1
 }
 
 # Return true if this is NOT a Bionic target.
-- 
1.9.1


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