test-release.sh: Perform the sed substitution on both files (PR42739)
authorHans Wennborg <hans@hanshq.net>
Mon, 5 Aug 2019 13:04:12 +0000 (13:04 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 5 Aug 2019 13:04:12 +0000 (13:04 +0000)
The comparison would otherwise fail if Phase2 occurrs naturally in the
object file. It would get replaced with Phase3 in the one .o, but not
in the other.

We were already running both files through sed to have them processed in
this same way; this is a logical extension of that.

llvm-svn: 367847

llvm/utils/release/test-release.sh

index 558e01d..031687f 100755 (executable)
@@ -591,11 +591,12 @@ 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. On some systems,
-            # sed adds a newline to the output, so pass $p3 through sed too.
+            # case there are build paths in the debug info. Do the same sub-
+            # stitution on both files in case the string occurrs naturally.
             if ! cmp -s \
                 <(env LC_CTYPE=C sed -e 's,Phase2,Phase3,g' -e 's,Phase1,Phase2,g' $p2) \
-                <(env LC_CTYPE=C sed -e '' $p3) 16 16; then
+                <(env LC_CTYPE=C sed -e 's,Phase2,Phase3,g' -e 's,Phase1,Phase2,g' $p3) \
+                16 16; then
                 echo "file `basename $p2` differs between phase 2 and phase 3"
             fi
         done