diff mbox

Skip C tests if test flags include C++ options

Message ID 20160802133213.GE4264@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Aug. 2, 2016, 1:32 p.m. UTC
There are two C files in the libstdc++ testsuite, this skips them when
-std=gnu++NN or similar appears in the options, to avoid FAILs due to
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C

	* testsuite/18_support/bad_exception/23591_thread-1.c: Skip test if
	options are present that aren't valid for C.
	* testsuite/abi/header_cxxabi.c: Likewise.

Tested x86_64-linux, committed to trunk.
commit 7697b53d54b630620578b58250a463897f379c81
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Aug 2 12:46:15 2016 +0100

    Skip C tests if test flags include C++ options
    
    	* testsuite/18_support/bad_exception/23591_thread-1.c: Skip test if
    	options are present that aren't valid for C.
    	* testsuite/abi/header_cxxabi.c: Likewise.
diff mbox

Patch

diff --git a/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c b/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c
index fd1a76c..6e5138b 100644
--- a/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c
+++ b/libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c
@@ -1,4 +1,5 @@ 
 // { dg-require-sharedlib "" }
+// { dg-skip-if "invalid options for C" { *-*-* } { "-std=c++??" "-std=gnu++??" } }
 // { dg-options "-g -O2 -pthread -ldl -x c -fvtable-verify=none -Wno-pedantic" { target *-*-linux* *-*-gnu* *-*-solaris2.1[2-9]* } }
 
 // Copyright (C) 2005-2016 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/abi/header_cxxabi.c b/libstdc++-v3/testsuite/abi/header_cxxabi.c
index b424d8f..3b1a7dc 100644
--- a/libstdc++-v3/testsuite/abi/header_cxxabi.c
+++ b/libstdc++-v3/testsuite/abi/header_cxxabi.c
@@ -1,4 +1,5 @@ 
 // { dg-do compile }
+// { dg-skip-if "invalid options for C" { *-*-* } { "-std=c++??" "-std=gnu++??" } }
 // { dg-options "-x c" }
 // Copyright (C) 2006-2016 Free Software Foundation, Inc.
 //