llvm.org GIT mirror llvm / 1adc215
Compare the .o files only for release builds. Add an option to bypass the comparison altogether. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153909 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 7 years ago
1 changed file(s) with 26 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
3434 do_64bit="yes"
3535 do_debug="no"
3636 do_asserts="no"
37 do_compare="yes"
3738 BuildDir="`pwd`"
3839
3940 function usage() {
5354 echo " -disable-objc Disable ObjC build. [default: enable]"
5455 echo " -test-debug Test the debug build. [default: no]"
5556 echo " -test-asserts Test with asserts on. [default: no]"
57 echo " -no-compare-files Don't test that phase 2 and 3 files are identical."
5658 }
5759
5860 while [ $# -gt 0 ]; do
106108 ;;
107109 -test-asserts | --test-asserts )
108110 do_asserts="yes"
111 ;;
112 -no-compare-files | --no-compare-files )
113 do_compare="no"
109114 ;;
110115 -help | --help | -h | --h | -\? )
111116 usage
402407
403408 # Test clang
404409 if [ "$do_clang" = "yes" ]; then
405 ############################################################################
410 ########################################################################
406411 # Phase 2: Build llvmCore with newly built clang from phase 1.
407412 c_compiler=$llvmCore_phase1_installdir/bin/clang
408413 cxx_compiler=$llvmCore_phase1_installdir/bin/clang++
412417 build_llvmCore 2 $Flavor \
413418 $llvmCore_phase2_objdir
414419
415 ############################################################################
420 ########################################################################
416421 # Phase 3: Build llvmCore with newly built clang from phase 2.
417422 c_compiler=$llvmCore_phase2_installdir/bin/clang
418423 cxx_compiler=$llvmCore_phase2_installdir/bin/clang++
422427 build_llvmCore 3 $Flavor \
423428 $llvmCore_phase3_objdir
424429
425 ############################################################################
430 ########################################################################
426431 # Testing: Test phase 3
427432 echo "# Testing - built with clang"
428433 test_llvmCore 3 $Flavor $llvmCore_phase3_objdir
429434
430 ############################################################################
431 # Compare .o files between Phase2 and Phase3 and report which ones differ.
432 echo
433 echo "# Comparing Phase 2 and Phase 3 files"
434 for o in `find $llvmCore_phase2_objdir -name '*.o'` ; do
435 p3=`echo $o | sed -e 's,Phase2,Phase3,'`
436 if ! cmp --ignore-initial=16 $o $p3 > /dev/null 2>&1 ; then
437 echo "file `basename $o` differs between phase 2 and phase 3"
435 ########################################################################
436 # Compare .o files between Phase2 and Phase3 and report which ones
437 # differ.
438 if [ "$do_compare" = "yes" ]; then
439 if [ "$Flavor" = "Release" -o "$Flavor" = "Release-64" ]; then
440 echo
441 echo "# Comparing Phase 2 and Phase 3 files"
442 for o in `find $llvmCore_phase2_objdir -name '*.o'` ; do
443 p3=`echo $o | sed -e 's,Phase2,Phase3,'`
444 if ! cmp --ignore-initial=16 $o $p3 > /dev/null 2>&1 ; then
445 echo "file `basename $o` differs between phase 2 and phase 3"
446 fi
447 done
438448 fi
439 done
449 fi
440450 fi
441451
442452 # Test dragonegg
449459 cxx_compiler="$gxx_compiler"
450460 build_dragonegg 1 $Flavor $llvmCore_phase1_installdir $dragonegg_phase1_objdir
451461
452 ############################################################################
462 ########################################################################
453463 # Phase 2: Build llvmCore with newly built dragonegg from phase 1.
454464 c_compiler="$gcc_compiler -fplugin=$dragonegg_phase1_objdir/dragonegg.so"
455465 cxx_compiler="$gxx_compiler -fplugin=$dragonegg_phase1_objdir/dragonegg.so"
460470 $llvmCore_de_phase2_objdir
461471 build_dragonegg 2 $Flavor $llvmCore_de_phase2_installdir $dragonegg_phase2_objdir
462472
463 ############################################################################
473 ########################################################################
464474 # Phase 3: Build llvmCore with newly built clang from phase 2.
465475 c_compiler="$gcc_compiler -fplugin=$dragonegg_phase2_objdir/dragonegg.so"
466476 cxx_compiler="$gxx_compiler -fplugin=$dragonegg_phase2_objdir/dragonegg.so"
471481 $llvmCore_de_phase3_objdir
472482 build_dragonegg 3 $Flavor $llvmCore_de_phase3_installdir $dragonegg_phase3_objdir
473483
474 ############################################################################
484 ########################################################################
475485 # Testing: Test phase 3
476486 c_compiler="$gcc_compiler -fplugin=$dragonegg_phase3_objdir/dragonegg.so"
477487 cxx_compiler="$gxx_compiler -fplugin=$dragonegg_phase3_objdir/dragonegg.so"
478488 echo "# Testing - built with dragonegg"
479489 test_llvmCore 3 $Flavor $llvmCore_de_phase3_objdir
480490
481 ############################################################################
491 ########################################################################
482492 # Compare .o files between Phase2 and Phase3 and report which ones differ.
483493 echo
484494 echo "# Comparing Phase 2 and Phase 3 files"