test-release.sh: Run both .o files through sed before comparing them
[oota-llvm.git] / utils / release / test-release.sh
index 16a67e6d0c1ea291e33f35237cb70ecbfcfa7b4d..c622e269584048e3da79514acac844fd0fc3129a 100755 (executable)
@@ -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