Dejagnu question (was [RFA] Stop using tradcpp)

Neil Booth neil@daikokuya.co.uk
Wed Jun 19 23:03:00 GMT 2002


Neil Booth wrote:-

> + # GCC testsuite that uses the `dg.exp' driver.
> + 
> + # There's a bunch of headers we need.
> + if [is_remote host] {
> +     foreach header [glob -nocomplain $srcdir/$subdir/*.{h,def} ] {
> + 	remote_download host $header
> +     }
> + }
> + 
> + # Load support procs.
> + load_lib gcc-dg.exp
> + 
> + # If a testcase doesn't have special options, use these.
> + global DEFAULT_CFLAGS
> + if ![info exists DEFAULT_CFLAGS] then {
> +     set DEFAULT_CFLAGS " -traditional-cpp"
> + }
> + 
> + # Initialize `dg'.
> + dg-init
> + 
> + # Main loop.
> + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
> + 	"" $DEFAULT_CFLAGS
> + 
> + # All done.
> + dg-finish

Running "make check" causes the tests in the new trad/ subdirectory to
fail, with trad.exp as shown above, as tests without an explicit
"dg-options" are being passed "-ansi -pedantic-errors" rather than
"-traditional-cpp".  Why is DEFAULT_CFLAGS above not being picked up?

The really weird thing is that running it separately, as

  runtest --tool gcc --srcdir path/to/gcc/testsuite trad.exp

which is how I tested the trad stuff, works.

Why is it different, and how can I fix this (without adding a
"dg-options" to each test)?

Neil.



More information about the Gcc-patches mailing list