From db210912ad9f1feafdd788a9116429990865b1e7 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 15 Jul 2015 22:18:25 +0000 Subject: [PATCH] test-release.sh: Run both .o files through sed before comparing them On some systems (e.g. Mac OS X), sed will add a newline to the end of the output if there wasn't one already. This would cause false cmp errors since the .o file from Phase 2 was passed through sed and the one from Phase 3 wasn't. Work around this by passing both through sed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242341 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/release/test-release.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/release/test-release.sh b/utils/release/test-release.sh index 16a67e6d0c1..c622e269584 100755 --- a/utils/release/test-release.sh +++ b/utils/release/test-release.sh @@ -464,9 +464,10 @@ for Flavor in $Flavors ; do for p2 in `find $llvmCore_phase2_objdir -name '*.o'` ; do p3=`echo $p2 | sed -e 's,Phase2,Phase3,'` # Substitute 'Phase2' for 'Phase3' in the Phase 2 object file in - # case there are build paths in the debug info. - if ! cmp --ignore-initial=16 <(sed -e 's,Phase2,Phase3,g' $p2) $p3 \ - > /dev/null 2>&1 ; then + # case there are build paths in the debug info. On some systems, + # sed adds a newline to the output, so pass $p3 through sed too. + if ! cmp --ignore-initial=16 <(sed -e 's,Phase2,Phase3,g' $p2) \ + <(sed -e '' $p3) > /dev/null 2>&1 ; then echo "file `basename $p2` differs between phase 2 and phase 3" fi done -- 2.34.1