diff mbox

[testsuite,ia64] patch for gcc.dg/mtune.c

Message ID 201104012118.p31LINP20816@lucas.cup.hp.com
State New
Headers show

Commit Message

Steve Ellcey April 1, 2011, 9:18 p.m. UTC
The gcc.dg/mtune.c test is failing on ia64-*-* because in addition to
the expected error message that is output it also prints out a note
about the valid values for mtune.

$ gcc -mtune=foo mtune.c
gcc: error: unrecognized argument in option '-mtune=foo'
gcc: note: valid arguments to '-mtune=' are: itanium2 mckinley

Looking into why this doesn't happen on other systems, it looks like
the difference is that IA64 uses -mtune to set an enum variable and
most (all?) the other platforms use it to set a string variable.

Since the message seems reasonable I propose to just change the test
to expect it.  The patch was tested on IA64 HP-UX and Linux.  If I
don't hear any objections I will just check it in as an obvious fix.

Steve Ellcey
sje@cup.hp.com



2011-04-01  Steve Ellcey  <sje@cup.hp.com>

	* gcc.dg/mtune.c: Add expected note for target ia64-*-*.

Comments

Joseph Myers April 2, 2011, 12:25 a.m. UTC | #1
On Fri, 1 Apr 2011, Steve Ellcey wrote:

> Looking into why this doesn't happen on other systems, it looks like
> the difference is that IA64 uses -mtune to set an enum variable and
> most (all?) the other platforms use it to set a string variable.

As an increasing number of targets will start using the Enum facility, it 
would be good to be able to just to accept such a note on all targets 
without requiring it.  But if that isn't possible, then this patch seems 
appropriate (and similar changes to the test will be needed for other 
targets using Enum here).
Steve Ellcey April 4, 2011, 8:34 p.m. UTC | #2
On Sat, 2011-04-02 at 00:25 +0000, Joseph S. Myers wrote:
> On Fri, 1 Apr 2011, Steve Ellcey wrote:
> 
> > Looking into why this doesn't happen on other systems, it looks like
> > the difference is that IA64 uses -mtune to set an enum variable and
> > most (all?) the other platforms use it to set a string variable.
> 
> As an increasing number of targets will start using the Enum facility, it 
> would be good to be able to just to accept such a note on all targets 
> without requiring it.  But if that isn't possible, then this patch seems 
> appropriate (and similar changes to the test will be needed for other 
> targets using Enum here).

I think we could use dg-prune to skip this message if it occurs.  I
don't think that would cause any errors on a system where the message
does not occur.  Let me try that and see if it works.

Steve Ellcey
sje@cup.hp.com
Eric Botcazou April 5, 2011, 10:17 p.m. UTC | #3
> As an increasing number of targets will start using the Enum facility, it
> would be good to be able to just to accept such a note on all targets
> without requiring it.  But if that isn't possible, then this patch seems
> appropriate (and similar changes to the test will be needed for other
> targets using Enum here).

SPARC is a candidate.
diff mbox

Patch

Index: gcc.dg/mtune.c
===================================================================
--- gcc.dg/mtune.c	(revision 171815)
+++ gcc.dg/mtune.c	(working copy)
@@ -4,4 +4,5 @@ 
 /* { dg-error "mtune" "" { target *-*-* } 0 } */
 /* { dg-bogus "march" "" { target *-*-* } 0 } */
 /* { dg-bogus "mcpu" "" { target *-*-* } 0 } */
+/* { dg-message "note: valid arguments" "" { target ia64-*-* } 0 } */
 int i;