Changeset 91788fa


Ignore:
Timestamp:
Jul 25, 2018, 6:23:58 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
a95c117, f0b3f51
Parents:
40a7d9c (diff), e89f4b1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

Files:
2 added
20 edited
2 moved

Legend:

Unmodified
Added
Removed
  • .gitignore

    r40a7d9c r91788fa  
    2424include
    2525share
     26build
    2627*.class
    2728
  • Makefile.in

    r40a7d9c r91788fa  
    170170AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
    171171        cscope distdir dist dist-all distcheck
    172 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
    173         $(LISP)config.h.in
     172am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
    174173# Read a list of newline-separated strings from the standard input,
    175174# and print each of them once, without duplicates.  Input order is
     
    192191CSCOPE = cscope
    193192DIST_SUBDIRS = $(SUBDIRS)
    194 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
    195         $(top_srcdir)/automake/compile \
     193am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/automake/compile \
    196194        $(top_srcdir)/automake/config.guess \
    197195        $(top_srcdir)/automake/config.sub \
    198196        $(top_srcdir)/automake/install-sh \
    199         $(top_srcdir)/automake/missing INSTALL README automake/compile \
    200         automake/config.guess automake/config.sub automake/depcomp \
    201         automake/install-sh automake/missing automake/ylwrap
     197        $(top_srcdir)/automake/missing $(top_srcdir)/src/config.h.in \
     198        INSTALL README automake/compile automake/config.guess \
     199        automake/config.sub automake/depcomp automake/install-sh \
     200        automake/missing automake/ylwrap
    202201DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    203202distdir = $(PACKAGE)-$(VERSION)
     
    409408        @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
    410409
    411 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
     410stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status
    412411        @rm -f stamp-h1
    413412        cd $(top_builddir) && $(SHELL) ./config.status config.h
    414 $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
     413$(top_srcdir)/src/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
    415414        ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
    416415        rm -f stamp-h1
  • configure

    r40a7d9c r91788fa  
    24922492
    24932493#AC_CONFIG_SRCDIR([src/main.cc])
    2494 ac_config_headers="$ac_config_headers config.h"
     2494ac_config_headers="$ac_config_headers config.h:src/config.h.in"
    24952495
    24962496# Check whether --enable-silent-rules was given.
     
    62956295
    62966296
     6297ac_config_files="$ac_config_files src/tests/config.py"
     6298
    62976299cat >confcache <<\_ACEOF
    62986300# This file is a shell script that caches the results of configure
     
    70487050do
    70497051  case $ac_config_target in
    7050     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     7052    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:src/config.h.in" ;;
    70517053    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
    70527054    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     
    70617063    "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
    70627064    "tools/prettyprinter/Makefile") CONFIG_FILES="$CONFIG_FILES tools/prettyprinter/Makefile" ;;
     7065    "src/tests/config.py") CONFIG_FILES="$CONFIG_FILES src/tests/config.py" ;;
    70637066
    70647067  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
  • configure.ac

    r40a7d9c r91788fa  
    66AC_CONFIG_AUX_DIR([automake])
    77#AC_CONFIG_SRCDIR([src/main.cc])
    8 AC_CONFIG_HEADERS([config.h])
     8AC_CONFIG_HEADERS([config.h:src/config.h.in])
    99AM_SILENT_RULES([no])
    1010
     
    251251        ])
    252252
    253 AC_OUTPUT
     253AC_OUTPUT(src/tests/config.py)
    254254
    255255AM_COND_IF([BUILD_RELEASE],
  • src/InitTweak/FixGlobalInit.cc

    r40a7d9c r91788fa  
    7474        std::string ret = name.substr( 0, name.find( '.' ) );
    7575        // replace invalid characters with _
    76                 static std::string invalid = "/-";
     76                static std::string invalid = "/-@";
    7777        replace_if( ret.begin(), ret.end(), []( char c ) { return invalid.find(c) != std::string::npos; }, '_' );
    7878        return ret;
  • src/Makefile.am

    r40a7d9c r91788fa  
    4444driver_cfa_cpp_SOURCES = ${SRC}
    4545driver_cfa_cpp_LDADD = -ldl                     # yywrap
    46 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14
     46driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I${abs_top_srcdir}/src/Parser -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14
    4747driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic
    4848
  • src/Makefile.in

    r40a7d9c r91788fa  
    327327    *) (install-info --version) >/dev/null 2>&1;; \
    328328  esac
    329 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
     329am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
     330        $(LISP)config.h.in
    330331# Read a list of newline-separated strings from the standard input,
    331332# and print each of them once, without duplicates.  Input order is
     
    541542driver_cfa_cpp_SOURCES = ${SRC}
    542543driver_cfa_cpp_LDADD = -ldl                     # yywrap
    543 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14
     544driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I${abs_top_srcdir}/src/Parser -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14
    544545driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic
    545546all: $(BUILT_SOURCES)
  • src/config.h.in

    r40a7d9c r91788fa  
    1 /* config.h.in.  Generated from configure.ac by autoheader.  */
     1/* src/config.h.in.  Generated from configure.ac by autoheader.  */
    22
    33/* Location of include files. */
  • src/driver/Makefile.am

    r40a7d9c r91788fa  
    2828endif
    2929
     30# don't install cfa directly
    3031noinst_PROGRAMS = cfa
    31 cfa_SOURCES = cfa.cc
    3232
     33# use
    3334install-exec-hook:
    3435        @test -z "$(CFA_BINDIR)" || $(MKDIR_P) "$(CFA_BINDIR)"
     
    4041        cd "$(CFA_BINDIR)" && rm -f $(CFA_NAME)
    4142
     43cfa_SOURCES = cfa.cc
     44
    4245# put into lib for now
    4346cc1libdir = ${CFA_LIBDIR}
  • src/driver/Makefile.in

    r40a7d9c r91788fa  
    626626
    627627
     628# use
    628629install-exec-hook:
    629630        @test -z "$(CFA_BINDIR)" || $(MKDIR_P) "$(CFA_BINDIR)"
  • src/libcfa/Makefile.am

    r40a7d9c r91788fa  
    3636         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -Wall -O0 -c -o $@ $<
    3737
    38 EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@
     38EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@ $(DEFAULT_INCLUDES)
    3939
    4040AM_CCASFLAGS = @CFA_FLAGS@
     
    4343#use -no-include-stdhdr to prevent rebuild cycles
    4444#The built sources must not depend on the installed headers
    45 CFLAGS = -quiet -no-include-stdhdr -I${abs_top_srcdir}/src/libcfa/stdhdr -XCFA -t -B${abs_top_srcdir}/src/driver ${EXTRA_FLAGS}
    46 CC = ${abs_top_srcdir}/src/driver/cfa
     45CFLAGS = -quiet -no-include-stdhdr -I${abs_top_srcdir}/src/libcfa/stdhdr -XCFA -t -B${abs_top_builddir}/src/driver ${EXTRA_FLAGS}
     46CC = ${abs_top_builddir}/src/driver/cfa
    4747
    4848headers = fstream iostream iterator limits rational time stdlib common \
     
    9292libcfa_d_a_CFLAGS = -debug -O0 #No need for __CFA_DEBUG__ since we pass -debug
    9393
    94 stdhdr = ${shell find stdhdr -type f -printf "%p "}
     94stdhdr = ${shell find ${srcdir}/stdhdr -type f -printf "%p "}
    9595
    9696cfa_includedir = $(CFA_INCDIR)
  • src/libcfa/Makefile.in

    r40a7d9c r91788fa  
    268268        containers/result containers/vector concurrency/coroutine \
    269269        concurrency/thread concurrency/kernel concurrency/monitor \
    270         concurrency/mutex ${shell find stdhdr -type f -printf "%p "} \
    271         math gmp time_t.h bits/align.h bits/containers.h bits/defs.h \
    272         bits/debug.h bits/locks.h concurrency/invoke.h
     270        concurrency/mutex ${shell find ${srcdir}/stdhdr -type f \
     271        -printf "%p "} math gmp time_t.h bits/align.h \
     272        bits/containers.h bits/defs.h bits/debug.h bits/locks.h \
     273        concurrency/invoke.h
    273274HEADERS = $(nobase_cfa_include_HEADERS)
    274275am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
     
    302303AWK = @AWK@
    303304BACKEND_CC = @BACKEND_CC@
    304 CC = ${abs_top_srcdir}/src/driver/cfa
     305CC = ${abs_top_builddir}/src/driver/cfa
    305306CCAS = @CCAS@
    306307CCASDEPMODE = @CCASDEPMODE@
     
    318319#use -no-include-stdhdr to prevent rebuild cycles
    319320#The built sources must not depend on the installed headers
    320 CFLAGS = -quiet -no-include-stdhdr -I${abs_top_srcdir}/src/libcfa/stdhdr -XCFA -t -B${abs_top_srcdir}/src/driver ${EXTRA_FLAGS}
     321CFLAGS = -quiet -no-include-stdhdr -I${abs_top_srcdir}/src/libcfa/stdhdr -XCFA -t -B${abs_top_builddir}/src/driver ${EXTRA_FLAGS}
    321322CPP = @CPP@
    322323CPPFLAGS = @CPPFLAGS@
     
    422423ARFLAGS = cr
    423424lib_LIBRARIES = $(am__append_1) $(am__append_2)
    424 EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@
     425EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@ $(DEFAULT_INCLUDES)
    425426AM_CCASFLAGS = @CFA_FLAGS@
    426427headers = fstream iostream iterator limits rational time stdlib common \
     
    435436libcfa_d_a_SOURCES = ${libsrc}
    436437libcfa_d_a_CFLAGS = -debug -O0 #No need for __CFA_DEBUG__ since we pass -debug
    437 stdhdr = ${shell find stdhdr -type f -printf "%p "}
     438stdhdr = ${shell find ${srcdir}/stdhdr -type f -printf "%p "}
    438439cfa_includedir = $(CFA_INCDIR)
    439440nobase_cfa_include_HEADERS = \
  • src/prelude/Makefile.am

    r40a7d9c r91788fa  
    2323noinst_DATA = ../libcfa/libcfa-prelude.c
    2424
    25 CC = ${abs_top_srcdir}/src/driver/cfa
     25CC = ${abs_top_builddir}/src/driver/cfa
    2626
    2727$(DEPDIR) :
     
    3232
    3333# create extra forward types/declarations to reduce inclusion of library files
    34 extras.cf : extras.regx extras.c
    35         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf
     34extras.cf : ${srcdir}/extras.regx ${srcdir}/extras.c
     35        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f ${srcdir}/extras.regx > extras.cf
    3636
    3737# create forward declarations for gcc builtins
    38 gcc-builtins.cf : gcc-builtins.c prototypes.sed
    39         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E -P $< | sed -r -f prototypes.sed > $@
     38gcc-builtins.cf : gcc-builtins.c ${srcdir}/prototypes.sed
     39        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -I${srcdir} -E -P $< | sed -r -f ${srcdir}/prototypes.sed > $@
    4040
    41 gcc-builtins.c : builtins.def prototypes.awk sync-builtins.cf
    42         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E prototypes.c | awk -f prototypes.awk > $@
     41gcc-builtins.c : ${srcdir}/builtins.def ${srcdir}/prototypes.awk ${srcdir}/sync-builtins.cf ${srcdir}/prototypes.c
     42        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -I${srcdir} -E ${srcdir}/prototypes.c | awk -f ${srcdir}/prototypes.awk > $@
    4343
    4444prelude.cf : prelude-gen.cc
     
    5858include $(DEPDIR)/builtins.Po
    5959
    60 ../libcfa/libcfa-prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_srcdir}/src/driver/cfa-cpp
    61         ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
     60../libcfa/libcfa-prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_builddir}/src/driver/cfa-cpp
     61        ${AM_V_GEN}${abs_top_builddir}/src/driver/cfa-cpp -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    6262
    63 bootloader.c : bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_srcdir}/src/driver/cfa-cpp
    64         ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpm bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
     63bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_builddir}/src/driver/cfa-cpp
     64        ${AM_V_GEN}${abs_top_builddir}/src/driver/cfa-cpp -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
    6565
    6666maintainer-clean-local :
  • src/prelude/Makefile.in

    r40a7d9c r91788fa  
    162162AWK = @AWK@
    163163BACKEND_CC = @BACKEND_CC@
    164 CC = ${abs_top_srcdir}/src/driver/cfa
     164CC = ${abs_top_builddir}/src/driver/cfa
    165165CCAS = @CCAS@
    166166CCASDEPMODE = @CCASDEPMODE@
     
    501501
    502502# create extra forward types/declarations to reduce inclusion of library files
    503 extras.cf : extras.regx extras.c
    504         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf
     503extras.cf : ${srcdir}/extras.regx ${srcdir}/extras.c
     504        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f ${srcdir}/extras.regx > extras.cf
    505505
    506506# create forward declarations for gcc builtins
    507 gcc-builtins.cf : gcc-builtins.c prototypes.sed
    508         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E -P $< | sed -r -f prototypes.sed > $@
    509 
    510 gcc-builtins.c : builtins.def prototypes.awk sync-builtins.cf
    511         ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E prototypes.c | awk -f prototypes.awk > $@
     507gcc-builtins.cf : gcc-builtins.c ${srcdir}/prototypes.sed
     508        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -I${srcdir} -E -P $< | sed -r -f ${srcdir}/prototypes.sed > $@
     509
     510gcc-builtins.c : ${srcdir}/builtins.def ${srcdir}/prototypes.awk ${srcdir}/sync-builtins.cf ${srcdir}/prototypes.c
     511        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -I${srcdir} -E ${srcdir}/prototypes.c | awk -f ${srcdir}/prototypes.awk > $@
    512512
    513513prelude.cf : prelude-gen.cc
     
    527527include $(DEPDIR)/builtins.Po
    528528
    529 ../libcfa/libcfa-prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_srcdir}/src/driver/cfa-cpp
    530         ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    531 
    532 bootloader.c : bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_srcdir}/src/driver/cfa-cpp
    533         ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpm bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
     529../libcfa/libcfa-prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_builddir}/src/driver/cfa-cpp
     530        ${AM_V_GEN}${abs_top_builddir}/src/driver/cfa-cpp -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
     531
     532bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf ${abs_top_builddir}/src/driver/cfa-cpp
     533        ${AM_V_GEN}${abs_top_builddir}/src/driver/cfa-cpp -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
    534534
    535535maintainer-clean-local :
  • src/tests/Makefile.am

    r40a7d9c r91788fa  
    1515###############################################################################
    1616
     17
    1718debug=yes
    1819
     
    2425concurrent='-Econcurrent'
    2526endif
     27
     28TEST_PY = python ${srcdir}/test.py
    2629
    2730# applies to both programs
     
    4144TEST_FLAGS = $(if $(test), 2> $(test), )
    4245AM_CFLAGS = ${TEST_FLAGS} ${BUILD_FLAGS}
    43 CC = @CFA_BINDIR@/@CFA_NAME@
     46CC = ${abs_top_builddir}/src/driver/cfa -DIN_DIR="${srcdir}/.in/"
    4447
    4548.PHONY : list
     
    5356
    5457all-local :
    55         @+python test.py --debug=${debug} ${concurrent} ${quick_test}
     58        @+${TEST_PY} --debug=${debug} ${concurrent} ${quick_test}
    5659
    5760all-tests :
    58         @+python test.py --all --debug=${debug} ${concurrent}           # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     61        @+${TEST_PY} --all --debug=${debug} ${concurrent}               # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    5962
    6063clean-local :
     
    6265
    6366list :
    64         @+python test.py --list ${concurrent}
     67        @+${TEST_PY} --list ${concurrent}
    6568
    6669concurrency :
    67         @+python test.py --debug=${debug} -Iconcurrent
     70        @+${TEST_PY} --debug=${debug} -Iconcurrent
    6871
    69 .dummy : .dummy.c @CFA_BINDIR@/@CFA_NAME@
    70         ${CC} ${BUILD_FLAGS} -XCFA -n ${<} -o ${@}                              #don't use CFLAGS, this rule is not a real test
    71 
    72 
    73 % : %.c @CFA_BINDIR@/@CFA_NAME@
    74         ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} -o ${@}
     72% : ${srcdir}/%.c @CFA_BINDIR@/@CFA_NAME@
     73        $(COMPILE) $(abspath ${<}) -o ${@}
    7574
    7675declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@
    77         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     76        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    7877
    7978gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@
    80         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     79        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    8180
    8281extension : extension.c @CFA_BINDIR@/@CFA_NAME@
    83         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     82        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    8483
    8584attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@
    86         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     85        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    8786
    8887functions: functions.c @CFA_BINDIR@/@CFA_NAME@
    89         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     88        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    9089
    9190KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@
    92         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     91        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    9392
    9493sched-ext-parse : sched-ext-parse.c @CFA_BINDIR@/@CFA_NAME@
    95         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     94        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    9695
    9796gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@
    98         ${CC} ${AM_CFLAGS} ${CFLAGS} -lgmp ${<} -o ${@}
     97        $(COMPILE) -lgmp $(abspath ${<}) -o ${@}
    9998
    10099completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@
    101         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     100        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    102101
    103102typedefRedef-ERR1: typedefRedef.c @CFA_BINDIR@/@CFA_NAME@
    104         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     103        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    105104
    106105alloc-ERROR: alloc.c @CFA_BINDIR@/@CFA_NAME@
    107         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     106        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    108107
    109108fallthrough-ERROR: fallthrough.c @CFA_BINDIR@/@CFA_NAME@
    110         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     109        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    111110
    112111nested-types-ERR1: nested-types.c @CFA_BINDIR@/@CFA_NAME@
    113         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     112        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    114113
    115114nested-types-ERR2: nested-types.c @CFA_BINDIR@/@CFA_NAME@
    116         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR2 ${<} -o ${@}
     115        $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
    117116
    118117# Constructor/destructor tests
    119118raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
    120         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     119        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    121120
    122121raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
    123         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR2 ${<} -o ${@}
     122        $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
    124123
    125124raii/memberCtors-ERR1: raii/memberCtors.c @CFA_BINDIR@/@CFA_NAME@
    126         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     125        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    127126
    128127raii/ctor-autogen-ERR1: raii/ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@
    129         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     128        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    130129
    131130# Warnings
    132131warnings/self-assignment: warnings/self-assignment.c @CFA_BINDIR@/@CFA_NAME@
    133         ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
     132        $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
    134133
    135134#builtins
    136135builtins/sync: builtins/sync.c @CFA_BINDIR@/@CFA_NAME@
    137         ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
     136        $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
  • src/tests/Makefile.in

    r40a7d9c r91788fa  
    103103mkinstalldirs = $(install_sh) -d
    104104CONFIG_HEADER = $(top_builddir)/config.h
    105 CONFIG_CLEAN_FILES =
     105CONFIG_CLEAN_FILES = config.py
    106106CONFIG_CLEAN_VPATH_FILES =
    107107am__dirstamp = $(am__leading_dot)dirstamp
     
    180180ETAGS = etags
    181181CTAGS = ctags
    182 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/automake/depcomp
     182am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.py.in \
     183        $(top_srcdir)/automake/depcomp
    183184DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    184185ACLOCAL = @ACLOCAL@
     
    191192AWK = @AWK@
    192193BACKEND_CC = @BACKEND_CC@
    193 CC = @CFA_BINDIR@/@CFA_NAME@
     194CC = ${abs_top_builddir}/src/driver/cfa -DIN_DIR="${srcdir}/.in/"
    194195CCAS = @CCAS@
    195196CCASDEPMODE = @CCASDEPMODE@
     
    306307@BUILD_CONCURRENCY_FALSE@concurrent = '-Econcurrent'
    307308@BUILD_CONCURRENCY_TRUE@concurrent =
     309TEST_PY = python ${srcdir}/test.py
    308310
    309311# applies to both programs
     
    350352        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
    351353$(am__aclocal_m4_deps):
     354config.py: $(top_builddir)/config.status $(srcdir)/config.py.in
     355        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
    352356avltree/$(am__dirstamp):
    353357        @$(MKDIR_P) avltree
     
    731735
    732736all-local :
    733         @+python test.py --debug=${debug} ${concurrent} ${quick_test}
     737        @+${TEST_PY} --debug=${debug} ${concurrent} ${quick_test}
    734738
    735739all-tests :
    736         @+python test.py --all --debug=${debug} ${concurrent}           # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     740        @+${TEST_PY} --all --debug=${debug} ${concurrent}               # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    737741
    738742clean-local :
     
    740744
    741745list :
    742         @+python test.py --list ${concurrent}
     746        @+${TEST_PY} --list ${concurrent}
    743747
    744748concurrency :
    745         @+python test.py --debug=${debug} -Iconcurrent
    746 
    747 .dummy : .dummy.c @CFA_BINDIR@/@CFA_NAME@
    748         ${CC} ${BUILD_FLAGS} -XCFA -n ${<} -o ${@}                              #don't use CFLAGS, this rule is not a real test
    749 
    750 % : %.c @CFA_BINDIR@/@CFA_NAME@
    751         ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} -o ${@}
     749        @+${TEST_PY} --debug=${debug} -Iconcurrent
     750
     751% : ${srcdir}/%.c @CFA_BINDIR@/@CFA_NAME@
     752        $(COMPILE) $(abspath ${<}) -o ${@}
    752753
    753754declarationSpecifier: declarationSpecifier.c @CFA_BINDIR@/@CFA_NAME@
    754         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     755        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    755756
    756757gccExtensions : gccExtensions.c @CFA_BINDIR@/@CFA_NAME@
    757         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     758        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    758759
    759760extension : extension.c @CFA_BINDIR@/@CFA_NAME@
    760         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     761        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    761762
    762763attributes : attributes.c @CFA_BINDIR@/@CFA_NAME@
    763         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     764        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    764765
    765766functions: functions.c @CFA_BINDIR@/@CFA_NAME@
    766         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     767        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    767768
    768769KRfunctions : KRfunctions.c @CFA_BINDIR@/@CFA_NAME@
    769         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     770        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    770771
    771772sched-ext-parse : sched-ext-parse.c @CFA_BINDIR@/@CFA_NAME@
    772         ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
     773        $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@}
    773774
    774775gmp : gmp.c @CFA_BINDIR@/@CFA_NAME@
    775         ${CC} ${AM_CFLAGS} ${CFLAGS} -lgmp ${<} -o ${@}
     776        $(COMPILE) -lgmp $(abspath ${<}) -o ${@}
    776777
    777778completeTypeError : completeTypeError.c @CFA_BINDIR@/@CFA_NAME@
    778         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     779        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    779780
    780781typedefRedef-ERR1: typedefRedef.c @CFA_BINDIR@/@CFA_NAME@
    781         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     782        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    782783
    783784alloc-ERROR: alloc.c @CFA_BINDIR@/@CFA_NAME@
    784         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     785        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    785786
    786787fallthrough-ERROR: fallthrough.c @CFA_BINDIR@/@CFA_NAME@
    787         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     788        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    788789
    789790nested-types-ERR1: nested-types.c @CFA_BINDIR@/@CFA_NAME@
    790         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     791        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    791792
    792793nested-types-ERR2: nested-types.c @CFA_BINDIR@/@CFA_NAME@
    793         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR2 ${<} -o ${@}
     794        $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
    794795
    795796# Constructor/destructor tests
    796797raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
    797         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     798        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    798799
    799800raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c @CFA_BINDIR@/@CFA_NAME@
    800         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR2 ${<} -o ${@}
     801        $(COMPILE) -DERR2 $(abspath ${<}) -o ${@}
    801802
    802803raii/memberCtors-ERR1: raii/memberCtors.c @CFA_BINDIR@/@CFA_NAME@
    803         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     804        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    804805
    805806raii/ctor-autogen-ERR1: raii/ctor-autogen.c @CFA_BINDIR@/@CFA_NAME@
    806         ${CC} ${AM_CFLAGS} ${CFLAGS} -DERR1 ${<} -o ${@}
     807        $(COMPILE) -DERR1 $(abspath ${<}) -o ${@}
    807808
    808809# Warnings
    809810warnings/self-assignment: warnings/self-assignment.c @CFA_BINDIR@/@CFA_NAME@
    810         ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
     811        $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
    811812
    812813#builtins
    813814builtins/sync: builtins/sync.c @CFA_BINDIR@/@CFA_NAME@
    814         ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
     815        $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only
    815816
    816817# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • src/tests/io2.c

    r40a7d9c r91788fa  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
    7 // io2.c -- 
    8 // 
     6//
     7// io2.c --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Mar  2 16:56:02 2016
     
    1212// Last Modified On : Thu May 24 21:17:41 2018
    1313// Update Count     : 103
    14 // 
     14//
    1515
    1616#include <fstream>
     17
     18 #define xstr(s) str(s)
     19#define str(s) #s
    1720
    1821int main() {
     
    3841        char s1[size], s2[size];
    3942
    40         ifstream in = { "io.data" };                                            // create / open file
     43        ifstream in = { xstr(IN_DIR) "io.data" };                                               // create / open file
    4144
    4245        sout | "input bacis types" | endl;
  • src/tests/pybin/settings.py

    r40a7d9c r91788fa  
     1from __future__ import print_function
     2
     3import os
    14import sys
     5
     6try :
     7        sys.path.append(os.getcwd())
     8        import config
     9
     10        SRCDIR = os.path.abspath(config.SRCDIR)
     11        BUILDDIR = os.path.abspath(config.BUILDDIR)
     12except:
     13        print('ERROR: missing config.py, re-run configure script.', file=sys.stderr)
     14        sys.exit(1)
    215
    316class Architecture:
     
    518                'x64'                   : 'x64',
    619                'x86-64'                : 'x64',
     20                'x86_64'                : 'x64',
    721                'x86'                   : 'x86',
    822                'i386'          : 'x86',
     
    2539                        self.cross_compile = False
    2640                        try:
    27                                 arch = machine_default()
     41                                arch = config.HOSTARCH
    2842                                self.target = Architecture.makeCanonical( arch )
    2943                        except KeyError:
     
    6680        arch       = Architecture(options.arch)
    6781
     82
    6883def updateMakeCmd(force, jobs):
    6984        global make
    7085
    7186        make = "make" if not force else ("make -j%i" % jobs)
    72 
    73 
    74 def set_machine_default( func ):
    75         global machine_default
    76 
    77         machine_default = func
  • src/tests/pybin/test_run.py

    r40a7d9c r91788fa  
    3333
    3434        def expect(self):
    35                 return ("%s/.expect/%s%s.txt" % (self.path, self.name, '' if not self.arch else ".%s" % self.arch))
     35                return ("%s.expect/%s%s.txt" % (os.path.join(settings.SRCDIR, self.path), self.name, '' if not self.arch else ".%s" % self.arch))
    3636
    3737        def error_log(self):
    38                 return ("%s/.err/%s.log"    % (self.path, self.name))
     38                return ("%s.err/%s.log"    % (os.path.join(settings.BUILDDIR, self.path), self.name))
    3939
    4040        def output_log(self):
    41                 return ("%s/.out/%s.log"    % (self.path, self.name))
     41                return ("%s.out/%s.log"    % (os.path.join(settings.BUILDDIR, self.path), self.name))
    4242
    4343        def input(self):
    44                 return ("%s/.in/%s.txt"     % (self.path, self.name))
     44                return ("%s.in/%s.txt"     % (os.path.join(settings.SRCDIR, self.path), self.name))
    4545
    4646        def target_output(self):
     
    4949        def target(self):
    5050                return os.path.join(self.path, self.name)
     51
     52        def target_executable(self):
     53                return os.path.join(settings.BUILDDIR, self.path, self.name)
    5154
    5255        @classmethod
  • src/tests/pybin/tools.py

    r40a7d9c r91788fa  
    99import stat
    1010import sys
     11import fileinput
    1112
    1213from pybin import settings
     
    3334                out, err = proc.communicate()
    3435                return proc.returncode, out
     36
     37def is_ascii(fname):
     38        if not os.path.isfile(fname):
     39                return False
     40
     41        code, out = sh("file %s" % fname, print2stdout = False)
     42        if code != 0:
     43                return False
     44
     45        match = re.search(".*: (.*)", out)
     46
     47        if not match:
     48                return False
     49
     50        return match.group(1) == "ASCII text"
    3551
    3652# Remove 1 or more files silently
     
    105121# helper function to replace patterns in a file
    106122def file_replace(fname, pat, s_after):
    107     # first, see if the pattern is even in the file.
    108     with open(fname) as f:
    109         if not any(re.search(pat, line) for line in f):
    110             return # pattern does not occur in file so we are done.
    111 
    112     # pattern is in the file, so perform replace operation.
    113     with open(fname) as f:
    114         out_fname = fname + ".tmp"
    115         out = open(out_fname, "w")
    116         for line in f:
    117             out.write(re.sub(pat, s_after, line))
    118         out.close()
    119         os.rename(out_fname, fname)
     123        file = fileinput.FileInput(fname, inplace=True, backup='.bak')
     124        for line in file:
     125                print(line.replace(pat, s_after), end='')
     126        file.close()
    120127
    121128# helper function to check if a files contains only a specific string
     
    140147# transform path to canonical form
    141148def canonicalPath(path):
    142         return os.path.join('.', os.path.normpath(path) )
     149        abspath = os.path.abspath(__main__.__file__)
     150        dname = os.path.dirname(abspath)
     151        return os.path.join(dname, os.path.normpath(path) )
    143152
    144153# compare path even if form is different
     
    151160                for name in names:
    152161                        path = os.path.join(dirname, name)
    153 
    154162                        op( path )
    155163
    156164        # Start the walk
    157         os.path.walk('.', step, '')
     165        abspath = os.path.abspath(__main__.__file__)
     166        dname = os.path.dirname(abspath)
     167        os.path.walk(dname, step, '')
    158168
    159169################################################################################
    160170#               system
    161171################################################################################
    162 
    163 # parses the Makefile to find the machine type (32-bit / 64-bit)
    164 def getMachineType():
    165         sh('echo "void ?{}(int&a,int b){}int main(){return 0;}" > .dummy.c')
    166         ret, out = make('.dummy', silent = True)
    167 
    168         if ret != 0:
    169                 print("Failed to identify architecture:")
    170                 print(out)
    171                 print("Stopping")
    172                 rm( (".dummy.c",".dummy") )
    173                 sys.exit(1)
    174 
    175         _, out = sh("file .dummy", print2stdout=False)
    176         rm( (".dummy.c",".dummy") )
    177 
    178         if settings.dry_run :
    179                 return 'x64'
    180 
    181         return re.search(r"[^,]+,([^,]+),", out).group(1).strip()
    182 
    183172# count number of jobs to create
    184173def jobCount( options, tests ):
     
    244233        else:
    245234                print(text)
    246 
    247 settings.set_machine_default( getMachineType )
  • src/tests/test.py

    r40a7d9c r91788fa  
    1919
    2020        def matchTest(path):
    21                 match = re.search("(\.[\w\/\-_]*)\/.expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt", path)
     21                match = re.search("%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt" % settings.SRCDIR, path)
    2222                if match :
    2323                        test = Test()
     
    116116#               running test functions
    117117################################################################################
     118# fix the absolute paths in the output
     119def fixoutput( fname ):
     120        if not is_ascii(fname):
     121                return
     122
     123        file_replace(fname, "%s/" % settings.SRCDIR, "")
     124
     125
    118126# logic to run a single test and return the result (No handling of printing or other test framework logic)
    119127def run_single_test(test):
    120128
    121129        # find the output file based on the test name and options flag
     130        exe_file = test.target_executable();
    122131        out_file = test.target_output()
    123132        err_file = test.error_log()
     
    129138
    130139        # remove any outputs from the previous tests to prevent side effects
    131         rm( (out_file, err_file, test.target()) )
     140        rm( (out_file, err_file, exe_file) )
    132141
    133142        # build, skipping to next test on error
     
    146155        if make_ret == 0 or settings.dry_run:
    147156                before = time.time()
    148                 if settings.dry_run or fileIsExecutable(test.target()) :
     157                if settings.dry_run or fileIsExecutable(exe_file) :
    149158                        # run test
    150                         retcode, _ = sh("timeout 60 %s > %s 2>&1" % (test.target(), out_file), input = in_file)
     159                        retcode, _ = sh("timeout 60 %s > %s 2>&1" % (exe_file, out_file), input = in_file)
    151160                else :
    152161                        # simply cat the result into the output
    153                         retcode, _ = sh("cat %s > %s" % (test.target(), out_file))
     162                        retcode, _ = sh("cat %s > %s" % (exe_file, out_file))
    154163
    155164                after = time.time()
     
    170179                else :
    171180                        # fetch return code and error from the diff command
     181                        fixoutput(out_file)
    172182                        retcode, error = diff(cmp_file, out_file)
    173183
     
    241251################################################################################
    242252if __name__ == "__main__":
    243         #always run from same folder
    244         chdir()
    245253
    246254        # parse the command line arguments
Note: See TracChangeset for help on using the changeset viewer.