Changeset 48f6252
- Timestamp:
- Dec 8, 2020, 6:40:21 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 364a03c
- Parents:
- 0f7a0ea (diff), d7a10af (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. - Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/Distribute
r0f7a0ea r48f6252 15 15 SrcDir = pwd tmp: false 16 16 Settings = null 17 Version = '' 17 18 18 19 // Local variables … … 22 23 currentBuild.result = "SUCCESS" 23 24 24 try { 25 //Wrap build to add timestamp to command line 26 wrap([$class: 'TimestamperBuildWrapper']) { 25 //Wrap build to add timestamp to command line 26 wrap([$class: 'TimestamperBuildWrapper']) { 27 27 28 29 28 final commit, build 29 (commit, build) = prepare_build() 30 30 31 node('x64') { 32 BuildDir = pwd tmp: true 33 SrcDir = pwd tmp: false 34 35 Tools.Clean() 36 37 Tools.Checkout( commit ) 38 39 final version = GetVersion( build ) 40 } 41 42 // Update the build directories when exiting the node 31 node('x64') { 43 32 BuildDir = pwd tmp: true 44 33 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() 45 48 } 49 50 // Update the build directories when exiting the node 51 BuildDir = pwd tmp: true 52 SrcDir = pwd tmp: false 46 53 } 47 54 48 //If an exception is caught we need to change the status and remember to49 //attach the build log to the email50 // catch (Exception caughtError) {51 // //rethrow error later52 // err = caughtError53 54 // echo err.toString()55 56 // //An error has occured, the build log is relevent57 // log_needed = true58 59 // //Store the result of the build log60 // currentBuild.result = "${StageName} FAILURE".trim()61 // }62 63 finally {64 // //Send email with final results if this is not a full build65 // email(log_needed)66 67 // echo 'Distribution Completed'68 69 // /* Must re-throw exception to propagate error */70 // if (err) {71 // throw err72 // }73 }74 55 } 75 56 … … 90 71 91 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 } 92 118 } 93 119 -
Jenkins/FullBuild
r0f7a0ea r48f6252 26 26 gcc_5_x64_old: { trigger_build( 'gcc-5', 'x64', false ) }, 27 27 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 ) }, 29 29 ) 30 } 31 32 stage('Package') { 33 build job: 'Cforall_Distribute_Ref', parameters: [string(name: 'GitRef', value: gitRefNewValue), string(name: 'Build', value: currentBuild.number)] 30 34 } 31 35 } -
Jenkinsfile
r0f7a0ea r48f6252 93 93 // Build outside of the src tree to ease cleaning 94 94 dir (BuildDir) { 95 //Configure the co npilation (Output is not relevant)95 //Configure the compilation (Output is not relevant) 96 96 //Use the current directory as the installation target so nothing escapes the sandbox 97 97 //Also specify the compiler by hand -
Makefile.am
r0f7a0ea r48f6252 21 21 22 22 SUBDIRS = driver src . @LIBCFA_TARGET_DIRS@ 23 DIST_SUBDIRS = driver src . libcfa benchmark longrun_teststests tools tools/prettyprinter23 DIST_SUBDIRS = driver src . libcfa tests tools tools/prettyprinter 24 24 25 25 @LIBCFA_TARGET_MAKEFILES@ : Makefile $(srcdir)/libcfa/configure -
configure.ac
r0f7a0ea r48f6252 3 3 4 4 AC_PREREQ([2.68]) 5 AC_INIT([cfa-cc],[1.0.0 .0],[cforall@plg.uwaterloo.ca])5 AC_INIT([cfa-cc],[1.0.0],[cforall@plg.uwaterloo.ca]) 6 6 AC_CONFIG_AUX_DIR([automake]) 7 7 AC_CONFIG_MACRO_DIRS([automake]) … … 28 28 # New AST toggling support 29 29 AH_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=" False"30 DEFAULT_NEW_AST="True" 31 31 AC_ARG_ENABLE(new-ast, 32 32 [ --enable-new-ast whether or not to use new ast as the default AST algorithm], … … 35 35 no) newast=false; DEFAULT_NEW_AST="False" ;; 36 36 *) AC_MSG_ERROR([bad value ${enableval} for --enable-new-ast]) ;; 37 esac],[newast= false])37 esac],[newast=true]) 38 38 AC_DEFINE_UNQUOTED([CFA_USE_NEW_AST], $newast) 39 39 AC_SUBST(DEFAULT_NEW_AST) … … 103 103 # Create variables for commonly used targets 104 104 105 TOP_SRCDIR="$(readlink - m $ac_confdir/)/"106 TOP_BUILDDIR="$(readlink - m$ac_pwd/)/"105 TOP_SRCDIR="$(readlink -e $ac_abs_confdir/)/" 106 TOP_BUILDDIR="$(readlink -e $ac_pwd/)/" 107 107 108 108 AC_DEFINE_UNQUOTED(TOP_SRCDIR, "$TOP_SRCDIR", [Top src directory]) … … 139 139 \'--enable-gprofiler=*) ;; 140 140 \'--disable-gprofiler) ;; 141 142 # skip the target hosts 143 \'--enable-new-ast=*) ;; 144 \'--disable-new-ast) ;; 141 145 142 146 # skip this, it only causes problems … … 287 291 libcfa/Makefile:libcfa/Makefile.dist.in 288 292 tests/Makefile 289 longrun_tests/Makefile290 benchmark/Makefile291 benchmark/io/http/Makefile292 293 tools/Makefile 293 294 tools/prettyprinter/Makefile 294 295 ]) 295 296 297 # Some of our makefile don't need to be distributed 298 AM_CONDITIONAL([CFORALL_DISTRIBUTE], [test -e $TOP_SRCDIR/autogen.sh]) 299 AM_COND_IF([CFORALL_DISTRIBUTE], 300 [AC_CONFIG_FILES([ 301 longrun_tests/Makefile 302 benchmark/Makefile 303 benchmark/io/http/Makefile 304 ])]) 305 296 306 AC_CONFIG_LINKS([tests/test.py:tests/test.py]) 297 307 -
libcfa/configure.ac
r0f7a0ea r48f6252 3 3 4 4 AC_PREREQ([2.68]) 5 AC_INIT([cfa-cc],[1.0.0 .0],[cforall@plg.uwaterloo.ca])5 AC_INIT([cfa-cc],[1.0.0],[cforall@plg.uwaterloo.ca]) 6 6 AC_CONFIG_AUX_DIR([automake]) 7 7 AC_CONFIG_MACRO_DIRS([automake]) -
libcfa/src/Makefile.am
r0f7a0ea r48f6252 43 43 clock.hfa \ 44 44 exception.hfa \ 45 exception.h \ 45 46 gmp.hfa \ 46 47 math.hfa \ … … 77 78 bits/debug.cfa \ 78 79 exception.c \ 79 exception.h \80 80 interpose.cfa \ 81 81 lsda.h \ … … 87 87 # not all platforms support concurrency, add option do disable it 88 88 inst_thread_headers_nosrc = \ 89 bits/collection.hfa \ 89 90 bits/random.hfa \ 91 bits/sequence.hfa \ 90 92 concurrency/clib/cfathread.h \ 91 93 concurrency/invoke.h \ -
libcfa/src/concurrency/preemption.cfa
r0f7a0ea r48f6252 405 405 #define RELOC_SUFFIX "" 406 406 #endif 407 #define __cfaasm_label( label ) st atic struct asm_region label = \407 #define __cfaasm_label( label ) struct asm_region label = \ 408 408 ({ \ 409 409 struct asm_region region; \ … … 424 424 #define RELOC_SUFFIX "" 425 425 #endif 426 #define __cfaasm_label( label ) st atic struct asm_region label = \426 #define __cfaasm_label( label ) struct asm_region label = \ 427 427 ({ \ 428 428 struct asm_region region; \ … … 437 437 #ifdef __PIC__ 438 438 // Note that this works only for gcc 439 #define __cfaasm_label( label ) st atic struct asm_region label = \439 #define __cfaasm_label( label ) struct asm_region label = \ 440 440 ({ \ 441 441 struct asm_region region; \ … … 452 452 #error this is not the right thing to do 453 453 /* 454 #define __cfaasm_label( label ) st atic struct asm_region label = \454 #define __cfaasm_label( label ) struct asm_region label = \ 455 455 ({ \ 456 456 struct asm_region region; \ -
src/AST/module.mk
r0f7a0ea r48f6252 59 59 AST/SymbolTable.cpp \ 60 60 AST/SymbolTable.hpp \ 61 AST/TranslationUnit.hpp \ 61 62 AST/Type.cpp \ 62 63 AST/Type.hpp \ -
src/Common/CodeLocationTools.cpp
r0f7a0ea r48f6252 27 27 struct has_code_location : public std::is_base_of<ast::ParseNode, node_t> {}; 28 28 29 // Fill every location30 class FillCore : public ast::WithGuards {31 CodeLocation const * parent;32 33 // This mimics a partially specialized method.34 template<typename node_t, bool has_location>35 struct FillNode;36 template<typename node_t, bool has_location>37 friend struct FillNode;38 39 template<typename node_t>40 struct FillNode<node_t, true> {41 static node_t const * go( FillCore * core, node_t const * node ) {42 node_t * newNode = nullptr;43 if ( node->location.isUnset() ) {44 // Just hoping that top level nodes are always marked.45 assert( core->parent );46 newNode = ast::mutate( node );47 newNode->location = *core->parent;48 }49 core->GuardValue( core->parent );50 core->parent = &node->location;51 return (newNode) ? newNode : node;52 }53 };54 55 template<typename node_t>56 struct FillNode<node_t, false> {57 static node_t const * go( FillCore *, node_t const * node ) {58 return node;59 }60 };61 public:62 FillCore() : parent( nullptr ) {}63 64 template<typename node_t>65 node_t const * previsit( node_t const * node ) {66 using Filler = FillNode<node_t, has_code_location<node_t>::value>;67 return Filler::go( this, node );68 }69 };70 71 29 template<typename node_t, bool has_location> 72 30 struct __GetCL; … … 74 32 template<typename node_t> 75 33 struct __GetCL<node_t, true> { 76 static CodeLocation const * get( node_t const * node ) { 34 static inline CodeLocation const * get( node_t const * node ) { 35 return &node->location; 36 } 37 38 static inline CodeLocation * get( node_t * node ) { 77 39 return &node->location; 78 40 } … … 81 43 template<typename node_t> 82 44 struct __GetCL<node_t, false> { 83 static CodeLocation const* get( node_t const * ) {45 static inline CodeLocation * get( node_t const * ) { 84 46 return nullptr; 85 47 } … … 90 52 return __GetCL< node_t, has_code_location< node_t >::value >::get( node ); 91 53 } 54 55 template<typename node_t> 56 CodeLocation * get_code_location( node_t * node ) { 57 return __GetCL< node_t, has_code_location< node_t >::value >::get( node ); 58 } 59 60 // Fill every location with a nearby (parent) location. 61 class FillCore : public ast::WithGuards { 62 CodeLocation const * parent; 63 public: 64 FillCore() : parent( nullptr ) {} 65 66 template<typename node_t> 67 node_t const * previsit( node_t const * node ) { 68 GuardValue( parent ); 69 CodeLocation const * location = get_code_location( node ); 70 if ( location && location->isUnset() ) { 71 assert( parent ); 72 node_t * newNode = ast::mutate( node ); 73 CodeLocation * newLocation = get_code_location( newNode ); 74 assert( newLocation ); 75 *newLocation = *parent; 76 parent = newLocation; 77 return newNode; 78 } else if ( location ) { 79 parent = location; 80 } 81 return node; 82 } 83 }; 92 84 93 85 // Collect pointers to all the nodes with unset code locations. -
tests/Makefile.am
r0f7a0ea r48f6252 68 68 .INTERMEDIATE: .validate .validate.cfa 69 69 EXTRA_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 70 92 71 93 avl_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 -
tests/pybin/tools.py
r0f7a0ea r48f6252 191 191 cmd = [s for s in cmd if s] 192 192 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) 193 204 194 205 def which(program): -
tests/test.py
r0f7a0ea r48f6252 143 143 parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int) 144 144 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') 145 146 parser.add_argument('-I','--include', help='Directory of test to include, can be used multiple time, All if omitted', action='append') 146 147 parser.add_argument('-E','--exclude', help='Directory of test to exclude, can be used multiple time, None if omitted', action='append') … … 155 156 156 157 # script must have at least some tests to run or be listing 157 listing = options.list or options.list_comp 158 listing = options.list or options.list_comp or options.list_dist 158 159 all_tests = options.all 159 160 some_tests = len(options.tests) > 0 … … 334 335 settings.init( options ) 335 336 336 # users may want to simply list the tests 337 # -------------------------------------------------- 338 # list all the test for auto completion programs 339 # not pretty, single line, with the command line options 337 340 if options.list_comp : 338 341 # fetch the liest of all valid tests … … 340 343 341 344 # print the possible options 342 print("-h --help --debug --dry-run --list --a rch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs -I --include -E --exclude --continue ", end='')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='') 343 346 print(" ".join(map(lambda t: "%s" % (t.target()), tests))) 344 347 345 elif options.list : 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 : 346 377 # fetch the liest of all valid tests 347 378 tests = list_tests( options.include, options.exclude ) … … 350 381 fancy_print("\n".join(map(lambda t: t.toString(), tests))) 351 382 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 352 394 else : 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 ) 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 )
Note: See TracChangeset
for help on using the changeset viewer.