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