Changes in / [dd020c0:8191203]
- Files:
-
- 6 added
- 3 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
configure
rdd020c0 r8191203 3131 3131 if test "${enable_threading+set}" = set; then : 3132 3132 enableval=$enable_threading; case "${enableval}" in 3133 yes) build_threading -"yes" ;;3133 yes) build_threading="yes" ;; 3134 3134 no) build_threading="no" ;; 3135 3135 *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; -
configure.ac
rdd020c0 r8191203 59 59 AC_ARG_ENABLE(threading, AS_HELP_STRING([--enable-threading], [Build and install libcfa with threading support (Enabled by default)]), 60 60 [case "${enableval}" in 61 yes) build_threading -"yes" ;;61 yes) build_threading="yes" ;; 62 62 no) build_threading="no" ;; 63 63 *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;; -
src/CodeTools/DeclStats.cc
rdd020c0 r8191203 200 200 // skip if already seen declaration for this function 201 201 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 } 203 206 204 207 Stats& stats = for_linkage[ decl->get_linkage() ]; … … 228 231 229 232 analyzeFunc( fnTy, stats, stats.params, stats.returns ); 233 234 // analyze expressions in decl statements 235 maybeAccept( decl->get_statements(), *this ); 230 236 } 231 237 -
src/libcfa/concurrency/monitor
rdd020c0 r8191203 20 20 #include "assert" 21 21 #include "invoke.h" 22 #include "stdlib" 22 23 23 24 struct __monitor_t { … … 33 34 } 34 35 36 //Basic entering routine 35 37 void enter(__monitor_t *); 36 38 void leave(__monitor_t *); 37 39 40 //Array entering routine 41 void enter(__monitor_t **, int count); 42 void leave(__monitor_t **, int count); 43 38 44 struct monitor_guard_t { 39 __monitor_t * m; 45 __monitor_t ** m; 46 int count; 40 47 }; 41 48 42 static inline void ?{}( monitor_guard_t * this, __monitor_t * m ) { 49 static inline int ?<?(__monitor_t* lhs, __monitor_t* rhs) { 50 return ((intptr_t)lhs) < ((intptr_t)rhs); 51 } 52 53 static inline void ?{}( monitor_guard_t * this, __monitor_t ** m ) { 43 54 this->m = m; 44 enter( this->m ); 55 this->count = 1; 56 enter( *this->m ); 57 } 58 59 static 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 ); 45 64 } 46 65 47 66 static inline void ^?{}( monitor_guard_t * this ) { 48 leave( this->m );67 leave( this->m, this->count ); 49 68 } 50 69 70 51 71 #endif //MONITOR_H -
src/libcfa/concurrency/monitor.c
rdd020c0 r8191203 71 71 } 72 72 } 73 74 void 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 81 void 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 17 17 debug=yes 18 18 19 quick_test=vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once 20 21 if BUILD_CONCURRENCY 22 concurrent=yes 23 quick_test+= coroutine thread monitor 24 else 25 concurrent=no 26 endif 27 28 19 29 # applies to both programs 20 30 EXTRA_FLAGS = … … 30 40 31 41 all-local : 32 @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread42 @+python test.py --debug=${debug} --concurrent=${concurrent} ${quick_test} 33 43 34 44 all-tests : 35 @+python test.py --all --debug=${debug} # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program45 @+python test.py --all --debug=${debug} --concurrent=${concurrent} # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 36 46 37 47 clean-local : … … 39 49 40 50 list : 41 @+python test.py --list 51 @+python test.py --list --concurrent=${concurrent} 42 52 43 53 constant0-1DP : constant0-1.c -
src/tests/Makefile.in
rdd020c0 r8191203 37 37 build_triplet = @build@ 38 38 host_triplet = @host@ 39 @BUILD_CONCURRENCY_TRUE@am__append_1 = coroutine thread monitor 39 40 EXTRA_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) \ 40 41 avl_test$(EXEEXT) constant0-1DP$(EXEEXT) \ … … 222 223 top_srcdir = @top_srcdir@ 223 224 debug = yes 225 quick_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 224 230 225 231 # applies to both programs … … 651 657 652 658 all-local : 653 @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread659 @+python test.py --debug=${debug} --concurrent=${concurrent} ${quick_test} 654 660 655 661 all-tests : 656 @+python test.py --all --debug=${debug} # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program662 @+python test.py --all --debug=${debug} --concurrent=${concurrent} # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 657 663 658 664 clean-local : … … 660 666 661 667 list : 662 @+python test.py --list 668 @+python test.py --list --concurrent=${concurrent} 663 669 664 670 constant0-1DP : constant0-1.c -
src/tests/monitor.c
rdd020c0 r8191203 16 16 17 17 void increment( /*mutex*/ global_t * this ) { 18 monitor_guard_t g1 = { &this->m }; 18 __monitor_t * mon = &this->m; 19 monitor_guard_t g1 = { &mon }; 19 20 { 20 monitor_guard_t g2 = { & this->m};21 monitor_guard_t g2 = { &mon }; 21 22 { 22 monitor_guard_t g3 = { & this->m};23 monitor_guard_t g3 = { &mon }; 23 24 this->value += 1; 24 25 } -
src/tests/test.py
rdd020c0 r8191203 32 32 return re.search("ELF\s([0-9]+)-bit", out).group(1) 33 33 34 # reads the directory ./.expect and indentifies the tests 35 def listTests(): 36 machineType = getMachineType()34 def listTestsFolder(folder) : 35 path = ('./.expect/%s/' % folder) if folder else './.expect/' 36 subpath = "%s/" % folder if folder else "" 37 37 38 38 # 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 ) 41 41 if not f.startswith('.') and f.endswith('.txt') 42 42 ]) 43 43 44 # reads the directory ./.expect and indentifies the tests 45 def listTests( concurrent ): 46 machineType = getMachineType() 47 48 # tests directly in the .expect folder will always be processed 49 generic_list = listTestsFolder( "" ) 50 44 51 # 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 [] 49 56 50 57 # append both lists to get 51 return generic_list + typed_list 58 return generic_list + typed_list + concurrent_list; 52 59 53 60 # helper functions to run terminal commands … … 194 201 sys.stderr.flush() 195 202 return test_failed 196 203 197 204 except KeyboardInterrupt: 198 205 test_failed = True … … 243 250 parser = argparse.ArgumentParser(description='Script which runs cforall tests') 244 251 parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no') 252 parser.add_argument('--concurrent', help='Run concurrent tests', type=yes_no, default='no') 245 253 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true') 246 254 parser.add_argument('--list', help='List all test available', action='store_true') … … 261 269 262 270 # fetch the liest of all valid tests 263 allTests = listTests( )271 allTests = listTests( options.concurrent ) 264 272 265 273 # 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.