| 1 |
# Copyright (C) 2018-2025 Free Software Foundation, Inc. |
| 2 |
|
| 3 |
# Contributed by Iain Sandoe <[email protected]> under contract to Facebook. |
| 4 |
|
| 5 |
# This program is free software; you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU General Public License as published by |
| 7 |
# the Free Software Foundation; either version 3 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# This program is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU General Public License |
| 16 |
# along with GCC; see the file COPYING3. If not see |
| 17 |
# <http://www.gnu.org/licenses/>. |
| 18 |
|
| 19 |
# Test C++ coroutines, requires c++17; doesn't, at present, seem much |
| 20 |
# point in repeating these for other versions. |
| 21 |
|
| 22 |
# Load support procs. |
| 23 |
load_lib g++-dg.exp |
| 24 |
|
| 25 |
# If a testcase doesn't have special options, use these. |
| 26 |
global DEFAULT_CXXFLAGS |
| 27 |
if ![info exists DEFAULT_CXXFLAGS] then { |
| 28 |
set DEFAULT_CXXFLAGS " -pedantic-errors -Wno-long-long" |
| 29 |
} |
| 30 |
|
| 31 |
set DEFAULT_COROFLAGS $DEFAULT_CXXFLAGS |
| 32 |
lappend DEFAULT_COROFLAGS "-std=c++20" |
| 33 |
|
| 34 |
dg-init |
| 35 |
|
| 36 |
# Run the tests. |
| 37 |
# g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] \ |
| 38 |
# "" $DEFAULT_COROFLAGS |
| 39 |
|
| 40 |
foreach test [lsort [find $srcdir/$subdir {*.[CH]}]] { |
| 41 |
if [runtest_file_p $runtests $test] { |
| 42 |
set nshort [file tail [file dirname $test]]/[file tail $test] |
| 43 |
verbose "Testing $nshort $DEFAULT_COROFLAGS" 1 |
| 44 |
dg-test $test "" $DEFAULT_COROFLAGS |
| 45 |
set testcase [string range $test [string length "$srcdir/"] end] |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
# done. |
| 50 |
dg-finish |