Changes in / [3e3f236:6a45bd78]


Ignore:
Files:
4 added
10 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/Distribute

    r3e3f236 r6a45bd78  
    1515        SrcDir    = pwd tmp: false
    1616        Settings  = null
    17         Version   = ''
    1817
    1918        // Local variables
     
    2322        currentBuild.result = "SUCCESS"
    2423
    25         //Wrap build to add timestamp to command line
    26         wrap([$class: 'TimestamperBuildWrapper']) {
     24        try {
     25                //Wrap build to add timestamp to command line
     26                wrap([$class: 'TimestamperBuildWrapper']) {
    2727
    28                 final commit, build
    29                 (commit, build) = prepare_build()
     28                        final commit = prepare_build()
    3029
    31                 node('x64') {
     30                        node('x64') {
     31                                BuildDir  = pwd tmp: true
     32                                SrcDir    = pwd tmp: false
     33
     34                                Tools.Clean()
     35
     36                                Tools.Checkout( commit )
     37                        }
     38
     39                        // Update the build directories when exiting the node
    3240                        BuildDir  = pwd tmp: true
    3341                        SrcDir    = pwd tmp: false
    34 
    35                         Tools.Clean()
    36 
    37                         Tools.Checkout( commit )
    38 
    39                         Version = GetVersion( build )
    40 
    41                         Configure()
    42 
    43                         Package()
    44 
    45                         Test()
    46 
    47                         Archive()
    4842                }
    49 
    50                 // Update the build directories when exiting the node
    51                 BuildDir  = pwd tmp: true
    52                 SrcDir    = pwd tmp: false
    5343        }
    5444
     45        //If an exception is caught we need to change the status and remember to
     46        //attach the build log to the email
     47        // catch (Exception caughtError) {
     48                // //rethrow error later
     49                // err = caughtError
     50
     51                // echo err.toString()
     52
     53                // //An error has occured, the build log is relevent
     54                // log_needed = true
     55
     56                // //Store the result of the build log
     57                // currentBuild.result = "${StageName} FAILURE".trim()
     58        // }
     59
     60        finally {
     61                // //Send email with final results if this is not a full build
     62                // email(log_needed)
     63
     64                // echo 'Distribution Completed'
     65
     66                // /* Must re-throw exception to propagate error */
     67                // if (err) {
     68                //      throw err
     69                // }
     70        }
    5571}
    5672
     
    5874// Main compilation routines
    5975//===========================================================================================================
    60 def GetVersion(build) {
    61         final pver = sh(
    62                 returnStdout: true,
    63                 script: "sed 's/AC_INIT(\\[cfa-cc\\],\\[\\(.*\\)\\],\\[cforall@plg.uwaterloo.ca\\])/\\1/;t;d' ${SrcDir}/configure.ac"
    64         ).trim()
    6576
    66         final version = "${pver}.${build}"
    6777
    68         echo "Package Version: ${pver}"
    69         echo "Build   Version: ${build}"
    70         echo "Long    Version: ${version}"
     78//Compilation script is done here but environnement set-up and error handling is done in main loop
     79// def checkout() {
     80//      build_stage('Checkout', true) {
     81//              //checkout the source code and clean the repo
     82//              final scmVars = checkout scm
     83//              Settings.GitNewRef = scmVars.GIT_COMMIT
     84//              Settings.GitOldRef = scmVars.GIT_PREVIOUS_COMMIT
    7185
    72         return version
    73 }
    74 
    75 def Configure() {
    76         Tools.BuildStage('Configure', true) {
    77                 // Configure must be run inside the tree
    78                 dir (SrcDir) {
    79                         // Generate the necessary build files
    80                         sh './autogen.sh'
    81                 }
    82 
    83                 // Build outside of the src tree to ease cleaning
    84                 dir (BuildDir) {
    85                         // Configure the compilation (Output is not relevant)
    86                         // Use the current directory as the installation target so nothing escapes the sandbox
    87                         // Also specify the compiler by hand
    88                         sh "${SrcDir}/configure CXX=g++-9 CC=gcc-9 AR=gcc-ar RANLIB=gcc-ranlib --quiet"
    89 
    90                         // Configure libcfa
    91                         sh 'make -j 8 --no-print-directory configure-libcfa'
    92                 }
    93         }
    94 }
    95 
    96 def Package() {
    97         Tools.BuildStage('Package', true) {
    98                 dir (BuildDir) {
    99                         sh "make VERSION=${Version} dist"
    100                 }
    101         }
    102 }
    103 
    104 def Test() {
    105         Tools.BuildStage('Test', true) {
    106                 dir (BuildDir) {
    107                         sh "make VERSION=${Version} distcheck -j 8"
    108                 }
    109         }
    110 }
    111 
    112 def Archive() {
    113         Tools.BuildStage('Archive', true) {
    114                 dir (BuildDir) {
    115                         archiveArtifacts artifacts: "cfa-cc-*.tar.gz", fingerprint: true
    116                 }
    117         }
    118 }
    119 
     86//              echo GitLogMessage()
     87//      }
     88// }
    12089
    12190//===========================================================================================================
     
    138107                                        defaultValue: '',                                                               \
    139108                                ],                                                                                              \
    140                                 [$class: 'StringParameterDefinition',                                           \
    141                                         description: 'Build Number to put into the version',                    \
    142                                         name: 'Build',                                                                  \
    143                                         defaultValue: '0',                                                              \
    144                                 ],                                                                                              \
    145109                        ],
    146110                ]])
     
    157121        echo "Distributing git commit ${ref}"
    158122
    159         return [params.GitRef, params.Build]
     123        return params.GitRef
    160124}
    161125
  • Jenkins/FullBuild

    r3e3f236 r6a45bd78  
    2626                                        gcc_5_x64_old: { trigger_build( 'gcc-5',   'x64', false ) },
    2727                                        clang_x64_old: { trigger_build( 'clang',   'x64', false ) },
    28                                         clang_x64_new: { trigger_build( 'clang',   'x64', true  ) },
     28                                        // clang_x64_new: { trigger_build( 'clang',   'x64', true  ) },
    2929                                )
    30                         }
    31 
    32                         stage('Package') {
    33                                 build job: 'Cforall_Distribute_Ref', parameters: [string(name: 'GitRef', value: gitRefNewValue), string(name: 'Build', value: currentBuild.number)]
    3430                        }
    3531                }
  • Jenkins/tools.groovy

    r3e3f236 r6a45bd78  
    6868PrevGitNewRef = ''
    6969def GitLogMessage(String oldRef = '', String newRef = '') {
    70         if (!oldRef) { if(!PrevGitOldRef) { return "\nERROR retrieveing current git information!\n"  } else { oldRef = PrevGitOldRef } }
    71         if (!newRef) { if(!PrevGitNewRef) { return "\nERROR retrieveing previous git information!\n" } else { newRef = PrevGitNewRef } }
     70        if (!oldRef) { if(!PrevGitOldRef) { return "\nERROR retrieveing current git information!\n"  } else { PreGitOldRef = oldRef } }
     71        if (!newRef) { if(!PrevGitNewRef) { return "\nERROR retrieveing previous git information!\n" } else { PreGitNewRef = newRef } }
     72
     73        PrevGitOldRef = oldRef
     74        PrevGitNewRef = newRef
    7275
    7376        def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim()
  • Jenkinsfile

    r3e3f236 r6a45bd78  
    9393                // Build outside of the src tree to ease cleaning
    9494                dir (BuildDir) {
    95                         //Configure the compilation (Output is not relevant)
     95                        //Configure the conpilation (Output is not relevant)
    9696                        //Use the current directory as the installation target so nothing escapes the sandbox
    9797                        //Also specify the compiler by hand
  • Makefile.am

    r3e3f236 r6a45bd78  
    1919
    2020MAINTAINERCLEANFILES = lib/* bin/* tests/.deps/* tests/.out/* # order important
    21 DISTCLEANFILES = version
    2221
    2322SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@
    24 DIST_SUBDIRS = driver src . libcfa tests
     23DIST_SUBDIRS = driver src . libcfa benchmark longrun_tests tests tools tools/prettyprinter
    2524
    2625@LIBCFA_TARGET_MAKEFILES@ : Makefile $(srcdir)/libcfa/configure
     
    3534man1_MANS = doc/man/cfa.1
    3635
    37 EXTRA_DIST = LICENSE doc/man/cfa.1 libcfa/configure libcfa/Makefile.dist.am libcfa/Makefile.dist.in tools/build/distcc_hash tools/build/push2dist.sh
     36EXTRA_DIST = LICENSE doc/man/cfa.1 libcfa/configure libcfa/Makefile.dist.am libcfa/Makefile.dist.in
    3837
    3938debug=yes
     
    5150        @./config.status --config | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g"
    5251        @find libcfa -name config.status -printf "\n%h\n\t" -exec {} --config \; | sed "s/ /\n\t/g; s/\t'/\t/g; s/'\n/\n/g; s/^'//g; s/'$$//g"
    53 
    54 mostlyclean-local: @LIBCFA_TARGET_MAKEFILES@
    55         for dir in @LIBCFA_TARGET_DIRS@; do \
    56                 $(MAKE) -C $${dir} mostlyclean; \
    57         done
    58 
    59 clean-local: @LIBCFA_TARGET_MAKEFILES@
    60         for dir in @LIBCFA_TARGET_DIRS@; do \
    61                 $(MAKE) -C $${dir} clean; \
    62         done
    63 
    64 distclean-local: @LIBCFA_TARGET_MAKEFILES@
    65         for dir in @LIBCFA_TARGET_DIRS@; do \
    66                 $(MAKE) -C $${dir} distclean; \
    67                 rm $${dir}/config.data; \
    68         done
  • configure.ac

    r3e3f236 r6a45bd78  
    33
    44AC_PREREQ([2.68])
    5 AC_INIT([cfa-cc],[1.0.0],[cforall@plg.uwaterloo.ca])
     5AC_INIT([cfa-cc],[1.0.0.0],[cforall@plg.uwaterloo.ca])
    66AC_CONFIG_AUX_DIR([automake])
    77AC_CONFIG_MACRO_DIRS([automake])
     
    2828# New AST toggling support
    2929AH_TEMPLATE([CFA_USE_NEW_AST],[Sets whether or not to use the new-ast, this is adefault value and can be overrided by --old-ast and --new-ast])
    30 DEFAULT_NEW_AST="True"
     30DEFAULT_NEW_AST="False"
    3131AC_ARG_ENABLE(new-ast,
    3232        [  --enable-new-ast     whether or not to use new ast as the default AST algorithm],
     
    3535                no)  newast=false; DEFAULT_NEW_AST="False" ;;
    3636                *) AC_MSG_ERROR([bad value ${enableval} for --enable-new-ast]) ;;
    37         esac],[newast=true])
     37        esac],[newast=false])
    3838AC_DEFINE_UNQUOTED([CFA_USE_NEW_AST], $newast)
    3939AC_SUBST(DEFAULT_NEW_AST)
     
    103103# Create variables for commonly used targets
    104104
    105 TOP_SRCDIR="$(readlink -e $ac_abs_confdir/)/"
    106 TOP_BUILDDIR="$(readlink -e $ac_pwd/)/"
     105TOP_SRCDIR="$(readlink -m $ac_confdir/)/"
     106TOP_BUILDDIR="$(readlink -m $ac_pwd/)/"
    107107
    108108AC_DEFINE_UNQUOTED(TOP_SRCDIR, "$TOP_SRCDIR", [Top src directory])
     
    139139                \'--enable-gprofiler=*) ;;
    140140                \'--disable-gprofiler) ;;
    141 
    142                 # skip the target hosts
    143                 \'--enable-new-ast=*) ;;
    144                 \'--disable-new-ast) ;;
    145141
    146142                # skip this, it only causes problems
     
    291287        libcfa/Makefile:libcfa/Makefile.dist.in
    292288        tests/Makefile
     289        longrun_tests/Makefile
     290        benchmark/Makefile
     291        benchmark/io/http/Makefile
     292        tools/Makefile
     293        tools/prettyprinter/Makefile
    293294        ])
    294 
    295 # Some of our makefile don't need to be distributed
    296 AM_CONDITIONAL([CFORALL_DISTRIBUTE], [test -e $TOP_SRCDIR/autogen.sh])
    297 AM_COND_IF([CFORALL_DISTRIBUTE],
    298         [AC_CONFIG_FILES([
    299                 longrun_tests/Makefile
    300                 benchmark/Makefile
    301                 benchmark/io/http/Makefile
    302                 tools/Makefile
    303                 tools/prettyprinter/Makefile
    304                 ])])
    305295
    306296AC_CONFIG_LINKS([tests/test.py:tests/test.py])
  • driver/Makefile.am

    r3e3f236 r6a45bd78  
    2828        @test -z "$(CFA_BINDIR)" || $(MKDIR_P) "$(CFA_BINDIR)"
    2929        @echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) cfa '$(CFA_BINDIR)/$(CFA_NAME)'"; \
    30         chmod u+w $(CFA_BINDIR);\
    3130        $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) cfa $(CFA_BINDIR)/$(CFA_NAME) || exit $$?
    3231
  • libcfa/configure.ac

    r3e3f236 r6a45bd78  
    33
    44AC_PREREQ([2.68])
    5 AC_INIT([cfa-cc],[1.0.0],[cforall@plg.uwaterloo.ca])
     5AC_INIT([cfa-cc],[1.0.0.0],[cforall@plg.uwaterloo.ca])
    66AC_CONFIG_AUX_DIR([automake])
    77AC_CONFIG_MACRO_DIRS([automake])
  • libcfa/prelude/Makefile.am

    r3e3f236 r6a45bd78  
    7070
    7171MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cfa
    72 DISTCLEANFILES = $(DEPDIR)/builtins.Po
    7372MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
    7473
  • libcfa/src/Makefile.am

    r3e3f236 r6a45bd78  
    1111## Created On       : Sun May 31 08:54:01 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Wed Dec  9 22:46:14 2020
    14 ## Update Count     : 250
     13## Last Modified On : Mon Jun  1 13:35:33 2020
     14## Update Count     : 248
    1515###############################################################################
    1616
     
    4343        clock.hfa \
    4444        exception.hfa \
    45         exception.h \
    4645        gmp.hfa \
    4746        math.hfa \
     
    5251        bits/defs.hfa \
    5352        bits/locks.hfa \
    54         bits/collection.hfa \
    55         bits/stack.hfa \
    56         bits/queue.hfa \
    57         bits/sequence.hfa \
    5853        concurrency/iofwd.hfa \
    5954        containers/list.hfa \
     
    8277        bits/debug.cfa \
    8378        exception.c \
     79        exception.h \
    8480        interpose.cfa \
    8581        lsda.h \
     
    199195        -rm -rf ${CFA_INCDIR} ${CFA_LIBDIR}
    200196
    201 distclean-local:
    202         find ${builddir} -path '*.Plo' -delete
    203 
    204197
    205198# $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
  • libcfa/src/bits/collection.hfa

    r3e3f236 r6a45bd78  
    77
    88inline {
    9         // PUBLIC
    10 
    119        void ?{}( Colable & co ) with( co ) {
    1210                next = 0p;
     
    1816        }
    1917
    20         Colable & getNext( Colable & co ) with( co ) {
    21                 return *next;
     18        Colable * getNext( Colable & co ) with( co ) {
     19                return next;
    2220        }
    23 
    24         // PRIVATE
    2521
    2622        Colable *& Next( Colable * cp ) {
     
    2824        }
    2925
    30         // wrappers to make Collection have T
    3126        forall( dtype T ) {
    3227                T *& Next( T * n ) {
  • libcfa/src/bits/queue.hfa

    r3e3f236 r6a45bd78  
    11#pragma once
    22
    3 #include "bits/collection.hfa"
     3#include "collection.hfa"
    44
    55forall( dtype T ) {
     
    2828
    2929                T * succ( Queue(T) & q, T * n ) with( q ) {             // pre: *n in *q
    30                         #ifdef __CFA_DEBUG__
     30#ifdef __CFA_DEBUG__
    3131                        if ( ! listed( n ) ) abort( "(Queue &)%p.succ( %p ) : Node is not on a list.", &q, n );
    32                         #endif // __CFA_DEBUG__
     32#endif // __CFA_DEBUG__
    3333                        return (Next( n ) == n) ? 0p : Next( n );
    3434                } // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *q
    3535
    3636                void addHead( Queue(T) & q, T & n ) with( q ) {
    37                         #ifdef __CFA_DEBUG__
     37#ifdef __CFA_DEBUG__
    3838                        if ( listed( &n ) ) abort( "(Queue &)%p.addHead( %p ) : Node is already on another list.", &q, &n );
    39                         #endif // __CFA_DEBUG__
     39#endif // __CFA_DEBUG__
    4040                        if ( last ) {
    4141                                Next( &n ) = &head( q );
     
    4343                        } else {
    4444                                root = last = &n;
    45                                 Next( &n ) = &n;                                                // last node points to itself
     45                                Next( &n ) = &n;                                                        // last node points to itself
    4646                        }
    4747                }
    4848
    4949                void addTail( Queue(T) & q, T & n ) with( q ) {
    50                         #ifdef __CFA_DEBUG__
     50#ifdef __CFA_DEBUG__
    5151                        if ( listed( &n ) ) abort( "(Queue &)%p.addTail( %p ) : Node is already on another list.", &q, &n );
    52                         #endif // __CFA_DEBUG__
     52#endif // __CFA_DEBUG__
    5353                        if ( last ) Next( last ) = &n;
    5454                        else root = &n;
    5555                        last = &n;
    56                         Next( &n ) = &n;                                                        // last node points to itself
     56                        Next( &n ) = &n;                                                                // last node points to itself
    5757                }
    5858
     
    7878
    7979                void remove( Queue(T) & q, T & n ) with( q ) {  // O(n)
    80                         #ifdef __CFA_DEBUG__
     80#ifdef __CFA_DEBUG__
    8181                        if ( ! listed( (Colable &)n ) ) abort( "(Queue &)%p.remove( %p ) : Node is not on a list.", &q, &n );
    82                         #endif // __CFA_DEBUG__
     82#endif // __CFA_DEBUG__
    8383                        T * prev = 0p;
    8484                        T * curr = (T *)root;
     
    9696                                        break;
    9797                                }
     98#ifdef __CFA_DEBUG__
    9899                                // not found => error
    99                                 #ifdef __CFA_DEBUG__
    100                                 if ( curr == last ) abort( "(Queue &)%p.remove( %p ) : Node is not in list.", &q, &n );
    101                                 #endif // __CFA_DEBUG__
     100                                if (curr == last) abort( "(Queue &)%p.remove( %p ) : Node is not in list.", &q, &n );
     101#endif // __CFA_DEBUG__
    102102                                prev = curr;
    103103                                curr = Next( curr );
     
    125125                // Node "n" must be in the "from" list.
    126126                void split( Queue(T) & q, Queue(T) & from, T & n ) with( q ) {
    127                         #ifdef __CFA_DEBUG__
     127#ifdef __CFA_DEBUG__
    128128                        if ( ! listed( (Colable &)n ) ) abort( "(Queue &)%p.split( %p ) : Node is not on a list.", &q, &n );
    129                         #endif // __CFA_DEBUG__
     129#endif // __CFA_DEBUG__
    130130                        Queue(T) to;
    131131                        to.root = from.root;                                            // start of "to" list
     
    177177        } // distribution
    178178} // distribution
     179
     180// Local Variables: //
     181// compile-command: "cfa queue.cfa" //
     182// End: //
  • libcfa/src/bits/sequence.hfa

    r3e3f236 r6a45bd78  
    11#pragma once
    22
    3 #include "bits/collection.hfa"
     3#include "collection.hfa"
    44
    55struct Seqable {
     
    99
    1010inline {
    11         // PUBLIC
    12 
    1311        void ?{}( Seqable & sq ) with( sq ) {
    14                 ((Colable &)sq){};
     12                ((Colable &) sq){};
    1513                back = 0p;
    1614        } // post: ! listed()
     
    2018        }
    2119
    22         // PRIVATE
    23 
    2420        Seqable *& Back( Seqable * sq ) {
    2521                return sq->back;
    2622        }
    27 
    28         // wrappers to make Collection have T
    29         forall( dtype T ) {
    30                 T *& Back( T * n ) {
    31                         return (T *)Back( (Seqable *)n );
    32                 }
    33         } // distribution
    3423} // distribution
    3524
     
    4534                } // post: empty() & head() == 0 | !empty() & head() in *s
    4635
     36                T *& Back( T * n ) {
     37                        return (T *)Back( (Seqable *)n );
     38                }
     39
    4740                void ?{}( Sequence(T) &, const Sequence(T) & ) = void; // no copy
    4841                Sequence(T) & ?=?( const Sequence(T) & ) = void; // no assignment
    4942
    5043                void ?{}( Sequence(T) & s ) with( s ) {
    51                         ((Collection &)s){};
     44                        ((Collection &) s){};
    5245                }       // post: isEmpty().
    5346
     
    5750                }       // post: empty() & tail() == 0 | !empty() & tail() in *s
    5851
    59                 // Return a pointer to the element after *n, or 0p if list empty.
     52                // Return a pointer to the element after *n, or 0p if there isn't one.
    6053                T * succ( Sequence(T) & s, T * n ) with( s ) {  // pre: *n in *s
    61                         #ifdef __CFA_DEBUG__
     54#ifdef __CFA_DEBUG__
    6255                        if ( ! listed( n ) ) abort( "(Sequence &)%p.succ( %p ) : Node is not on a list.", &s, n );
    63                         #endif // __CFA_DEBUG__
     56#endif // __CFA_DEBUG__
    6457                        return Next( n ) == &head( s ) ? 0p : Next( n );
    6558                } // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *s
     
    6760                // Return a pointer to the element before *n, or 0p if there isn't one.
    6861                T * pred( Sequence(T) & s, T * n ) with( s ) {  // pre: *n in *s
    69                         #ifdef __CFA_DEBUG__
     62#ifdef __CFA_DEBUG__
    7063                        if ( ! listed( n ) ) abort( "(Sequence &)%p.pred( %p ) : Node is not on a list.", &s, n );
    71                         #endif // __CFA_DEBUG__
     64#endif // __CFA_DEBUG__
    7265                        return n == &head( s ) ? 0p : Back( n );
    7366                }       // post: n == head() & head(n) == 0 | n != head() & *pred(n) in *s
     
    7669                // Insert *n into the sequence before *bef, or at the end if bef == 0.
    7770                void insertBef( Sequence(T) & s, T & n, T & bef ) with( s ) { // pre: !n->listed() & *bef in *s
    78                         #ifdef __CFA_DEBUG__
     71#ifdef __CFA_DEBUG__
    7972                        if ( listed( &n ) ) abort( "(Sequence &)%p.insertBef( %p, %p ) : Node is already on another list.", &s, n, &bef );
    80                         #endif // __CFA_DEBUG__
     73#endif // __CFA_DEBUG__
    8174                        if ( &bef == &head( s ) ) {                                     // must change root
    8275                                if ( root ) {
     
    108101                // Insert *n into the sequence after *aft, or at the beginning if aft == 0.
    109102                void insertAft( Sequence(T) & s, T & aft, T & n ) with( s ) {   // pre: !n->listed() & *aft in *s
    110                         #ifdef __CFA_DEBUG__
     103#ifdef __CFA_DEBUG__
    111104                        if ( listed( &n ) ) abort( "(Sequence &)%p.insertAft( %p, %p ) : Node is already on another list.", &s, &aft, &n );
    112                         #endif // __CFA_DEBUG__
     105#endif // __CFA_DEBUG__
    113106                        if ( ! &aft ) {                                                         // must change root
    114107                                if ( root ) {
     
    137130                // pre: n->listed() & *n in *s
    138131                void remove( Sequence(T) & s, T & n ) with( s ) { // O(1)
    139                         #ifdef __CFA_DEBUG__
     132#ifdef __CFA_DEBUG__
    140133                        if ( ! listed( &n ) ) abort( "(Sequence &)%p.remove( %p ) : Node is not on a list.", &s, &n );
    141                         #endif // __CFA_DEBUG__
     134#endif // __CFA_DEBUG__
    142135                        if ( &n == &head( s ) ) {
    143136                                if ( Next( &head( s ) ) == &head( s ) ) root = 0p;
     
    195188                // Node "n" must be in the "from" list.
    196189                void split( Sequence(T) & s, Sequence(T) & from, T & n ) with( s ) {
    197                         #ifdef __CFA_DEBUG__
     190#ifdef __CFA_DEBUG__
    198191                        if ( ! listed( &n ) ) abort( "(Sequence &)%p.split( %p ) : Node is not on a list.", &s, &n );
    199                         #endif // __CFA_DEBUG__
     192#endif // __CFA_DEBUG__
    200193                        Sequence(T) to;
    201194                        to.root = from.root;                                            // start of "to" list
     
    206199                                Back( &head( from ) ) = Back( &head( to ) ); // fix "from" list
    207200                                Next( Back( &head( to ) ) ) = &head( from );
    208                                 Next( &n ) = &head( to );                               // fix "to" list
     201                                Next( &n ) = &head( to );                                       // fix "to" list
    209202                                Back( &head( to ) ) = &n;
    210203                        } // if
     
    221214                // passing the sequence, traversing would require its length. Thus the iterator needs a pointer to the sequence
    222215                // to pass to succ/pred. Both stack and queue just encounter 0p since the lists are not circular.
    223                 Sequence(T) * seq;                                                              // FIX ME: cannot be reference
     216                Sequence(T) * seq;
    224217        };
    225218
     
    231224
    232225                void ?{}( SeqIter(T) & si, Sequence(T) & s ) with( si ) {
    233                         ((ColIter &)si){};
     226                        ((ColIter &) si){};
    234227                        seq = &s;
    235228                        curr = &head( s );
     
    237230
    238231                void ?{}( SeqIter(T) & si, Sequence(T) & s, T & start ) with( si ) {
    239                         ((ColIter &)si){};
     232                        ((ColIter &) si){};
    240233                        seq = &s;
    241234                        curr = &start;
     
    262255                inline ColIter;
    263256                // See above for explanation.
    264                 Sequence(T) * seq;                                                              // FIX ME: cannot be reference
     257                Sequence(T) * seq;
    265258        };
    266259
    267260        inline {
    268261                void ?{}( SeqIterRev(T) & si ) with( si ) {     
    269                         ((ColIter &)si){};
     262                        ((ColIter &) si){};
    270263                        seq = 0p;
    271264                } // post: elts = null.
    272265
    273266                void ?{}( SeqIterRev(T) & si, Sequence(T) & s ) with( si ) {   
    274                         ((ColIter &)si){};
     267                        ((ColIter &) si){};
    275268                        seq = &s;
    276269                        curr = &tail( s );
     
    278271
    279272                void ?{}( SeqIterRev(T) & si, Sequence(T) & s, T & start ) with( si ) {
    280                         ((ColIter &)si){};
     273                        ((ColIter &) si){};
    281274                        seq = &s;
    282275                        curr = &start;
     
    298291        } // distribution
    299292} // distribution
     293
     294// Local Variables: //
     295// compile-command: "cfa sequence.hfa" //
     296// End: //
  • libcfa/src/bits/stack.hfa

    r3e3f236 r6a45bd78  
    11#pragma once
    22
    3 #include "bits/collection.hfa"
     3#include "collection.hfa"
    44
    55forall( dtype T ) {
     
    2626
    2727                void addHead( Stack(T) & s, T & n ) with( s ) {
    28                         #ifdef __CFA_DEBUG__
     28#ifdef __CFA_DEBUG__
    2929                        if ( listed( (Colable &)(n) ) ) abort( "(Stack &)%p.addHead( %p ) : Node is already on another list.", &s, n );
    30                         #endif // __CFA_DEBUG__
     30#endif // __CFA_DEBUG__
    3131                        Next( &n ) = &head( s ) ? &head( s ) : &n;
    3232                        root = &n;
     
    4444                        T & t = head( s );
    4545                        if ( root ) {
    46                                 root = ( T *)Next( root );
     46                                root = ( T *)Next(root);
    4747                                if ( &head( s ) == &t ) root = 0p;              // only one element ?
    4848                                Next( &t ) = 0p;
     
    9292        } // distribution
    9393} // distribution
     94
     95// Local Variables: //
     96// compile-command: "make install" //
     97// End: //
  • libcfa/src/concurrency/coroutine.cfa

    r3e3f236 r6a45bd78  
    2828#include "kernel_private.hfa"
    2929#include "exception.hfa"
    30 #include "math.hfa"
    3130
    3231#define __CFA_INVOKE_PRIVATE__
     
    8887
    8988void __stack_prepare( __stack_info_t * this, size_t create_size );
    90 void __stack_clean  ( __stack_info_t * this );
    9189
    9290//-----------------------------------------------------------------------------
     
    109107        bool userStack = ((intptr_t)this.storage & 0x1) != 0;
    110108        if ( ! userStack && this.storage ) {
    111                 __stack_clean( &this );
    112                 // __attribute__((may_alias)) intptr_t * istorage = (intptr_t *)&this.storage;
    113                 // *istorage &= (intptr_t)-1;
    114 
    115                 // void * storage = this.storage->limit;
    116                 // __cfaabi_dbg_debug_do(
    117                 //      storage = (char*)(storage) - __page_size;
    118                 //      if ( mprotect( storage, __page_size, PROT_READ | PROT_WRITE ) == -1 ) {
    119                 //              abort( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) );
    120                 //      }
    121                 // );
    122                 // __cfaabi_dbg_print_safe("Kernel : Deleting stack %p\n", storage);
    123                 // free( storage );
     109                __attribute__((may_alias)) intptr_t * istorage = (intptr_t *)&this.storage;
     110                *istorage &= (intptr_t)-1;
     111
     112                void * storage = this.storage->limit;
     113                __cfaabi_dbg_debug_do(
     114                        storage = (char*)(storage) - __page_size;
     115                        if ( mprotect( storage, __page_size, PROT_READ | PROT_WRITE ) == -1 ) {
     116                                abort( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) );
     117                        }
     118                );
     119                __cfaabi_dbg_print_safe("Kernel : Deleting stack %p\n", storage);
     120                free( storage );
    124121        }
    125122}
     
    170167        assert(__page_size != 0l);
    171168        size_t size = libCeiling( storageSize, 16 ) + stack_data_size;
    172         size = ceiling(size, __page_size);
    173169
    174170        // If we are running debug, we also need to allocate a guardpage to catch stack overflows.
    175171        void * storage;
    176         // __cfaabi_dbg_debug_do(
    177         //      storage = memalign( __page_size, size + __page_size );
    178         // );
    179         // __cfaabi_dbg_no_debug_do(
    180         //      storage = (void*)malloc(size);
    181         // );
    182 
    183         // __cfaabi_dbg_print_safe("Kernel : Created stack %p of size %zu\n", storage, size);
    184         // __cfaabi_dbg_debug_do(
    185         //      if ( mprotect( storage, __page_size, PROT_NONE ) == -1 ) {
    186         //              abort( "__stack_alloc : internal error, mprotect failure, error(%d) %s.", (int)errno, strerror( (int)errno ) );
    187         //      }
    188         //      storage = (void *)(((intptr_t)storage) + __page_size);
    189         // );
    190         storage = mmap(0p, size + __page_size, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
    191         if(storage == ((void*)-1)) {
    192                 abort( "coroutine stack creation : internal error, mmap failure, error(%d) %s.", errno, strerror( errno ) );
    193         }
    194         if ( mprotect( storage, __page_size, PROT_NONE ) == -1 ) {
    195                 abort( "coroutine stack creation : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
    196         } // if
    197         storage = (void *)(((intptr_t)storage) + __page_size);
     172        __cfaabi_dbg_debug_do(
     173                storage = memalign( __page_size, size + __page_size );
     174        );
     175        __cfaabi_dbg_no_debug_do(
     176                storage = (void*)malloc(size);
     177        );
     178
     179        __cfaabi_dbg_print_safe("Kernel : Created stack %p of size %zu\n", storage, size);
     180        __cfaabi_dbg_debug_do(
     181                if ( mprotect( storage, __page_size, PROT_NONE ) == -1 ) {
     182                        abort( "__stack_alloc : internal error, mprotect failure, error(%d) %s.", (int)errno, strerror( (int)errno ) );
     183                }
     184                storage = (void *)(((intptr_t)storage) + __page_size);
     185        );
    198186
    199187        verify( ((intptr_t)storage & (libAlign() - 1)) == 0ul );
    200188        return [storage, size];
    201 }
    202 
    203 void __stack_clean  ( __stack_info_t * this ) {
    204         size_t size = ((intptr_t)this->storage->base) - ((intptr_t)this->storage->limit) + sizeof(__stack_t);
    205         void * storage = this->storage->limit;
    206 
    207         storage = (void *)(((intptr_t)storage) - __page_size);
    208         if(munmap(storage, size + __page_size) == -1) {
    209                 abort( "coroutine stack destruction : internal error, munmap failure, error(%d) %s.", errno, strerror( errno ) );
    210         }
    211189}
    212190
     
    232210        assertf( size >= MinStackSize, "Stack size %zd provides less than minimum of %zd bytes for a stack.", size, MinStackSize );
    233211
    234         this->storage = (__stack_t *)((intptr_t)storage + size - sizeof(__stack_t));
     212        this->storage = (__stack_t *)((intptr_t)storage + size);
    235213        this->storage->limit = storage;
    236         this->storage->base  = (void*)((intptr_t)storage + size - sizeof(__stack_t));
     214        this->storage->base  = (void*)((intptr_t)storage + size);
    237215        this->storage->exception_context.top_resume = 0p;
    238216        this->storage->exception_context.current_exception = 0p;
  • libcfa/src/concurrency/coroutine.hfa

    r3e3f236 r6a45bd78  
    102102}
    103103
    104 extern void __stack_prepare( __stack_info_t * this, size_t size /* ignored if storage already allocated */);
    105 extern void __stack_clean  ( __stack_info_t * this );
    106 
     104extern void __stack_prepare   ( __stack_info_t * this, size_t size /* ignored if storage already allocated */);
    107105
    108106// Suspend implementation inlined for performance
  • libcfa/src/concurrency/io/setup.cfa

    r3e3f236 r6a45bd78  
    132132                // Wait for the io poller thread to finish
    133133
    134                 __destroy_pthread( iopoll.thrd, iopoll.stack, 0p );
     134                pthread_join( iopoll.thrd, 0p );
     135                free( iopoll.stack );
    135136
    136137                int ret = close(iopoll.epollfd);
  • libcfa/src/concurrency/kernel/startup.cfa

    r3e3f236 r6a45bd78  
    2929#include "kernel_private.hfa"
    3030#include "startup.hfa"          // STARTUP_PRIORITY_XXX
    31 #include "math.hfa"
    3231
    3332//-----------------------------------------------------------------------------
     
    540539}
    541540
    542 extern size_t __page_size;
    543541void ^?{}(processor & this) with( this ){
    544542        if( ! __atomic_load_n(&do_terminate, __ATOMIC_ACQUIRE) ) {
     
    552550        }
    553551
    554         __destroy_pthread( kernel_thread, this.stack, 0p );
     552        int err = pthread_join( kernel_thread, 0p );
     553        if( err != 0 ) abort("KERNEL ERROR: joining processor %p caused error %s\n", &this, strerror(err));
     554
     555        free( this.stack );
    555556
    556557        disable_interrupts();
     
    677678
    678679        void * stack;
    679         #warning due to the thunk problem, stack creation uses mmap, revert to malloc once this goes away
    680         // __cfaabi_dbg_debug_do(
    681         //      stack = memalign( __page_size, stacksize + __page_size );
    682         //      // pthread has no mechanism to create the guard page in user supplied stack.
    683         //      if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) {
    684         //              abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
    685         //      } // if
    686         // );
    687         // __cfaabi_dbg_no_debug_do(
    688         //      stack = malloc( stacksize );
    689         // );
    690         stacksize = ceiling( stacksize, __page_size ) + __page_size;
    691         stack = mmap(0p, stacksize, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
    692         if(stack == ((void*)-1)) {
    693                 abort( "pthread stack creation : internal error, mmap failure, error(%d) %s.", errno, strerror( errno ) );
    694         }
    695         if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) {
    696                 abort( "pthread stack creation : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
    697         } // if
     680        __cfaabi_dbg_debug_do(
     681                stack = memalign( __page_size, stacksize + __page_size );
     682                // pthread has no mechanism to create the guard page in user supplied stack.
     683                if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) {
     684                        abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
     685                } // if
     686        );
     687        __cfaabi_dbg_no_debug_do(
     688                stack = malloc( stacksize );
     689        );
    698690
    699691        check( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
     
    702694        return stack;
    703695}
    704 
    705 void __destroy_pthread( pthread_t pthread, void * stack, void ** retval ) {
    706         int err = pthread_join( pthread, retval );
    707         if( err != 0 ) abort("KERNEL ERROR: joining pthread %p caused error %s\n", (void*)pthread, strerror(err));
    708 
    709         pthread_attr_t attr;
    710 
    711         check( pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
    712 
    713         size_t stacksize;
    714         // default stack size, normally defined by shell limit
    715         check( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
    716         assert( stacksize >= PTHREAD_STACK_MIN );
    717         stacksize += __page_size;
    718 
    719         if(munmap(stack, stacksize) == -1) {
    720                 abort( "pthread stack destruction : internal error, munmap failure, error(%d) %s.", errno, strerror( errno ) );
    721         }
    722 }
    723 
    724696
    725697#if defined(__CFA_WITH_VERIFY__)
  • libcfa/src/concurrency/kernel_private.hfa

    r3e3f236 r6a45bd78  
    4949
    5050void * __create_pthread( pthread_t *, void * (*)(void *), void * );
    51 void __destroy_pthread( pthread_t pthread, void * stack, void ** retval );
    5251
    5352
  • libcfa/src/concurrency/preemption.cfa

    r3e3f236 r6a45bd78  
    354354}
    355355
    356 //-----------------------------------------------------------------------------
    357 // Kernel Signal Debug
    358 void __cfaabi_check_preemption() {
    359         bool ready = __preemption_enabled();
    360         if(!ready) { abort("Preemption should be ready"); }
    361 
    362         __cfaasm_label(debug, before);
    363 
    364                 sigset_t oldset;
    365                 int ret;
    366                 ret = pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset);  // workaround trac#208: cast should be unnecessary
    367                 if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); }
    368 
    369                 ret = sigismember(&oldset, SIGUSR1);
    370                 if(ret <  0) { abort("ERROR sigismember returned %d", ret); }
    371                 if(ret == 1) { abort("ERROR SIGUSR1 is disabled"); }
    372 
    373                 ret = sigismember(&oldset, SIGALRM);
    374                 if(ret <  0) { abort("ERROR sigismember returned %d", ret); }
    375                 if(ret == 0) { abort("ERROR SIGALRM is enabled"); }
    376 
    377                 ret = sigismember(&oldset, SIGTERM);
    378                 if(ret <  0) { abort("ERROR sigismember returned %d", ret); }
    379                 if(ret == 1) { abort("ERROR SIGTERM is disabled"); }
    380 
    381         __cfaasm_label(debug, after);
    382 }
    383 
    384 #ifdef __CFA_WITH_VERIFY__
    385 bool __cfaabi_dbg_in_kernel() {
    386         return !__preemption_enabled();
    387 }
    388 #endif
    389 
    390356#undef __cfaasm_label
    391 
    392 //-----------------------------------------------------------------------------
    393 // Signal handling
    394357
    395358// sigprocmask wrapper : unblock a single signal
     
    442405                #define RELOC_SUFFIX ""
    443406        #endif
    444         #define __cfaasm_label( label ) struct asm_region label = \
     407        #define __cfaasm_label( label ) static struct asm_region label = \
    445408                ({ \
    446409                        struct asm_region region; \
     
    461424                #define RELOC_SUFFIX ""
    462425        #endif
    463         #define __cfaasm_label( label ) struct asm_region label = \
     426        #define __cfaasm_label( label ) static struct asm_region label = \
    464427                ({ \
    465428                        struct asm_region region; \
     
    474437        #ifdef __PIC__
    475438                // Note that this works only for gcc
    476                 #define __cfaasm_label( label ) struct asm_region label = \
     439                #define __cfaasm_label( label ) static struct asm_region label = \
    477440                ({ \
    478441                        struct asm_region region; \
     
    489452                #error this is not the right thing to do
    490453                /*
    491                 #define __cfaasm_label( label ) struct asm_region label = \
     454                #define __cfaasm_label( label ) static struct asm_region label = \
    492455                ({ \
    493456                        struct asm_region region; \
     
    516479        __cfaasm_label( check  );
    517480        __cfaasm_label( dsable );
    518         __cfaasm_label( debug  );
    519481
    520482        // Check if preemption is safe
     
    523485        if( __cfaasm_in( ip, check  ) ) { ready = false; goto EXIT; };
    524486        if( __cfaasm_in( ip, dsable ) ) { ready = false; goto EXIT; };
    525         if( __cfaasm_in( ip, debug  ) ) { ready = false; goto EXIT; };
    526487        if( !__cfaabi_tls.preemption_state.enabled) { ready = false; goto EXIT; };
    527488        if( __cfaabi_tls.preemption_state.in_progress ) { ready = false; goto EXIT; };
     
    575536        // Wait for the preemption thread to finish
    576537
    577         __destroy_pthread( alarm_thread, alarm_stack, 0p );
     538        pthread_join( alarm_thread, 0p );
     539        free( alarm_stack );
    578540
    579541        // Preemption is now fully stopped
     
    735697}
    736698
     699//=============================================================================================
     700// Kernel Signal Debug
     701//=============================================================================================
     702
     703void __cfaabi_check_preemption() {
     704        bool ready = __preemption_enabled();
     705        if(!ready) { abort("Preemption should be ready"); }
     706
     707        sigset_t oldset;
     708        int ret;
     709        ret = pthread_sigmask(0, ( const sigset_t * ) 0p, &oldset);  // workaround trac#208: cast should be unnecessary
     710        if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); }
     711
     712        ret = sigismember(&oldset, SIGUSR1);
     713        if(ret <  0) { abort("ERROR sigismember returned %d", ret); }
     714        if(ret == 1) { abort("ERROR SIGUSR1 is disabled"); }
     715
     716        ret = sigismember(&oldset, SIGALRM);
     717        if(ret <  0) { abort("ERROR sigismember returned %d", ret); }
     718        if(ret == 0) { abort("ERROR SIGALRM is enabled"); }
     719
     720        ret = sigismember(&oldset, SIGTERM);
     721        if(ret <  0) { abort("ERROR sigismember returned %d", ret); }
     722        if(ret == 1) { abort("ERROR SIGTERM is disabled"); }
     723}
     724
     725#ifdef __CFA_WITH_VERIFY__
     726bool __cfaabi_dbg_in_kernel() {
     727        return !__preemption_enabled();
     728}
     729#endif
     730
    737731// Local Variables: //
    738732// mode: c //
  • libcfa/src/stdlib.hfa

    r3e3f236 r6a45bd78  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  8 18:27:22 2020
    13 // Update Count     : 524
     12// Last Modified On : Thu Nov 12 20:58:48 2020
     13// Update Count     : 520
    1414//
    1515
     
    268268static inline forall( dtype T | { void ^?{}( T & ); } )
    269269void delete( T * ptr ) {
    270         // special case for 0-sized object => always call destructor
    271         if ( ptr || sizeof(ptr) == 0 ) {                                        // ignore null but not 0-sized objects
     270        if ( ptr ) {                                                                            // ignore null
    272271                ^(*ptr){};                                                                              // run destructor
     272                free( ptr );
    273273        } // if
    274         free( ptr );
    275274} // delete
    276275
  • src/AST/module.mk

    r3e3f236 r6a45bd78  
    5959        AST/SymbolTable.cpp \
    6060        AST/SymbolTable.hpp \
    61         AST/TranslationUnit.hpp \
    6261        AST/Type.cpp \
    6362        AST/Type.hpp \
  • src/Common/module.mk

    r3e3f236 r6a45bd78  
    1818      Common/Assert.cc \
    1919      Common/CodeLocation.h \
    20       Common/CodeLocationTools.hpp \
    21       Common/CodeLocationTools.cpp \
    2220      Common/CompilerError.h \
    2321      Common/Debug.h \
  • src/main.cc

    r3e3f236 r6a45bd78  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Dec  7 15:29:00 2020
    13 // Update Count     : 639
     12// Last Modified On : Tue Dec  1 14:52:00 2020
     13// Update Count     : 638
    1414//
    1515
     
    4040#include "CodeTools/ResolvProtoDump.h"      // for dumpAsResolvProto
    4141#include "CodeTools/TrackLoc.h"             // for fillLocations
    42 #include "Common/CodeLocationTools.hpp"     // for forceFillCodeLocations
    4342#include "Common/CompilerError.h"           // for CompilerError
    4443#include "Common/Stats.h"
     
    354353                        } // if
    355354
    356                         forceFillCodeLocations( transUnit );
     355                        // TODO: This is a quick fix to get the build working.
     356                        // Get rid of fillLocations or at least make a new-ast version.
     357                        translationUnit = convert( move( transUnit ) );
     358                        CodeTools::fillLocations( translationUnit );
     359                        transUnit = convert( move( translationUnit ) );
    357360
    358361                        PASS( "Fix Init", InitTweak::fix(transUnit, buildingLibrary()));
  • tests/Makefile.am

    r3e3f236 r6a45bd78  
    6868.INTERMEDIATE: .validate .validate.cfa
    6969EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
    70 EXTRA_DIST = test.py \
    71         pybin/__init__.py \
    72         pybin/print-core.gdb \
    73         pybin/settings.py \
    74         pybin/test_run.py \
    75         pybin/tools.py \
    76         long_tests.hfa \
    77         .in/io.data \
    78         avltree/avl.h \
    79         avltree/avl-private.h \
    80         concurrent/clib.c \
    81         exceptions/with-threads.hfa \
    82         exceptions/except-io.hfa
    83 
    84 dist-hook:
    85         echo "Gathering test files"
    86         for file in `${TEST_PY} --list-dist`; do \
    87                 if test -f ${srcdir}/$${file}; then \
    88                         $(MKDIR_P) $$(dirname ${distdir}/$${file}); \
    89                         cp -df ${srcdir}/$${file} ${distdir}/$${file}; \
    90                 fi; \
    91         done
    9270
    9371avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
     
    10280        @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    10381
    104 mostlyclean-local :
     82clean-local :
    10583        rm -f ${EXTRA_PROGRAMS}
    106         rm -rf __pycache__
    107         find ${builddir} -path '*.o' -delete
    108         find ${builddir} -path '*/.err/*.log' -delete
    109         find ${builddir} -path '*/.out/*.log' -delete
    110 
    111 distclean-local :
    112         find ${builddir} -path '*.Po' -delete
    11384
    11485list :
  • tests/pybin/tools.py

    r3e3f236 r6a45bd78  
    191191        cmd = [s for s in cmd if s]
    192192        return sh(*cmd, output_file=output_file, error=error)
    193 
    194 def make_recon(target):
    195         cmd = [
    196                 *settings.make,
    197                 '-W',
    198                 os.path.abspath(os.path.join(settings.BUILDDIR, '../driver/cfa')),
    199                 '--recon',
    200                 target
    201         ]
    202         cmd = [s for s in cmd if s]
    203         return sh(*cmd, output_file=subprocess.PIPE)
    204193
    205194def which(program):
  • tests/test.py

    r3e3f236 r6a45bd78  
    143143        parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int)
    144144        parser.add_argument('--list-comp', help='List all valide arguments', action='store_true')
    145         parser.add_argument('--list-dist', help='List all tests for distribution', action='store_true')
    146145        parser.add_argument('-I','--include', help='Directory of test to include, can be used multiple time, All  if omitted', action='append')
    147146        parser.add_argument('-E','--exclude', help='Directory of test to exclude, can be used multiple time, None if omitted', action='append')
     
    156155
    157156        # script must have at least some tests to run or be listing
    158         listing    = options.list or options.list_comp or options.list_dist
     157        listing    = options.list or options.list_comp
    159158        all_tests  = options.all
    160159        some_tests = len(options.tests) > 0
     
    335334        settings.init( options )
    336335
    337         # --------------------------------------------------
    338         # list all the test for auto completion programs
    339         # not pretty, single line, with the command line options
     336        # users may want to simply list the tests
    340337        if options.list_comp :
    341338                # fetch the liest of all valid tests
     
    343340
    344341                # print the possible options
    345                 print("-h --help --debug --dry-run --list --ast=new --ast=old --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs -I --include -E --exclude --continue ", end='')
     342                print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs -I --include -E --exclude --continue ", end='')
    346343                print(" ".join(map(lambda t: "%s" % (t.target()), tests)))
    347344
    348                 # done
    349                 sys.exit(0)
    350 
    351         # --------------------------------------------------
    352         # list all the test for auto completion programs
    353         if options.list_dist :
    354                 # fetch the liest of all valid tests
    355                 tests = list_tests( None, None )
    356 
    357                 for t in tests:
    358                         print(os.path.relpath(t.expect(), settings.SRCDIR), end=' ')
    359                         print(os.path.relpath(t.input() , settings.SRCDIR), end=' ')
    360                         code, out = make_recon(t.target())
    361 
    362                         if code != 0:
    363                                 print('ERROR: recond failed for test {}'.format(t.target()), file=sys.stderr)
    364                                 sys.exit(1)
    365 
    366                         print(' '.join(re.findall('([^\s]+\.cfa)', out)), end=' ')
    367 
    368                 print('')
    369 
    370                 # done
    371                 sys.exit(0)
    372 
    373 
    374         # --------------------------------------------------
    375         # list all the tests for users, in a pretty format
    376         if options.list :
     345        elif options.list :
    377346                # fetch the liest of all valid tests
    378347                tests = list_tests( options.include, options.exclude )
     
    381350                fancy_print("\n".join(map(lambda t: t.toString(), tests)))
    382351
    383                 # done
    384                 sys.exit(0)
    385 
    386         # fetch the liest of all valid tests
    387         all_tests = list_tests( options.include, options.exclude )
    388 
    389         # if user wants all tests than no other treatement of the test list is required
    390         if options.all or options.include :
    391                 tests = all_tests
    392 
    393         #otherwise we need to validate that the test list that was entered is valid
    394352        else :
    395                 tests = valid_tests( options )
    396 
    397         # make sure we have at least some test to run
    398         if not tests :
    399                 print('ERROR: No valid test to run', file=sys.stderr)
    400                 sys.exit(1)
    401 
    402         # prep invariants
    403         settings.prep_output(tests)
    404         failed = 0
    405 
    406         # check if the expected files aren't empty
    407         if not options.regenerate_expected:
    408                 for t in tests:
    409                         if is_empty(t.expect()):
    410                                 print('WARNING: test "{}" has empty .expect file'.format(t.target()), file=sys.stderr)
    411 
    412         # for each build configurations, run the test
    413         with Timed() as total_dur:
    414                 for ast, arch, debug, install in itertools.product(settings.all_ast, settings.all_arch, settings.all_debug, settings.all_install):
    415                         settings.ast     = ast
    416                         settings.arch    = arch
    417                         settings.debug   = debug
    418                         settings.install = install
    419 
    420                         # filter out the tests for a different architecture
    421                         # tests are the same across debug/install
    422                         local_tests = settings.ast.filter( tests )
    423                         local_tests = settings.arch.filter( local_tests )
    424                         options.jobs, forceJobs = job_count( options, local_tests )
    425                         settings.update_make_cmd(forceJobs, options.jobs)
    426 
    427                         # check the build configuration works
    428                         settings.validate()
    429 
    430                         # print configuration
    431                         print('%s %i tests on %i cores (%s:%s - %s)' % (
    432                                 'Regenerating' if settings.generating else 'Running',
    433                                 len(local_tests),
    434                                 options.jobs,
    435                                 settings.ast.string,
    436                                 settings.arch.string,
    437                                 settings.debug.string
    438                         ))
    439                         if not local_tests :
    440                                 print('WARNING: No tests for this configuration')
    441                                 continue
    442 
    443                         # otherwise run all tests and make sure to return the correct error code
    444                         failed = run_tests(local_tests, options.jobs)
    445                         if failed:
    446                                 result = 1
    447                                 if not settings.continue_:
    448                                         break
    449 
    450         print('Tests took %s' % fmtDur( total_dur.duration ))
    451         sys.exit( failed )
     353                # fetch the liest of all valid tests
     354                all_tests = list_tests( options.include, options.exclude )
     355
     356                # if user wants all tests than no other treatement of the test list is required
     357                if options.all or options.include :
     358                        tests = all_tests
     359
     360                #otherwise we need to validate that the test list that was entered is valid
     361                else :
     362                        tests = valid_tests( options )
     363
     364                # make sure we have at least some test to run
     365                if not tests :
     366                        print('ERROR: No valid test to run', file=sys.stderr)
     367                        sys.exit(1)
     368
     369                # prep invariants
     370                settings.prep_output(tests)
     371                failed = 0
     372
     373                # check if the expected files aren't empty
     374                if not options.regenerate_expected:
     375                        for t in tests:
     376                                if is_empty(t.expect()):
     377                                        print('WARNING: test "{}" has empty .expect file'.format(t.target()), file=sys.stderr)
     378
     379                # for each build configurations, run the test
     380                with Timed() as total_dur:
     381                        for ast, arch, debug, install in itertools.product(settings.all_ast, settings.all_arch, settings.all_debug, settings.all_install):
     382                                settings.ast     = ast
     383                                settings.arch    = arch
     384                                settings.debug   = debug
     385                                settings.install = install
     386
     387                                # filter out the tests for a different architecture
     388                                # tests are the same across debug/install
     389                                local_tests = settings.ast.filter( tests )
     390                                local_tests = settings.arch.filter( local_tests )
     391                                options.jobs, forceJobs = job_count( options, local_tests )
     392                                settings.update_make_cmd(forceJobs, options.jobs)
     393
     394                                # check the build configuration works
     395                                settings.validate()
     396
     397                                # print configuration
     398                                print('%s %i tests on %i cores (%s:%s - %s)' % (
     399                                        'Regenerating' if settings.generating else 'Running',
     400                                        len(local_tests),
     401                                        options.jobs,
     402                                        settings.ast.string,
     403                                        settings.arch.string,
     404                                        settings.debug.string
     405                                ))
     406                                if not local_tests :
     407                                        print('WARNING: No tests for this configuration')
     408                                        continue
     409
     410                                # otherwise run all tests and make sure to return the correct error code
     411                                failed = run_tests(local_tests, options.jobs)
     412                                if failed:
     413                                        result = 1
     414                                        if not settings.continue_:
     415                                                break
     416
     417                print('Tests took %s' % fmtDur( total_dur.duration ))
     418                sys.exit( failed )
  • tools/Makefile.am

    r3e3f236 r6a45bd78  
    1818ACLOCAL_AMFLAGS  = -I automake
    1919
     20EXTRA_DIST = build/distcc_hash build/push2dist.sh
     21
    2022noinst_PROGRAMS = busy catchsig repeat watchdog
    2123AM_CFLAGS = -Wall -Wextra -O2 -g
Note: See TracChangeset for help on using the changeset viewer.