public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
@ 2014-07-31 19:21 Tom de Vries
  2014-07-31 22:54 ` Jeff Law
  2014-08-01 10:35 ` Rainer Orth
  0 siblings, 2 replies; 10+ messages in thread
From: Tom de Vries @ 2014-07-31 19:21 UTC (permalink / raw)
  To: Rainer Orth; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

Rainer,

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?

Thanks,
- Tom


[-- Attachment #2: 0001-Don-t-run-cproj-fails-with-broken-glibc-for-broken-g.patch --]
[-- Type: text/x-patch, Size: 2131 bytes --]

2014-07-31  Tom de Vries  <tom@codesourcery.com>

	* lib/target-supports.exp (check_effective_target_glibc)
	(check_effective_target_glibc_2_12_or_later)
	(check_effective_target_not_glibc_2_11_or_earlier): New proc.
	* gcc.dg/cproj-fails-with-broken-glibc.c: Require effective target
	not_glibc_2_11_or_earlier.

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 fe143b9..1df29f9 100644
--- a/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c
+++ b/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c
@@ -11,6 +11,7 @@
 /* { 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 fa5137e..cbe2930 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5038,6 +5038,44 @@ proc check_effective_target_newlib {} {
     }]
 }
 
+# Return true if this is a glibc target.
+
+proc check_effective_target_glibc {} {
+    return [check_no_compiler_messages glibc object {
+	#include <features.h>
+	#if !(defined (__GLIBC__) && defined (__GLIBC_MINOR__))
+	#error FOO
+	#endif
+    }]
+}
+
+# Return true if this is a glibc 2.12 or later target.
+
+proc check_effective_target_glibc_2_12_or_later {} {
+    return [check_no_compiler_messages glibc_2_12_or_later object {
+	#include <features.h>
+	#if !(defined (__GLIBC__) && defined (__GLIBC_MINOR__) \
+              && __GLIBC_PREREQ(2,12))
+	#error FOO
+	#endif
+    }]
+}
+
+# Return true if this is a not a glibc 2.11 or earlier target.
+
+proc check_effective_target_not_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 true if this is NOT a Bionic target.
 
 proc check_effective_target_non_bionic {} {
-- 
1.9.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
  2014-07-31 19:21 [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc Tom de Vries
@ 2014-07-31 22:54 ` Jeff Law
  2014-08-01 10:35 ` Rainer Orth
  1 sibling, 0 replies; 10+ messages in thread
From: Jeff Law @ 2014-07-31 22:54 UTC (permalink / raw)
  To: Tom de Vries, Rainer Orth; +Cc: GCC Patches

On 07/31/14 13:20, Tom de Vries wrote:
> Rainer,
>
> 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?
Yes, this is fine.
jeff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
  2014-07-31 19:21 [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc Tom de Vries
  2014-07-31 22:54 ` Jeff Law
@ 2014-08-01 10:35 ` Rainer Orth
  2014-08-01 18:26   ` Mike Stump
  2014-08-02 16:26   ` Tom de Vries
  1 sibling, 2 replies; 10+ messages in thread
From: Rainer Orth @ 2014-08-01 10:35 UTC (permalink / raw)
  To: Tom de Vries; +Cc: GCC Patches, Mike Stump

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?

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.

Thanks.
        Rainer

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
  2014-08-01 10:35 ` Rainer Orth
@ 2014-08-01 18:26   ` Mike Stump
  2014-08-02 16:26   ` Tom de Vries
  1 sibling, 0 replies; 10+ messages in thread
From: Mike Stump @ 2014-08-01 18:26 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Tom de Vries, GCC Patches

On Aug 1, 2014, at 3:35 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> I'm not at all happy with this patch

> 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.

Some background folks:

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

So I too agree that skipping the test case on known broken systems when the entire design of the test case is to fail on exactly those broken systems is borked.

So, what should we do with it instead.  Either xfailing it on known bad systems, or removing it entirely as misguided seem to be the two choices that make sense.

What are people in favor of?  Clearly the original author wanted at least the xfail.  I lean toward removal I think.  Why?  The gcc test suite, while it could be a filesystem test suite, an OS test suite, a libc test suite, generally speaking that is beyond the scope of this project.

From the test case:

   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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
  2014-08-01 10:35 ` Rainer Orth
  2014-08-01 18:26   ` Mike Stump
@ 2014-08-02 16:26   ` Tom de Vries
  2014-08-04  8:17     ` Mike Stump
  1 sibling, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2014-08-02 16:26 UTC (permalink / raw)
  To: Rainer Orth; +Cc: GCC Patches, Mike Stump

[-- Attachment #1: Type: text/plain, Size: 1243 bytes --]

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


[-- Attachment #2: 0001-For-cproj-test-case-use-glibc-version-xfail-instead-.patch --]
[-- Type: text/x-patch, Size: 2358 bytes --]

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
  2014-08-02 16:26   ` Tom de Vries
@ 2014-08-04  8:17     ` Mike Stump
  2014-08-05 11:51       ` Rainer Orth
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Stump @ 2014-08-04  8:17 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Rainer Orth, GCC Patches

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
  2014-08-04  8:17     ` Mike Stump
@ 2014-08-05 11:51       ` Rainer Orth
  2014-08-07  7:47         ` Tom de Vries
  0 siblings, 1 reply; 10+ messages in thread
From: Rainer Orth @ 2014-08-05 11:51 UTC (permalink / raw)
  To: Mike Stump; +Cc: Tom de Vries, GCC Patches

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

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
  2014-08-05 11:51       ` Rainer Orth
@ 2014-08-07  7:47         ` Tom de Vries
  2014-08-07 10:08           ` Rainer Orth
  2014-08-08 17:56           ` Mike Stump
  0 siblings, 2 replies; 10+ messages in thread
From: Tom de Vries @ 2014-08-07  7:47 UTC (permalink / raw)
  To: Rainer Orth, Mike Stump; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

On 05-08-14 13:51, Rainer Orth wrote:
> 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.

FWIW, I would be interested in understanding the details there.

>  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.
>

Done.  Committed as attached.

Thanks,
- Tom



[-- Attachment #2: 0001-Remove-cproj-fails-with-broken-glibc.c.patch --]
[-- Type: text/x-patch, Size: 3116 bytes --]

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

	* gcc.dg/cproj-fails-with-broken-glibc.c: Remove test.
	* lib/target-supports.exp (check_effective_target_glibc)
	(check_effective_target_glibc_2_12_or_later)
	(check_effective_target_glibc_2_11_or_earlier): Remove proc.

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

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 0793f80..39152df 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1804,15 +1804,6 @@ 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
deleted file mode 100644
index fc37fac..0000000
--- a/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright (C) 2010  Free Software Foundation.
-
-   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.
-
-   Origin: Kaveh R. Ghazi,  April 20, 2010.  */
-
-/* { 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 } */
-
-extern void abort(void);
-extern void exit(int);
-double _Complex cproj(double _Complex);
-
-int main (void)
-{
-  if (cproj (2+3i) != 2+3i)
-    abort();
-
-  exit(0);
-}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 7157d2a..fa5137e 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5038,44 +5038,6 @@ proc check_effective_target_newlib {} {
     }]
 }
 
-# Return true if this is a glibc target.
-
-proc check_effective_target_glibc {} {
-    return [check_no_compiler_messages glibc object {
-	#include <features.h>
-	#if !(defined (__GLIBC__) && defined (__GLIBC_MINOR__))
-	#error FOO
-	#endif
-    }]
-}
-
-# Return true if this is a glibc 2.12 or later target.
-
-proc check_effective_target_glibc_2_12_or_later {} {
-    return [check_no_compiler_messages glibc_2_12_or_later object {
-	#include <features.h>
-	#if !(defined (__GLIBC__) && defined (__GLIBC_MINOR__) \
-              && __GLIBC_PREREQ(2,12))
-	#error FOO
-	#endif
-    }]
-}
-
-# Return true if this is a glibc 2.11 or earlier target.
-
-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 0
-    }
-
-    return 1
-}
-
 # Return true if this is NOT a Bionic target.
 
 proc check_effective_target_non_bionic {} {
-- 
1.9.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
  2014-08-07  7:47         ` Tom de Vries
@ 2014-08-07 10:08           ` Rainer Orth
  2014-08-08 17:56           ` Mike Stump
  1 sibling, 0 replies; 10+ messages in thread
From: Rainer Orth @ 2014-08-07 10:08 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Mike Stump, GCC Patches

Hi Tom,

>> the test now XPASSes on Solaris, adding testsuite noise in the other
>> direction on completely innocent systems.
>
> FWIW, I would be interested in understanding the details there.

easy once you get it ;-)  The check_effective_target_* procs are
supposed to return 1 in the success case, 0 for failure.  So on
non-glibc targets like Solaris,
check_effective_target_glibc_2_11_or_earlier returns true, suggesting
the test will XFAIL while in fact it PASSes, so the XPASS.

>>  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.
>
> Done.  Committed as attached.

Thanks.
        Rainer

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc
  2014-08-07  7:47         ` Tom de Vries
  2014-08-07 10:08           ` Rainer Orth
@ 2014-08-08 17:56           ` Mike Stump
  1 sibling, 0 replies; 10+ messages in thread
From: Mike Stump @ 2014-08-08 17:56 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Rainer Orth, GCC Patches

On Aug 7, 2014, at 12:47 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> Done.  Committed as attached.

Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-08-08 17:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-31 19:21 [PATCH][testsuite] Don't run cproj-fails-with-broken-glibc.c for broken glibc Tom de Vries
2014-07-31 22:54 ` Jeff Law
2014-08-01 10:35 ` Rainer Orth
2014-08-01 18:26   ` Mike Stump
2014-08-02 16:26   ` Tom de Vries
2014-08-04  8:17     ` Mike Stump
2014-08-05 11:51       ` Rainer Orth
2014-08-07  7:47         ` Tom de Vries
2014-08-07 10:08           ` Rainer Orth
2014-08-08 17:56           ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).