Patchwork [C] Make attributes accept enum values (PR c/50459)

login
register
mail settings
Submitter Marek Polacek
Date May 11, 2014, 6:01 p.m.
Message ID <20140511180141.GD23554@redhat.com>
Download mbox | patch
Permalink /patch/347807/
State New
Headers show

Comments

Marek Polacek - May 11, 2014, 6:01 p.m.
On Sat, May 10, 2014 at 04:10:47PM +0200, Dominique Dhumieres wrote:
> > ...
> > Tested again x86_64-linux, ok now?
> >
> > 2014-05-02  Marek Polacek  <polacek@redhat.com>
> >
> > 	PR c/50459
> 
> This caused on x86_64-apple-darwin13
> 
> FAIL: c-c++-common/pr50459.c -std=gnu++98 (test for excess errors)
> FAIL: c-c++-common/pr50459.c -std=gnu++11 (test for excess errors)
> FAIL: c-c++-common/pr50459.c -std=gnu++1y (test for excess errors)
> FAIL: c-c++-common/pr50459.c  -Wc++-compat  (test for excess errors)
> 
> The errors are
> 
> /opt/gcc/work/gcc/testsuite/c-c++-common/pr50459.c:8:1: error: constructor priorities are not supported
> /opt/gcc/work/gcc/testsuite/c-c++-common/pr50459.c:9:1: error: destructor priorities are not supported

Ah.  The following untested patch should skip that test on Darwin.

Ok?

2014-05-11  Marek Polacek  <polacek@redhat.com>

	* c-c++-common/pr50459.c: Skip test on Darwin.


	Marek
Rainer Orth - May 11, 2014, 7:18 p.m.
Marek Polacek <polacek@redhat.com> writes:

>> The errors are
>> 
>> /opt/gcc/work/gcc/testsuite/c-c++-common/pr50459.c:8:1: error: constructor priorities are not supported
>> /opt/gcc/work/gcc/testsuite/c-c++-common/pr50459.c:9:1: error: destructor priorities are not supported
>
> Ah.  The following untested patch should skip that test on Darwin.
>
> Ok?
>
> 2014-05-11  Marek Polacek  <polacek@redhat.com>
>
> 	* c-c++-common/pr50459.c: Skip test on Darwin.
>
> diff --git gcc/testsuite/c-c++-common/pr50459.c gcc/testsuite/c-c++-common/pr50459.c
> index f837b63..1216fd6 100644
> --- gcc/testsuite/c-c++-common/pr50459.c
> +++ gcc/testsuite/c-c++-common/pr50459.c
> @@ -1,6 +1,7 @@
>  /* PR c/50459 */
>  /* { dg-do compile } */
>  /* { dg-options "-Wall -Wextra" } */
> +/* { dg-skip-if "Darwin does not support cdtor priorities" { *-*-darwin* } } */

No, that's wrong: avoid hardcoding target lists if at all possible.
Besides, it's wrong since it doesn't cover the Solaris (and other
non-gld linker) case.  Use the init_priority effective-target keyword
instead.  Also, please check if you can use dg-xfail-if instead: if
anything changes, the test turns into an XPASS instead of the change
going unnoticed with dg-skip-if.

	Rainer
Joseph S. Myers - May 12, 2014, 3:44 p.m.
On Sun, 11 May 2014, Marek Polacek wrote:

> > FAIL: c-c++-common/pr50459.c -std=gnu++1y (test for excess errors)
> > FAIL: c-c++-common/pr50459.c  -Wc++-compat  (test for excess errors)
> > 
> > The errors are
> > 
> > /opt/gcc/work/gcc/testsuite/c-c++-common/pr50459.c:8:1: error: constructor priorities are not supported
> > /opt/gcc/work/gcc/testsuite/c-c++-common/pr50459.c:9:1: error: destructor priorities are not supported
> 
> Ah.  The following untested patch should skip that test on Darwin.
> 
> Ok?

I don't think the whole test should be skipped for that issue; I think the 
part requiring this feature should be split out into a separate testcase, 
so that as much as possible is still tested on Darwin.

Patch

diff --git gcc/testsuite/c-c++-common/pr50459.c gcc/testsuite/c-c++-common/pr50459.c
index f837b63..1216fd6 100644
--- gcc/testsuite/c-c++-common/pr50459.c
+++ gcc/testsuite/c-c++-common/pr50459.c
@@ -1,6 +1,7 @@ 
 /* PR c/50459 */
 /* { dg-do compile } */
 /* { dg-options "-Wall -Wextra" } */
+/* { dg-skip-if "Darwin does not support cdtor priorities" { *-*-darwin* } } */
 
 enum { A = 128, B = 1 };
 void *fn1 (void) __attribute__((assume_aligned (A)));