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

login
register
mail settings
Submitter Marek Polacek
Date May 11, 2014, 7:59 p.m.
Message ID <20140511195919.GE23554@redhat.com>
Download mbox | patch
Permalink /patch/347815/
State New
Headers show

Comments

Marek Polacek - May 11, 2014, 7:59 p.m.
On Sun, May 11, 2014 at 09:18:47PM +0200, Rainer Orth wrote:
> 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.

I don't see tests using dg-skip-if and init_priority, so this patch
does what we do for other tests using cdtor priorities.

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

	* c-c++-common/pr50459.c: Require init_priority target.


	Marek
Rainer Orth - May 12, 2014, 2:40 p.m.
Marek Polacek <polacek@redhat.com> writes:

> On Sun, May 11, 2014 at 09:18:47PM +0200, Rainer Orth wrote:
>> 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.
>
> I don't see tests using dg-skip-if and init_priority, so this patch

No need for examples: as you can see in doc/sourcebuild.texi, both dg-do
and dg-skip-if accept the same selectors.

> does what we do for other tests using cdtor priorities.
>
> 2014-05-11  Marek Polacek  <polacek@redhat.com>
>
> 	* c-c++-common/pr50459.c: Require init_priority target.

Ok.

Thanks.
        Rainer

Patch

diff --git gcc/testsuite/c-c++-common/pr50459.c gcc/testsuite/c-c++-common/pr50459.c
index f837b63..ee586b4 100644
--- gcc/testsuite/c-c++-common/pr50459.c
+++ gcc/testsuite/c-c++-common/pr50459.c
@@ -1,5 +1,5 @@ 
 /* PR c/50459 */
-/* { dg-do compile } */
+/* { dg-do compile { target init_priority } } */
 /* { dg-options "-Wall -Wextra" } */
 
 enum { A = 128, B = 1 };