diff mbox

[testsuite] gcc.dg/Wstrict-aliasing-converted-assigned.c: fix dg-message errors

Message ID 4FECFD1F.405@mentor.com
State New
Headers show

Commit Message

Janis Johnson June 29, 2012, 12:55 a.m. UTC
Test gcc.dg/Wstrict-aliasing-converted-assigned.c uses a combination of
"target" and "xfail" selectors in a way that would be nice if it worked,
but it doesn't.  Unfortunately the local code to override dg-error and
friends ignores errors, so directives with errors have been silently
skipped.  I plan to fix that after fixing the affected tests.

This patch causes the affected dg-message directives in this test to be
XFAIL'd everywhere, with a comment asking that when the test starts
passing on the relevant targets, the "xfail" be replaced with a "target"
list.  It also adds comments to the dg-message directives to make their
messages unique in the test summary.

Tested on i686-pc-linux-gnu; OK for trunk?

Janis
2012-06-28  Janis Johnson  <janisjo@codesourcery.com>

	* gcc.dg/Wstrict-aliasing-converted-assigned.c: Fix syntax
	errors in dg-message directives, add comments.

Comments

Mike Stump June 29, 2012, 2:53 a.m. UTC | #1
On Jun 28, 2012, at 5:55 PM, Janis Johnson wrote:
> Test gcc.dg/Wstrict-aliasing-converted-assigned.c uses a combination of
> "target" and "xfail" selectors in a way that would be nice if it worked,

> OK for trunk?

Ok.  I prefer no spacing between the comment and the dg-message lines...  ok either way.
diff mbox

Patch

Index: gcc.dg/Wstrict-aliasing-converted-assigned.c
===================================================================
--- gcc.dg/Wstrict-aliasing-converted-assigned.c	(revision 189025)
+++ gcc.dg/Wstrict-aliasing-converted-assigned.c	(working copy)
@@ -5,9 +5,12 @@ 
 int foo()
 {
   int i;
-  *(long*)&i = 0;  /* { dg-warning "type-punn" } */
+  *(long*)&i = 0;  /* { dg-warning "type-punn" "type-punn" } */
   return i;
 }
 
-/* { dg-message "does break strict-aliasing" "" { target { *-*-* && lp64 } xfail *-*-* } 8 } */
-/* { dg-message "initialized" "" { target { *-*-* && lp64 } xfail *-*-* } 8 } */
+/* These messages are only expected for lp64, but fail there.  When they
+   pass for lp64, replace "xfail *-*-*" with "target lp64".  */
+
+/* { dg-message "does break strict-aliasing" "break" { xfail *-*-* } 8 } */
+/* { dg-message "initialized" "init" { xfail *-*-* } 8 } */