Reset prologue_location before calling code_end
[official-gcc.git] / libgomp / testsuite / Makefile.am
blob655a413c160b5686c159b6ce2b89b01c621c1f11
1 ## Process this file with automake to produce Makefile.in.
3 AUTOMAKE_OPTIONS = foreign
5 # May be used by various substitution variables.
6 gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
8 EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \
9            echo $(top_builddir)/../expect/expect; else echo expect; fi)
11 _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
12              echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
13 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
15 EXTRA_DEJAGNU_SITE_CONFIG = libgomp-site-extra.exp
17 # Instead of directly in ../testsuite/libgomp-test-support.exp.in, the
18 # following variables have to be "routed through" this Makefile, for expansion
19 # of the several (Makefile) variables used therein.
20 libgomp-test-support.exp: libgomp-test-support.pt.exp Makefile
21         cp $< $@.tmp
22         echo >> $@.tmp \
23           'set offload_additional_options "$(offload_additional_options)"'
24         echo >> $@.tmp \
25           'set offload_additional_lib_paths "$(offload_additional_lib_paths)"'
26         mv $@.tmp $@
28 check-DEJAGNU: site.exp
29         srcdir='$(srcdir)'; export srcdir; \
30         EXPECT=$(EXPECT); export EXPECT; \
31         if $(SHELL) -c "$(_RUNTEST) --version" > /dev/null 2>&1; then \
32           exit_status=0; l='$(PACKAGE)'; for tool in $$l; do \
33             if $(_RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
34             then :; else exit_status=1; fi; \
35           done; \
36         else echo "WARNING: could not find '$(_RUNTEST)'" 1>&2; :;\
37         fi; \
38         exit $$exit_status
39 site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
40         @echo 'Making a new site.exp file ...'
41         @echo '## these variables are automatically generated by make ##' >site.tmp
42         @echo '# Do not edit here.  If you wish to override these values' >>site.tmp
43         @echo '# edit the last section' >>site.tmp
44         @echo 'set srcdir "$(srcdir)"' >>site.tmp
45         @echo "set objdir `pwd`" >>site.tmp
46         @echo 'set build_alias "$(build_alias)"' >>site.tmp
47         @echo 'set build_triplet $(build_triplet)' >>site.tmp
48         @echo 'set host_alias "$(host_alias)"' >>site.tmp
49         @echo 'set host_triplet $(host_triplet)' >>site.tmp
50         @echo 'set target_alias "$(target_alias)"' >>site.tmp
51         @echo 'set target_triplet $(target_triplet)' >>site.tmp
52         @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
53           echo "## Begin content included from file $$f.  Do not modify. ##" \
54            && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
55            && echo "## End content included from file $$f. ##" \
56            || exit 1; \
57          done >> site.tmp
58         @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
59         @if test -f site.exp; then \
60            sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
61          fi
62         @-rm -f site.bak
63         @test ! -f site.exp || mv site.exp site.bak
64         @mv site.tmp site.exp
66 distclean-DEJAGNU:
67         -rm -f site.exp site.bak
68         -l='$(PACKAGE)'; for tool in $$l; do \
69           rm -f $$tool.sum $$tool.log; \
70         done
71 distclean-am: distclean-DEJAGNU
72 check-am:
73         @if test -n "$(filter -j%, $(MFLAGS))"; then \
74           num_cpus=@CPU_COUNT@; \
75           if type -p getconf 2>/dev/null >/dev/null; then \
76             num_cpus=`getconf _NPROCESSORS_ONLN 2>/dev/null`; \
77             case "$$num_cpus" in \
78               '' | 0* | *[!0-9]*) num_cpus=@CPU_COUNT@;; \
79             esac; \
80           fi; \
81           if test $$num_cpus -gt 8 && test -z "$$OMP_NUM_THREADS"; then \
82             OMP_NUM_THREADS=8; export OMP_NUM_THREADS; \
83             echo @@@ libgomp OMP_NUM_THREADS adjusted to 8 because of parallel make check and too many CPUs; \
84           fi; \
85         fi; \
86         $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
87 all-local: libgomp-test-support.exp
89 .PHONY: check-DEJAGNU distclean-DEJAGNU