diff mbox

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

Message ID 53DD1143.2030001@mentor.com
State New
Headers show

Commit Message

Tom de Vries Aug. 2, 2014, 4:26 p.m. UTC
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

Comments

Mike Stump Aug. 4, 2014, 8:16 a.m. UTC | #1
On Aug 2, 2014, at 9:26 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> I've made it an xfail, and added documentation in attached follow-up patch.

> OK?

Ok.

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

I’ll let others weigh in.  I’m fine either way.  Original author likely prefers the xfail, so I’m fine with the above.
Rainer Orth Aug. 5, 2014, 11:51 a.m. UTC | #2
Hi Mike,

>> Or do we go with the removal suggestion of Mike?
>
> I’ll let others weigh in.  I’m fine either way.  Original author likely
> prefers the xfail, so I’m fine with the above.

the test now XPASSes on Solaris, adding testsuite noise in the other
direction on completely innocent systems.  Given that we're not actually
testing gcc behaviour or a workaround for a glibc bug here, but just
alerting users to changed cproj semantics on old and newer glibc systems

	https://gcc.gnu.org/ml/gcc-patches/2010-04/msg01285.html

I'd strongly suggest just removing the test and the supporting
effective-target keywords.

	Rainer
diff mbox

Patch

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