Changeset 8191203


Ignore:
Timestamp:
Mar 3, 2017, 10:12:10 PM (5 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, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
c443d1d, d107010
Parents:
dd020c0 (diff), bf8da66 (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:
3 added
9 edited
3 moved

Legend:

Unmodified
Added
Removed
  • configure

    rdd020c0 r8191203  
    31313131if test "${enable_threading+set}" = set; then :
    31323132  enableval=$enable_threading; case "${enableval}" in
    3133   yes) build_threading-"yes" ;;
     3133  yes) build_threading="yes" ;;
    31343134  no)  build_threading="no" ;;
    31353135  *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;;
  • configure.ac

    rdd020c0 r8191203  
    5959AC_ARG_ENABLE(threading, AS_HELP_STRING([--enable-threading], [Build and install libcfa with threading support (Enabled by default)]),
    6060[case "${enableval}" in
    61   yes) build_threading-"yes" ;;
     61  yes) build_threading="yes" ;;
    6262  no)  build_threading="no" ;;
    6363  *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
  • src/CodeTools/DeclStats.cc

    rdd020c0 r8191203  
    200200                        // skip if already seen declaration for this function
    201201                        const std::string& mangleName = decl->get_mangleName().empty() ? decl->get_name() : decl->get_mangleName();
    202                         if ( ! seen_names.insert( mangleName ).second ) return;
     202                        if ( ! seen_names.insert( mangleName ).second ) {
     203                                maybeAccept( decl->get_statements(), *this );
     204                                return;
     205                        }
    203206                       
    204207                        Stats& stats = for_linkage[ decl->get_linkage() ];
     
    228231
    229232                        analyzeFunc( fnTy, stats, stats.params, stats.returns );
     233
     234                        // analyze expressions in decl statements
     235                        maybeAccept( decl->get_statements(), *this );
    230236                }
    231237
  • src/libcfa/concurrency/monitor

    rdd020c0 r8191203  
    2020#include "assert"
    2121#include "invoke.h"
     22#include "stdlib"
    2223
    2324struct __monitor_t {
     
    3334}
    3435
     36//Basic entering routine
    3537void enter(__monitor_t *);
    3638void leave(__monitor_t *);
    3739
     40//Array entering routine
     41void enter(__monitor_t **, int count);
     42void leave(__monitor_t **, int count);
     43
    3844struct monitor_guard_t {
    39         __monitor_t * m;
     45        __monitor_t ** m;
     46        int count;
    4047};
    4148
    42 static inline void ?{}( monitor_guard_t * this, __monitor_t * m ) {
     49static inline int ?<?(__monitor_t* lhs, __monitor_t* rhs) {
     50        return ((intptr_t)lhs) < ((intptr_t)rhs);
     51}
     52
     53static inline void ?{}( monitor_guard_t * this, __monitor_t ** m ) {
    4354        this->m = m;
    44         enter( this->m );
     55        this->count = 1;
     56        enter( *this->m );
     57}
     58
     59static inline void ?{}( monitor_guard_t * this, __monitor_t ** m, int count ) {
     60        this->m = m;
     61        this->count = count;
     62        qsort(this->m, count);
     63        enter( this->m, this->count );
    4564}
    4665
    4766static inline void ^?{}( monitor_guard_t * this ) {
    48         leave( this->m );
     67        leave( this->m, this->count );
    4968}
    5069
     70
    5171#endif //MONITOR_H
  • src/libcfa/concurrency/monitor.c

    rdd020c0 r8191203  
    7171        }
    7272}
     73
     74void enter(__monitor_t ** monitors, int count) {
     75        for(int i = 0; i < count; i++) {
     76                // printf("%d\n", i);
     77                enter( monitors[i] );
     78        }
     79}
     80
     81void leave(__monitor_t ** monitors, int count) {
     82        for(int i = count - 1; i >= 0; i--) {
     83                // printf("%d\n", i);
     84                leave( monitors[i] );
     85        }
     86}
  • src/tests/Makefile.am

    rdd020c0 r8191203  
    1717debug=yes
    1818
     19quick_test=vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once
     20
     21if BUILD_CONCURRENCY
     22concurrent=yes
     23quick_test+= coroutine thread monitor
     24else
     25concurrent=no
     26endif
     27
     28
    1929# applies to both programs
    2030EXTRA_FLAGS =
     
    3040
    3141all-local :
    32         @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
     42        @+python test.py --debug=${debug} --concurrent=${concurrent} ${quick_test}
    3343
    3444all-tests :
    35         @+python test.py --all --debug=${debug}         # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     45        @+python test.py --all --debug=${debug} --concurrent=${concurrent}              # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    3646
    3747clean-local :
     
    3949
    4050list :
    41         @+python test.py --list
     51        @+python test.py --list --concurrent=${concurrent}
    4252
    4353constant0-1DP : constant0-1.c
  • src/tests/Makefile.in

    rdd020c0 r8191203  
    3737build_triplet = @build@
    3838host_triplet = @host@
     39@BUILD_CONCURRENCY_TRUE@am__append_1 = coroutine thread monitor
    3940EXTRA_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) \
    4041        avl_test$(EXEEXT) constant0-1DP$(EXEEXT) \
     
    222223top_srcdir = @top_srcdir@
    223224debug = yes
     225quick_test = vector_test avl_test operators numericConstants \
     226        expression enum array typeof cast dtor-early-exit init_once \
     227        $(am__append_1)
     228@BUILD_CONCURRENCY_FALSE@concurrent = no
     229@BUILD_CONCURRENCY_TRUE@concurrent = yes
    224230
    225231# applies to both programs
     
    651657
    652658all-local :
    653         @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
     659        @+python test.py --debug=${debug} --concurrent=${concurrent} ${quick_test}
    654660
    655661all-tests :
    656         @+python test.py --all --debug=${debug}         # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     662        @+python test.py --all --debug=${debug} --concurrent=${concurrent}              # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    657663
    658664clean-local :
     
    660666
    661667list :
    662         @+python test.py --list
     668        @+python test.py --list --concurrent=${concurrent}
    663669
    664670constant0-1DP : constant0-1.c
  • src/tests/monitor.c

    rdd020c0 r8191203  
    1616
    1717void increment( /*mutex*/ global_t * this ) {
    18         monitor_guard_t g1 = { &this->m };
     18        __monitor_t * mon = &this->m;
     19        monitor_guard_t g1 = { &mon };
    1920        {
    20                 monitor_guard_t g2 = { &this->m };
     21                monitor_guard_t g2 = { &mon };
    2122                {
    22                         monitor_guard_t g3 = { &this->m };
     23                        monitor_guard_t g3 = { &mon };
    2324                        this->value += 1;
    2425                }
  • src/tests/test.py

    rdd020c0 r8191203  
    3232        return re.search("ELF\s([0-9]+)-bit", out).group(1)
    3333
    34 # reads the directory ./.expect and indentifies the tests
    35 def listTests():
    36         machineType = getMachineType()
     34def listTestsFolder(folder) :
     35        path = ('./.expect/%s/' % folder) if folder else './.expect/'
     36        subpath = "%s/" % folder if folder else ""
    3737
    3838        # tests directly in the .expect folder will always be processed
    39         generic_list = map(lambda fname: Test(fname, fname),
    40                 [splitext(f)[0] for f in listdir('./.expect')
     39        return map(lambda fname: Test(fname, subpath + fname),
     40                [splitext(f)[0] for f in listdir( path )
    4141                if not f.startswith('.') and f.endswith('.txt')
    4242                ])
    4343
     44# reads the directory ./.expect and indentifies the tests
     45def listTests( concurrent ):
     46        machineType = getMachineType()
     47
     48        # tests directly in the .expect folder will always be processed
     49        generic_list = listTestsFolder( "" )
     50
    4451        # tests in the machineType folder will be ran only for the corresponding compiler
    45         typed_list = map(lambda fname: Test( fname, "%s/%s" % (machineType, fname) ),
    46                 [splitext(f)[0] for f in listdir("./.expect/%s" % machineType)
    47                 if not f.startswith('.') and f.endswith('.txt')
    48                 ])
     52        typed_list = listTestsFolder( machineType )
     53
     54        # tests in the concurrent folder will be ran only if concurrency is enabled
     55        concurrent_list = listTestsFolder( "concurrent" ) if concurrent else []
    4956
    5057        # append both lists to get
    51         return generic_list + typed_list
     58        return generic_list + typed_list + concurrent_list;
    5259
    5360# helper functions to run terminal commands
     
    194201                sys.stderr.flush()
    195202                return test_failed
    196        
     203
    197204        except KeyboardInterrupt:
    198205                test_failed = True
     
    243250parser = argparse.ArgumentParser(description='Script which runs cforall tests')
    244251parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no')
     252parser.add_argument('--concurrent', help='Run concurrent tests', type=yes_no, default='no')
    245253parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
    246254parser.add_argument('--list', help='List all test available', action='store_true')
     
    261269
    262270# fetch the liest of all valid tests
    263 allTests = listTests()
     271allTests = listTests( options.concurrent )
    264272
    265273# if user wants all tests than no other treatement of the test list is required
Note: See TracChangeset for help on using the changeset viewer.