1 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with GCC; see the file COPYING3. If not see
15 # <http://www.gnu.org/licenses/>.
17 # Contributed by Tobias Burnus <burnus@net-b.de>
20 # Test coarray support.
22 # For the compilation tests, all files are compiles with the
23 # option -fcoarray=single and with -fcoarray=lib
25 # For the link and execution tests, for -fcoarray=lib the
26 # libcaf_single library is linked. Additionally, with the
27 # required settings another CAF library is used.
29 # Load procedures from common libraries.
30 load_lib gfortran-dg.exp
32 # If a testcase doesn't have special options, use these.
34 if ![info exists DEFAULT_FFLAGS] then {
35 set DEFAULT_FFLAGS " -pedantic-errors"
41 global DG_TORTURE_OPTIONS torture_with_loops
44 set-torture-options $DG_TORTURE_OPTIONS
47 foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] {
48 # If we're only testing specific files and this isn't one of them, skip it.
49 if ![runtest_file_p $runtests $test] then {
53 # Enable if you want to test several options:
54 # # look if this is dg-do-run test, in which case
55 # # we cycle through the option list, otherwise we don't
56 # if [expr [search_for $test "dg-do run"]] {
57 # set option_list $torture_with_loops
59 # set option_list [list { -O } ]
61 set option_list [list { -O2 } ]
63 set nshort [file tail [file dirname $test]]/[file tail $test]
64 list-module-names $test
66 foreach flags $option_list {
67 verbose "Testing $nshort (single), $flags" 1
68 dg-test $test "-fcoarray=single $flags" ""
72 foreach flags $option_list {
73 verbose "Testing $nshort (libcaf_single), $flags" 1
74 dg-test $test "-fcoarray=lib $flags -lcaf_single" ""