diff mbox series

[testsuite] Check init_priority in g++.dg/cpp0x/gen-attrs-67.C

Message ID yddmuei0xd0.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show
Series [testsuite] Check init_priority in g++.dg/cpp0x/gen-attrs-67.C | expand

Commit Message

Rainer Orth Oct. 3, 2019, 1:31 p.m. UTC
I found g++.dg/cpp0x/gen-attrs-67.C to FAIL on Solaris 11 when
configuring with --disable-initfini-array:

+FAIL: g++.dg/cpp0x/gen-attrs-67.C  -std=c++14 (test for excess errors)
+FAIL: g++.dg/cpp0x/gen-attrs-67.C  -std=c++17 (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/gen-attrs-67.C:11:34: error: constructor priorities are not supported

There's already been a patch to expect this error on Darwin, but it's
bogus to do this based on target triplet.  E.g. on Solaris 11.3
(*-*-solaris2.11) with the vendor ld, there's no support while with gld
there is.  On Solaris 11.4 OTOH (same triplet), there's always support.

We already have an effective-target keyword to capture this support,
which this patch now uses.  This will also fix the failure seen on
hppa2.0w-hp-hpux11.11 reported to gcc-testresults.

Tested on i386-pc-solaris2.11 (Solaris 11.4 with support and 11.3
without) as well as x86_64-apple-darwin11.4.2 (the previous special
case).  Installed on mainline.

	Rainer
diff mbox series

Patch

# HG changeset patch
# Parent  61230f42063e7211dcfba02caefa83bb9adf4d4f
Check init_priority in g++.dg/cpp0x/gen-attrs-67.C

diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-67.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-67.C
--- a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-67.C
+++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-67.C
@@ -8,4 +8,4 @@ 
 [[nodiscard()]] int f4(); // { dg-error ".nodiscard. attribute does not take any arguments" }
 [[gnu::noinline()]] int f5(); // { dg-error ".noinline. attribute does not take any arguments" }
 [[gnu::constructor]] int f6();
-[[gnu::constructor(101)]] int f7(); // { dg-error "constructor priorities are not supported" "" { target *-*-darwin* } }
+[[gnu::constructor(101)]] int f7(); // { dg-error "constructor priorities are not supported" "" { target { ! init_priority } } }