[COMMITTED] coroutines, testsuite: Fix single test execution.

Message ID AB010BCE-E3BD-4536-85DE-AE36E71198E6@sandoe.co.uk
State New
Headers show
Series
  • [COMMITTED] coroutines, testsuite: Fix single test execution.
Related show

Commit Message

Iain Sandoe March 17, 2020, 4:07 p.m.
Hi,

As Bin noticed, invocations of the coro-torture.exp like 'coro-torture.exp=some-test.C’
were failing because DEFAULT_CXXFLAGS was undefined.  Fixed by defining this
locally, if it has no pre-existing global value.

tested on x86_64-darwin, applied to mainline as obvious.
thanks
Iain

Patch

diff --git a/gcc/testsuite/g++.dg/coroutines/torture/coro-torture.exp b/gcc/testsuite/g++.dg/coroutines/torture/coro-torture.exp
index d2463b27983..2246f7154be 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/coro-torture.exp
+++ b/gcc/testsuite/g++.dg/coroutines/torture/coro-torture.exp
@@ -3,13 +3,19 @@ 
 load_lib g++-dg.exp
 load_lib torture-options.exp
 
-global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS
+global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS 
 
-dg-init
-torture-init
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CXXFLAGS
+if ![info exists DEFAULT_CXXFLAGS] then {
+    set DEFAULT_CXXFLAGS " -pedantic-errors -Wno-long-long"
+}
 
 set DEFAULT_COROFLAGS $DEFAULT_CXXFLAGS
-lappend DEFAULT_COROFLAGS "-std=c++17" "-fcoroutines"
+lappend DEFAULT_COROFLAGS "-fcoroutines" "-std=c++17"
+
+dg-init
+torture-init
 
 set-torture-options [concat $DG_TORTURE_OPTIONS $LTO_TORTURE_OPTIONS]