aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2020-03-17 14:12:54 +0000
committerIain Sandoe <iain@sandoe.co.uk>2020-03-17 16:06:10 +0000
commite4596b66710d398cbddb62499b30c147ebd4696d (patch)
treee36ee525d36a8ec55686597f6dbbfc39bdd38656
parent0dad5b336874338fcad2ae0509bbf520a01e353a (diff)
downloadgcc-e4596b66710d398cbddb62499b30c147ebd4696d.zip
gcc-e4596b66710d398cbddb62499b30c147ebd4696d.tar.gz
gcc-e4596b66710d398cbddb62499b30c147ebd4696d.tar.bz2
coroutines, testsuite: Fix single test execution.
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.
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/coro-torture.exp14
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 15e7d6d..ad4fcb5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-17 Iain Sandoe <iain@sandoe.co.uk>
+
+ * g++.dg/coroutines/torture/coro-torture.exp: Ensure that
+ DEFAULT_CXXFLAGS has a value, even if unset by a higher level.
+
2020-03-17 Andre Vieira <andre.simoesdiasvieira@arm.com>
Mihail Ionescu <mihail.ionescu@arm.com>
Srinath Parvathaneni <srinath.parvathaneni@arm.com>
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/coro-torture.exp b/gcc/testsuite/g++.dg/coroutines/torture/coro-torture.exp
index d2463b2..2246f71 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]