Get rid of the warning about ignoring the return value of fgets
[cloog.git] / test / Makefile.am
blob09bc6062eb54d4631b63237db381ec5257f1093d
2 #   /**-------------------------------------------------------------------**
3 #    **                              CLooG                                **
4 #    **-------------------------------------------------------------------**
5 #    **                            makefile                               **
6 #    **-------------------------------------------------------------------**
7 #    **                   First version: march 6th 2003                   **
8 #    **-------------------------------------------------------------------**/
10 # makefile for checking.
12 #/*****************************************************************************
13 # *               CLooG : the Chunky Loop Generator (experimental)            *
14 # *****************************************************************************
15 # *                                                                           *
16 # * Copyright (C) 2003 Cedric Bastoul                                         *
17 # *                                                                           *
18 # * This library is free software; you can redistribute it and/or             *
19 # * modify it under the terms of the GNU Lesser General Public                *
20 # * License as published by the Free Software Foundation; either              *
21 # * version 2.1 of the License, or (at your option) any later version.        *
22 # *                                                                           *
23 # * This library is distributed in the hope that it will be useful,           *
24 # * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
25 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
26 # * Lesser General Public License for more details.                           *
27 # *                                                                           *
28 # * You should have received a copy of the GNU Lesser General Public          *
29 # * License along with this library; if not, write to the Free Software       *
30 # * Foundation, Inc., 51 Franklin Street, Fifth Floor,                        *
31 # * Boston, MA  02110-1301  USA                                               *
32 # *                                                                           *
33 # * CLooG, the Chunky Loop Generator                                          *
34 # * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr                        *
35 # * This file has been written with the help of the Bart Kienhuis's checking  *
36 # * makefile for PipLib.                                                      *
37 # *                                                                           *
38 # *****************************************************************************/
40 if NO_ISL
41 GENERATE_TEST =
42 else
43 GENERATE_TEST = generate_test
44 endif
45 noinst_PROGRAMS = $(GENERATE_TEST)
46 AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
47 LDADD = ../libcloog-isl.la
48 generate_test_SOURCES = generate_test.c
50 FORCE:
51 ../libcloog-isl.la: FORCE
52         cd ..; $(MAKE) $(AM_MAKEFLAGS) libcloog-isl.la
54 ROOT = ..
56 FINITE_CLOOGTEST_C = \
57         0D-1 \
58         0D-2 \
59         0D-3 \
60         1point-1 \
61         1point-2 \
62         4-param \
63         basic-bounds-1 \
64         basic-bounds-2 \
65         basic-bounds-3 \
66         basic-bounds-4 \
67         basic-bounds-5 \
68         basic-bounds-6 \
69         block \
70         block2 \
71         block3 \
72         byu98-1-2-3 \
73         cholesky \
74         cholesky2 \
75         christian \
76         classen \
77         classen2 \
78         constant \
79         constbound \
80         darte \
81         dealII \
82         donotsimp \
83         dot \
84         dot2 \
85         double \
86         durbin_e_s \
87         emploi \
88         esced \
89         ex1 \
90         forwardsub-1-1-2 \
91         forwardsub-2-1-2-3 \
92         forwardsub-3-1-2 \
93         gauss \
94         gesced \
95         gesced2 \
96         gesced3 \
97         guide \
98         iftest \
99         iftest2 \
100         largeur \
101         levenshtein-1-2-3 \
102         lex \
103         lineality-1-2 \
104         lineality-2-1-2 \
105         logo \
106         logopar \
107         lu \
108         lu2 \
109         lub \
110         lux \
111         min-1-1 \
112         min-2-1 \
113         min-3-1 \
114         min-4-1 \
115         mode \
116         multi-mm-1 \
117         no_lindep \
118         orc \
119         rectangle \
120         singleton \
121         square+triangle-1-1-2-3 \
122         swim \
123         test \
124         thomasset \
125         tiling \
126         uday_scalars \
127         union \
128         vivien \
129         vivien2 \
130         walters \
131         walters2 \
132         walters3 \
133         wavefront \
134         yosr \
135         yosr2 \
136         non_optimal/nul_complex1 \
137         non_optimal/usvd_e_t \
138         non_optimal/youcef \
139         reservoir/cholesky2 \
140         reservoir/fusion1 \
141         reservoir/fusion2 \
142         reservoir/jacobi2 \
143         reservoir/jacobi3 \
144         reservoir/lim-lam1 \
145         reservoir/lim-lam2 \
146         reservoir/lim-lam3 \
147         reservoir/lim-lam4 \
148         reservoir/lim-lam5 \
149         reservoir/lim-lam6 \
150         reservoir/liu-zhuge1 \
151         reservoir/loechner3 \
152         reservoir/loechner4 \
153         reservoir/loechner5 \
154         reservoir/mg-interp2 \
155         reservoir/mg-interp \
156         reservoir/mg-psinv \
157         reservoir/mg-resid \
158         reservoir/mg-rprj3 \
159         reservoir/pingali1 \
160         reservoir/pingali2 \
161         reservoir/pingali3 \
162         reservoir/pingali4 \
163         reservoir/pingali5 \
164         reservoir/pingali6 \
165         reservoir/QR \
166         reservoir/tang-xue1 \
167         reservoir/two
169 CLOOG_ISL_TEST_C = \
170         isl/mod \
171         isl/mod2 \
172         isl/mod3 \
173         isl/mod4
175 CLOOGTEST_C = \
176         infinite \
177         infinite2 \
178         infinite3 \
179         infinite4 \
180         $(FINITE_CLOOGTEST_C) \
181         $(CLOOG_ISL_TEST_C)
183 CLOOGTEST_FORTRAN = \
184         dartef \
185         iftestf \
186         levenshtein-1-2-3f \
187         yosrf
189 CLOOG_ISL_TEST_STRIDED = \
190         isl/mxm-shared
192 CLOOGTEST_STRIDED = \
193         basic-bounds-2 \
194         mod4 \
195         nul_basic1 \
196         nul_basic2 \
197         nul_lcpc \
198         multi-stride \
199         multi-stride2 \
200         stride3 \
201         stride4 \
202         reservoir/bastoul3 \
203         reservoir/stride \
204         reservoir/stride2 \
205         $(CLOOG_ISL_TEST_STRIDED)
207 if NO_OSL
208 CLOOGTEST_OPENSCOP =
209 else
210 CLOOGTEST_OPENSCOP = \
211         openscop/matmult \
212         openscop/empty \
213         openscop/loops \
214         openscop/union \
215         openscop/coordinates \
216         openscop/clay
217 endif
219 SPECIAL_TESTS = \
220         isl/unroll \
221         isl/jacobi-shared \
222         isl/unroll2 \
223         backtrack \
224         vasilache \
225         merge \
226         equality \
227         equality2 \
228         otl \
229         param-split \
230         pouchet \
231         stride \
232         stride2 \
233         sor1d
235 SPECIAL_OPTIONS = \
236         'isl/unroll -first-unroll 1' \
237         'isl/jacobi-shared -f 4 -l -1 -override -strides 1 -sh 1' \
238         'isl/unroll2 -first-unroll 1' \
239         'backtrack -f 1 -backtrack' \
240         'vasilache -f 8 -l 9' \
241         'merge -f -1' \
242         'equality -f -1 -l 2 -override' \
243         'equality2 -f -1 -l 4 -esp 1 -override' \
244         'otl -block 1 -esp 0 -otl 0' \
245         'param-split -f -1' \
246         'pouchet -f 3 -l 7' \
247         'stride -f -1 -strides 1' \
248         'stride2 -f -1 -strides 1' \
249         'sor1d -f -1'
251 generate:
252         @echo "             /*-----------------------------------------------*"
253         @echo "              *                 Generate files                *"
254         @echo "              *-----------------------------------------------*/"
255         @for x in $(CLOOGTEST_C) ; do \
256                 echo "Generate $$x.c" ; \
257                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
258         done ; \
259         for x in $(CLOOGTEST_FORTRAN) ; do \
260                 echo "Generate $$x.f" ; \
261                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
262         done ; \
263         for x in $(CLOOGTEST_STRIDED) ; do \
264                 echo "Generate $$x.c" ; \
265                 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
266                         -strides 1 -o $(srcdir)/$$x.c ; \
267         done ; \
268         for x in $(CLOOGTEST_OPENSCOP) ; do \
269                 echo "Generate $$x.c" ; \
270                 $(top_builddir)/cloog $(srcdir)/$$x.scop \
271                 -openscop -o $(srcdir)/$$x.c ; \
272         done ; \
273         for line in $(SPECIAL_OPTIONS); do \
274                 options=`echo $$line | sed -e 's/^[^ ]* //'`; \
275                 x=`echo $$line | sed -e 's/ .*//'`; \
276                 echo "Generate file $$x ($$options)" ; \
277                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
278                     $$options > $(srcdir)/$$x.c ; \
279         done
281 generate_good:
282         @for x in $(FINITE_CLOOGTEST_C) ; do \
283                 echo "Generate $$x.good.c" ; \
284                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
285         done; \
286         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
287                 echo "Generate $$x.good.c ($$options)" ; \
288                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
289         done; done
291 valcheck: test_valgrind
293 CHECKER := "$(srcdir)/checker.sh"
295 TESTS_ENVIRONMENT = \
296         top_builddir=$(top_builddir) \
297         srcdir=$(srcdir) \
298         EXEXT=$(EXEEXT) \
299         CHECKER=$(CHECKER) \
300         COMPILE="$(COMPILE)" \
301         LINK="$(LINK)" \
302         FINITE_CLOOGTEST_C="$(FINITE_CLOOGTEST_C)" \
303         CLOOGTEST_C="$(CLOOGTEST_C)" \
304         CLOOGTEST_FORTRAN="$(CLOOGTEST_FORTRAN)" \
305         CLOOGTEST_STRIDED="$(CLOOGTEST_STRIDED)" \
306         CLOOGTEST_OPENSCOP="$(CLOOGTEST_OPENSCOP)" \
307         SPECIAL_OPTIONS="$(SPECIAL_OPTIONS)"
309 test_run: generate_test$(EXEEXT)
310         $(TESTS_ENVIRONMENT) $(srcdir)/check_run.sh
312 test_valgrind:
313         $(TESTS_ENVIRONMENT) $(srcdir)/check_c.sh valgrind ; \
314         $(TESTS_ENVIRONMENT) $(srcdir)/check_fortran.sh valgrind ; \
315         $(TESTS_ENVIRONMENT) $(srcdir)/check_strided.sh valgrind ; \
316         $(TESTS_ENVIRONMENT) $(srcdir)/check_openscop.sh valgrind ; \
317         $(TESTS_ENVIRONMENT) $(srcdir)/check_special.sh valgrind
319 test_regenerate:
320         $(TESTS_ENVIRONMENT) $(srcdir)/check_c.sh regenerate ; \
321         $(TESTS_ENVIRONMENT) $(srcdir)/check_fortran.sh regenerate ; \
322         $(TESTS_ENVIRONMENT) $(srcdir)/check_strided.sh regenerate ; \
323         $(TESTS_ENVIRONMENT) $(srcdir)/check_openscop.sh regenerate ; \
324         $(TESTS_ENVIRONMENT) $(srcdir)/check_special.sh regenerate
326 check_SCRIPTS = \
327         check_c.sh \
328         check_fortran.sh \
329         check_strided.sh \
330         check_openscop.sh \
331         check_special.sh
333 TESTS = $(check_SCRIPTS)
335 EXTRA_DIST = \
336         $(check_SCRIPTS) \
337         $(srcdir)/checker.sh \
338         $(srcdir)/check_run.sh \
339         $(CLOOGTEST_C:%=%.cloog) \
340         $(CLOOGTEST_C:%=%.c) \
341         $(FINITE_CLOOGTEST_C:%=%.good.c) \
342         $(CLOOGTEST_FORTRAN:%=%.cloog) \
343         $(CLOOGTEST_FORTRAN:%=%.f) \
344         $(CLOOGTEST_STRIDED:%=%.cloog) \
345         $(CLOOGTEST_STRIDED:%=%.c) \
346         $(CLOOGTEST_OPENSCOP:%=%.scop) \
347         $(CLOOGTEST_OPENSCOP:%=%.c) \
348         $(SPECIAL_TESTS:%=%.cloog) \
349         $(SPECIAL_TESTS:%=%.c) \
350         $(SPECIAL_TESTS:%=%.good.c) \
351         openscop/clay_orig.c \
352         openscop/coordinates_orig.c