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

login
register
mail settings
Submitter Marek Polacek
Date May 13, 2014, 7:51 a.m.
Message ID <20140513075122.GC2663@redhat.com>
Download mbox | patch
Permalink /patch/348279/
State New
Headers show

Comments

Marek Polacek - May 13, 2014, 7:51 a.m.
On Mon, May 12, 2014 at 03:44:42PM +0000, Joseph S. Myers wrote:
> 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.

Yeah, I should've done that in the first place, sorry.  Is the
following ok then?

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

	* c-c++-common/pr50459.c: Move cdtor tests to a separate testcase.
	* c-c++-common/pr50459-2.c: New test.


	Marek
Joseph S. Myers - May 13, 2014, 5:32 p.m.
On Tue, 13 May 2014, Marek Polacek wrote:

> Yeah, I should've done that in the first place, sorry.  Is the
> following ok then?
> 
> 2014-05-13  Marek Polacek  <polacek@redhat.com>
> 
> 	* c-c++-common/pr50459.c: Move cdtor tests to a separate testcase.
> 	* c-c++-common/pr50459-2.c: New test.

OK.

Patch

diff --git gcc/testsuite/c-c++-common/pr50459-2.c gcc/testsuite/c-c++-common/pr50459-2.c
index e69de29..0e8fec3 100644
--- gcc/testsuite/c-c++-common/pr50459-2.c
+++ gcc/testsuite/c-c++-common/pr50459-2.c
@@ -0,0 +1,7 @@ 
+/* PR c/50459 */
+/* { dg-do compile { target init_priority } } */
+/* { dg-options "-Wall -Wextra" } */
+
+enum { A = 128, B = 1 };
+void fn3 (void) __attribute__((constructor (A)));
+void fn4 (void) __attribute__((destructor (A)));
diff --git gcc/testsuite/c-c++-common/pr50459.c gcc/testsuite/c-c++-common/pr50459.c
index f837b63..8d75228 100644
--- gcc/testsuite/c-c++-common/pr50459.c
+++ gcc/testsuite/c-c++-common/pr50459.c
@@ -5,8 +5,6 @@ 
 enum { A = 128, B = 1 };
 void *fn1 (void) __attribute__((assume_aligned (A)));
 void *fn2 (void) __attribute__((assume_aligned (A, 4)));
-void fn3 (void) __attribute__((constructor (A)));
-void fn4 (void) __attribute__((destructor (A)));
 void *fn5 (int) __attribute__((alloc_size (B)));
 void *fn6 (int) __attribute__((alloc_align (B)));
 void fn7 (const char *, ...) __attribute__ ((sentinel (B)));