update isl for reading of extended PolyLib format
[cloog/uuh.git] / test / Makefile.am
blob7c9a5d97539c733fdefe5d24c949f7fdce120910
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 INCLUDES = -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         byu98-1-2-3                    \
71         cholesky                       \
72         cholesky2                      \
73         classen                        \
74         constbound                     \
75         darte                          \
76         donotsimp                      \
77         dot                            \
78         dot2                           \
79         double                         \
80         durbin_e_s                     \
81         emploi                         \
82         esced                          \
83         ex1                            \
84         forwardsub-1-1-2               \
85         forwardsub-2-1-2-3             \
86         forwardsub-3-1-2               \
87         gauss                          \
88         gesced                         \
89         gesced2                        \
90         gesced3                        \
91         guide                          \
92         iftest                         \
93         iftest2                        \
94         largeur                        \
95         levenshtein-1-2-3              \
96         lex                            \
97         lineality-1-2                  \
98         lineality-2-1-2                \
99         logo                           \
100         logopar                        \
101         lu                             \
102         lu2                            \
103         lub                            \
104         lux                            \
105         min-1-1                        \
106         min-2-1                        \
107         min-3-1                        \
108         min-4-1                        \
109         mode                           \
110         multi-mm-1                     \
111         no_lindep                      \
112         orc                            \
113         rectangle                      \
114         singleton                      \
115         square+triangle-1-1-2-3        \
116         swim                           \
117         test                           \
118         thomasset                      \
119         tiling                         \
120         uday_scalars                   \
121         vivien                         \
122         vivien2                        \
123         walters                        \
124         walters2                       \
125         wavefront                      \
126         yosr                           \
127         yosr2                          \
128         ./non_optimal/nul_complex1     \
129         ./non_optimal/usvd_e_t         \
130         ./non_optimal/youcef           \
131         ./reservoir/cholesky2          \
132         ./reservoir/fusion1            \
133         ./reservoir/fusion2            \
134         ./reservoir/jacobi2            \
135         ./reservoir/jacobi3            \
136         ./reservoir/lim-lam1           \
137         ./reservoir/lim-lam2           \
138         ./reservoir/lim-lam3           \
139         ./reservoir/lim-lam4           \
140         ./reservoir/lim-lam5           \
141         ./reservoir/lim-lam6           \
142         ./reservoir/liu-zhuge1         \
143         ./reservoir/loechner3          \
144         ./reservoir/loechner4          \
145         ./reservoir/loechner5          \
146         ./reservoir/mg-interp2         \
147         ./reservoir/mg-interp          \
148         ./reservoir/mg-psinv           \
149         ./reservoir/mg-resid           \
150         ./reservoir/mg-rprj3           \
151         ./reservoir/pingali1           \
152         ./reservoir/pingali2           \
153         ./reservoir/pingali3           \
154         ./reservoir/pingali4           \
155         ./reservoir/pingali5           \
156         ./reservoir/pingali6           \
157         ./reservoir/QR                 \
158         ./reservoir/tang-xue1          \
159         ./reservoir/two   
161 CLOOGTEST_C =                          \
162         infinite                       \
163         infinite2                      \
164         infinite3                      \
165         infinite4                      \
166         $(FINITE_CLOOGTEST_C)
168 #       ./reservoir/long               \
169 #       faber
171 CLOOGTEST_FORTRAN =                    \
172         dartef                         \
173         iftestf                        \
174         levenshtein-1-2-3f             \
175         yosrf
177 CLOOGTEST_STRIDED =                    \
178         basic-bounds-2                 \
179         mod4                           \
180         nul_basic1                     \
181         nul_basic2                     \
182         nul_lcpc                       \
183         multi-stride                   \
184         multi-stride2                  \
185         reservoir/bastoul3             \
186         reservoir/stride               \
187         reservoir/stride2
189 SPECIAL_TESTS = \
190         vasilache \
191         merge \
192         equality \
193         equality2 \
194         stride \
195         stride2 \
196         sor1d
197 SPECIAL_OPTIONS = \
198         'vasilache -f 8 -l 9' \
199         'merge -f -1' \
200         'equality -f -1 -l 2 -override' \
201         'equality2 -f -1 -l 4 -esp 1 -override' \
202         'stride -f -1 -strides 1' \
203         'stride2 -f -1 -strides 1' \
204         'sor1d -f -1'
206 EXTRA_DIST = \
207         $(CLOOGTEST_C:%=%.cloog) \
208         $(CLOOGTEST_C:%=%.c) \
209         $(FINITE_CLOOGTEST_C:%=%.good.c) \
210         $(CLOOGTEST_FORTRAN:%=%.cloog) \
211         $(CLOOGTEST_FORTRAN:%=%.f) \
212         $(CLOOGTEST_STRIDED:%=%.cloog) \
213         $(CLOOGTEST_STRIDED:%=%.c) \
214         $(SPECIAL_TESTS:%=%.cloog) \
215         $(SPECIAL_TESTS:%=%.c) \
216         $(SPECIAL_TESTS:%=%.good.c)
218 generate:
219         @echo "             /*-----------------------------------------------*"
220         @echo "              *                 Generate files                *"
221         @echo "              *-----------------------------------------------*/"
222         @for x in $(CLOOGTEST_C) ; do \
223                 echo "Generate $$x.c" ; \
224                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
225         done ; \
226         for x in $(CLOOGTEST_FORTRAN) ; do \
227                 echo "Generate $$x.f" ; \
228                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
229         done ; \
230         for x in $(CLOOGTEST_STRIDED) ; do \
231                 echo "Generate $$x.c" ; \
232                 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
233                         -strides 1 -o $(srcdir)/$$x.c ; \
234         done ; \
235         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
236                 echo "Generate file $$x ($$options)" ; \
237                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
238                     $$options > $(srcdir)/$$x.c ; \
239         done; done
241 generate_good:
242         @for x in $(FINITE_CLOOGTEST_C) ; do \
243                 echo "Generate $$x.good.c" ; \
244                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
245         done; \
246         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
247                 echo "Generate $$x.good.c ($$options)" ; \
248                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
249         done; done
251 valgrind:
252         @echo "             /*-----------------------------------------------*"
253         @echo "              *            Checking files by Valgrind         *"
254         @echo "              *-----------------------------------------------*/"
255         for x in $(CLOOGTEST_C) ; do \
256                 echo "Valgrinding $$x.c" ; \
257                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
258         done ; \
259         for x in $(CLOOGTEST_FORTRAN) ; do \
260                 echo "Valgrinding $$x.f" ; \
261                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
262         done
264 test_run: generate_test$(EXEEXT)
265         @echo "             /*-----------------------------------------------*"
266         @echo "              *                 Testing CLooG                 *"
267         @echo "              *-----------------------------------------------*/"
268         @failedtest=0 ; \
269         echo "--- Testing C files... (correct output)" ; \
270         for x in $(FINITE_CLOOGTEST_C) ; do \
271                 echo -n "Verify file $$x... " ; \
272                 echo -n "generating... " ; \
273                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
274                 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
275                 echo -n "compiling... " ; \
276                 $(COMPILE) -c test_test.c; \
277                 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
278                 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
279                 echo -n "comparing... " ; \
280                 ./test_run$(EXEEXT); \
281                 result=$$?; \
282                 if test "$$result" -ne "0" ; then \
283                         failedtest=`expr $$failedtest + 1` ; \
284                 fi; \
285                 $(RM) $@; \
286                 echo; \
287         done; \
288         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
289                 echo -n "Verify file $$x ($$options)... " ; \
290                 echo -n "generating... " ; \
291                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(srcdir)/$$x.cloog > test_test.c ; \
292                 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
293                 echo -n "compiling... " ; \
294                 $(COMPILE) -c test_test.c; \
295                 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
296                 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
297                 echo -n "comparing... " ; \
298                 ./test_run$(EXEEXT); \
299                 result=$$?; \
300                 if test "$$result" -ne "0" ; then \
301                         failedtest=`expr $$failedtest + 1` ; \
302                 fi; \
303                 $(RM) $@; \
304                 echo; \
305         done; done; \
306         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
307                 echo -n "Verify file $$x ($$options -sh 1)... " ; \
308                 echo -n "generating... " ; \
309                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
310                 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
311                 echo -n "compiling... " ; \
312                 $(COMPILE) -c test_test.c; \
313                 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
314                 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
315                 echo -n "comparing... " ; \
316                 ./test_run$(EXEEXT); \
317                 result=$$?; \
318                 if test "$$result" -ne "0" ; then \
319                         failedtest=`expr $$failedtest + 1` ; \
320                 fi; \
321                 $(RM) $@; \
322                 echo; \
323         done; done; \
324         if [ $$failedtest != 0 ] ; then \
325                 echo "$$failedtest tests failed" ; \
326         else \
327                 echo "CLooG works correctly :-) !" ; \
328         fi
329 test:
330         @echo "             /*-----------------------------------------------*"
331         @echo "              *                 Testing CLooG                 *"
332         @echo "              *-----------------------------------------------*/"
333         @failedtest=0 ; \
334         echo "--- Testing C files... (expected output)" ; \
335         for x in $(CLOOGTEST_C) ; do \
336                 echo "Verify file $$x" ; \
337                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
338                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
339                 result=$$?; \
340                 if [ "$$result" -ne "0" ] ; then \
341                         echo "!!! Error: $$x is not the same" ; \
342                         failedtest=`expr $$failedtest + 1` ; \
343                 else \
344                         echo "$$x passed" ; \
345                 fi ; \
346         done ; \
347         echo "--- Testing FORTRAN files..." ; \
348         for x in $(CLOOGTEST_FORTRAN) ; do \
349                 echo "Verify file $$x" ; \
350                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
351                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
352                 result=$$?; \
353                 if [ "$$result" -ne "0" ] ; then \
354                         echo "!!! Error: $$x is not the same" ; \
355                         failedtest=`expr $$failedtest + 1` ; \
356                 else \
357                         echo "$$x passed" ; \
358                 fi ; \
359         done ; \
360         echo "--- Testing STRIDED files..." ; \
361         for x in $(CLOOGTEST_STRIDED) ; do \
362                 echo "Verify file $$x" ; \
363                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
364                 -strides 1 > ttemp ; \
365                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
366                 result=$$?; \
367                 if [ "$$result" -ne "0" ] ; then \
368                         echo "!!! Error: $$x is not the same" ; \
369                         failedtest=`expr $$failedtest + 1` ; \
370                 else \
371                         echo "$$x passed" ; \
372                 fi ; \
373         done ; \
374         echo "--- Testing SPECIAL OPTIONS files..." ; \
375         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
376                 echo "Verify file $$x ($$options)" ; \
377                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
378                         $$options > ttemp ; \
379                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
380                 result=$$?; \
381                 if [ "$$result" -ne "0" ] ; then \
382                         echo "!!! Error: $$x is not the same" ; \
383                         failedtest=`expr $$failedtest + 1` ; \
384                 else \
385                         echo "$$x passed" ; \
386                 fi ; \
387         done; done; \
388         rm ttemp ; \
389         if [ $$failedtest != 0 ] ; then \
390                 echo "$$failedtest tests failed" ; \
391         else \
392                 echo "CLooG works correctly :-) !" ; \
393         fi