Running C test with g++?

Dominik Vogt vogt@linux.vnet.ibm.com
Thu Jan 15 13:02:00 GMT 2015


On Thu, Jan 15, 2015 at 12:40:00PM +0000, Jonathan Wakely wrote:
> On 15 January 2015 at 12:33, Dominik Vogt wrote:
> > I have a target specific tests for C in
> > gcc/testsuite/gcc.target/s390 and would like to make sure that it
> > also runs with g++.  Is there a way to execute the C tests with
> > g++?
> 
> Would copying the test to a new file and adding this work?
> 
> // { dg-options "-x c++" }

Hm, although it adds the "-x c++" to the xgcc command line, it
seems the C compiler is still used (I added some c++ specific code
to the test to check that).  At the moment I run

  $ make -k check-gcc RUNTESTFLAGS="s390-c++.exp=<testname>.c"

(Where s390-c++.exp is a copy of s390.exp that includes g++-dg.exp
instead of gcc-dg.exp, but I've no idea whether that is
sufficient.)

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany



More information about the Gcc-help mailing list