OSDN Git Service

Fix PR42205.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / graphite / graphite.exp
1 #   Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
2
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.
7
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.
12
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/>.
16
17 # GCC testsuite that uses the `dg.exp' driver.
18
19 # Load support procs.
20 load_lib gcc-dg.exp
21
22 if ![check_effective_target_fgraphite] {
23   return
24 }
25
26 # Remove VALUE from LIST_VARIABLE.
27 proc lremove {list_variable value} {
28     upvar 1 $list_variable var
29     set idx [lsearch -exact $var $value]
30     set var [lreplace $var $idx $idx]
31 }
32
33 # The default action for a test is 'compile'.  Save current default.
34 global dg-do-what-default
35 set save-dg-do-what-default ${dg-do-what-default}
36 set dg-do-what-default compile
37
38 # Initialize `dg'.
39 dg-init
40
41 # Main loop.
42
43 set wait_to_run_files [lsort [glob -nocomplain $srcdir/$subdir/*.c ] ]
44
45 # Flags using for block-* files.
46 set DEFAULT_FLAGS_GRAPHITE_BLOCK "-O2 -floop-block -fno-loop-strip-mine \
47  -fno-loop-interchange -fdump-tree-graphite-all"
48 set block_files [lsort [glob -nocomplain $srcdir/$subdir/block-*.c ] ]
49 dg-runtest $block_files "" $DEFAULT_FLAGS_GRAPHITE_BLOCK
50 foreach block_file $block_files {lremove wait_to_run_files $block_file}
51
52 # Flags using for id-* files.
53 set DEFAULT_FLAGS_GRAPHITE_IDENTITY "-O2 -fgraphite-identity"
54 set id_files [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ]
55 dg-runtest $id_files "" $DEFAULT_FLAGS_GRAPHITE_IDENTITY
56 foreach id_file $id_files {lremove wait_to_run_files $id_file}
57
58 # Flags using for interchange-* files.
59 set DEFAULT_FLAGS_GRAPHITE_INTERCHANGE "-O2 -fdump-tree-graphite-all \
60  -floop-interchange -fno-loop-block -fno-loop-strip-mine -ffast-math"
61 set interchange_files [lsort [glob -nocomplain $srcdir/$subdir/interchange-*.c ] ]
62 dg-runtest $interchange_files "" $DEFAULT_FLAGS_GRAPHITE_INTERCHANGE
63 foreach interchange_file $interchange_files {lremove wait_to_run_files $interchange_file}
64
65 # Flags using for scop-* files.
66 set DEFAULT_FLAGS_GRAPHITE_SCOP "-O2 -fgraphite -fdump-tree-graphite-all"
67 set scop_files [lsort [glob -nocomplain $srcdir/$subdir/scop-*.c ] ]
68 dg-runtest $scop_files "" $DEFAULT_FLAGS_GRAPHITE_SCOP
69 foreach scop_file $scop_files {lremove wait_to_run_files $scop_file}
70
71
72 # Schedule now the tests to be run.
73 set dg-do-what-default run
74
75 # Flags using for run-id-* files.
76 set DEFAULT_FLAGS_RUN_ID "-O2 -fgraphite-identity"
77 set run_id_files [lsort [glob -nocomplain $srcdir/$subdir/run-id-*.c ] ]
78 dg-runtest $run_id_files "" $DEFAULT_FLAGS_RUN_ID
79 foreach run_id_file $run_id_files {lremove wait_to_run_files $run_id_file}
80
81
82 # The default action for the rest of the files is 'compile'.
83 set dg-do-what-default compile
84
85 # Flags using for other files.
86 set DEFAULT_FLAGS_GRAPHITE "-ansi -pedantic-errors"
87 dg-runtest $wait_to_run_files "" $DEFAULT_FLAGS_GRAPHITE
88
89 # Clean up.
90 set dg-do-what-default ${save-dg-do-what-default}
91
92 # All done.
93 dg-finish