| 1 |
# Specific regression driver for nvptx. |
| 2 |
# Copyright (C) 2000-2025 Free Software Foundation, Inc. |
| 3 |
|
| 4 |
# This program is free software; you can redistribute it and/or modify |
| 5 |
# it under the terms of the GNU General Public License as published by |
| 6 |
# the Free Software Foundation; either version 3 of the License, or |
| 7 |
# (at your option) any later version. |
| 8 |
# |
| 9 |
# This program is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
# GNU General Public License for more details. |
| 13 |
# |
| 14 |
# You should have received a copy of the GNU General Public License |
| 15 |
# along with GCC; see the file COPYING3. If not see |
| 16 |
# <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
# G++ testsuite that uses the `dg.exp' driver. |
| 19 |
|
| 20 |
# Exit immediately if this isn't a nvptx target. |
| 21 |
if ![istarget nvptx*-*-*] then { |
| 22 |
return |
| 23 |
} |
| 24 |
|
| 25 |
# Load support procs. |
| 26 |
load_lib g++-dg.exp |
| 27 |
|
| 28 |
# If a testcase doesn't have special options, use these. |
| 29 |
global DEFAULT_CXXFLAGS |
| 30 |
if ![info exists DEFAULT_CXXFLAGS] then { |
| 31 |
set DEFAULT_CXXFLAGS " -pedantic-errors -Wno-long-long" |
| 32 |
} |
| 33 |
|
| 34 |
# Initialize `dg'. |
| 35 |
dg-init |
| 36 |
|
| 37 |
# Recursively find files in $dir and subdirs, do not walk into subdirs |
| 38 |
# that contain their own .exp file. |
| 39 |
proc find-cxx-tests { dir suffix } { |
| 40 |
set tests [lsort [glob -nocomplain -directory $dir "*.$suffix" ]] |
| 41 |
foreach subdir [lsort [glob -nocomplain -type d -directory $dir *]] { |
| 42 |
if { [glob -nocomplain -directory $subdir *.exp] eq "" } { |
| 43 |
eval lappend tests [find-cxx-tests $subdir $suffix] |
| 44 |
} |
| 45 |
} |
| 46 |
return $tests |
| 47 |
} |
| 48 |
|
| 49 |
set tests [find-cxx-tests $srcdir/$subdir {C}] |
| 50 |
|
| 51 |
# Main loop. |
| 52 |
g++-dg-runtest $tests "" $DEFAULT_CXXFLAGS |
| 53 |
|
| 54 |
|
| 55 |
# All done. |
| 56 |
dg-finish |