OSDN Git Service

2009-10-05 Sebastian Pop <sebastian.pop@amd.com>
[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_CFLAGS_GRAPHITE_BLOCK "-O2 -fdump-tree-graphite-all"
47 set block_files [lsort [glob -nocomplain $srcdir/$subdir/block-*.c ] ]
48 dg-runtest $block_files "" $DEFAULT_CFLAGS_GRAPHITE_BLOCK
49 foreach block_file $block_files {lremove wait_to_run_files $block_file}
50
51 # Flags using for id-* files.
52 set DEFAULT_CFLAGS_GRAPHITE_IDENTITY "-O2 -fgraphite-identity"
53 set id_files [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ]
54 dg-runtest $id_files "" $DEFAULT_CFLAGS_GRAPHITE_IDENTITY
55 foreach id_file $id_files {lremove wait_to_run_files $id_file}
56
57 # Flags using for interchange-* files.
58 set DEFAULT_CFLAGS_GRAPHITE_BLOCK "-O2 -fdump-tree-graphite-all -floop-interchange -ffast-math"
59 set interchange_files [lsort [glob -nocomplain $srcdir/$subdir/interchange-*.c ] ]
60 dg-runtest $interchange_files "" $DEFAULT_CFLAGS_GRAPHITE_BLOCK
61 foreach interchange_file $interchange_files {lremove wait_to_run_files $interchange_file}
62
63 # Flags using for scop-* files.
64 set DEFAULT_CFLAGS_GRAPHITE_SCOP "-O2 -fgraphite -fdump-tree-graphite-all"
65 set scop_files [lsort [glob -nocomplain $srcdir/$subdir/scop-*.c ] ]
66 dg-runtest $scop_files "" $DEFAULT_CFLAGS_GRAPHITE_SCOP
67 foreach scop_file $scop_files {lremove wait_to_run_files $scop_file}
68
69
70 # Schedule now the tests to be run.
71 set dg-do-what-default run
72
73 # Flags using for run-id-* files.
74 set DEFAULT_CFLAGS_RUN_ID "-O2 -fgraphite-identity"
75 set run_id_files [lsort [glob -nocomplain $srcdir/$subdir/run-id-*.c ] ]
76 dg-runtest $run_id_files "" $DEFAULT_CFLAGS_RUN_ID
77 foreach run_id_file $run_id_files {lremove wait_to_run_files $run_id_file}
78
79
80 # The default action for the rest of the files is 'compile'.
81 set dg-do-what-default compile
82
83 # Flags using for other files.
84 set DEFAULT_CFLAGS_GRAPHITE "-ansi -pedantic-errors"
85 dg-runtest $wait_to_run_files "" $DEFAULT_CFLAGS_GRAPHITE
86
87 # Clean up.
88 set dg-do-what-default ${save-dg-do-what-default}
89
90 # All done.
91 dg-finish