1 # Specific regression driver
for nvptx.
2 # Copyright
(C
) 2015-2024 Free Software Foundation
, Inc.
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.
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.
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
/>.
18 # GCC testsuite that uses the `dg.exp
' driver.
20 # Exit immediately if this isn't a nvptx target.
21 if ![istarget nvptx
*-*-*] then {
28 #
Return 1 if code by default compiles
for at least PTX ISA version
30 proc check_effective_target_default_ptx_isa_version_at_least
{ major minor
} {
31 set name default_ptx_isa_version_at_least_$
{major
}_$
{minor
}
35 "((__PTX_ISA_VERSION_MAJOR__ == $major" \
36 " && __PTX_ISA_VERSION_MINOR__ >= $minor)" \
37 " || (__PTX_ISA_VERSION_MAJOR__ > $major))"]
43 "#error unsupported" \
45 set src
[join $src
"\n"]
47 set res
[check_no_compiler_messages $
name assembly $src
""]
52 #
Return 1 if code by default compiles
for at least PTX ISA version
6.0.
53 proc check_effective_target_default_ptx_isa_version_at_least_6_0
{ } {
54 return [check_effective_target_default_ptx_isa_version_at_least
6 0]
57 #
Return 1 if code with PTX ISA version major.minor or higher can be run.
58 proc check_effective_target_runtime_ptx_isa_version_at_least
{ major minor
} {
59 set name runtime_ptx_isa_version_$
{major
}_$
{minor
}
62 [check_effective_target_default_ptx_isa_version_at_least \
68 set flag
"-mptx=$major.$minor"
71 set res
[check_runtime $
name {
72 int main
(void
) { return 0; }
78 #
Return 1 if runtime environment support the PTX ISA directive .alias.
79 proc check_effective_target_runtime_ptx_alias
{ } {
80 return [check_effective_target_runtime_ptx_isa_version_at_least
6 3]
83 # Add options to enable using PTX ISA directive .alias.
84 proc add_options_for_ptx_alias
{ flags
} {
85 append flags
" -malias"
87 if { ![check_effective_target_default_ptx_isa_version_at_least
6 3] } {
88 append flags
" -mptx=6.3"
94 #
If a testcase doesn
't have special options, use these.
96 if ![info exists DEFAULT_CFLAGS] then {
97 set DEFAULT_CFLAGS " -ansi -pedantic-errors"
104 dg
-runtest
[lsort
[glob
-nocomplain $srcdir
/$subdir
/*.\
[cS\
]]] \