diff --git a/test/tools/llvm-profdata/csprof-dump.test b/test/tools/llvm-profdata/csprof-dump.test index 39643dc38f2..a03b9d8a003 100644 --- a/test/tools/llvm-profdata/csprof-dump.test +++ b/test/tools/llvm-profdata/csprof-dump.test @@ -27,5 +27,5 @@ Roundtrip test: RUN: llvm-profdata merge -o %t.0.profdata %S/Inputs/CSIR_profile.proftext RUN: llvm-profdata merge -text -o %t.0.proftext %t.0.profdata -RUN: diff %t.0.proftext %S/Inputs/CSIR_profile.proftext +RUN: diff -b %t.0.proftext %S/Inputs/CSIR_profile.proftext diff --git a/test/tools/llvm-profdata/instr-remap.test b/test/tools/llvm-profdata/instr-remap.test index 159b7374ac3..27fddf60958 100644 --- a/test/tools/llvm-profdata/instr-remap.test +++ b/test/tools/llvm-profdata/instr-remap.test @@ -1,2 +1,2 @@ ; RUN: llvm-profdata merge -text %S/Inputs/instr-remap.proftext -r %S/Inputs/instr-remap.remap -o %t.output -; RUN: diff %S/Inputs/instr-remap.expected %t.output +; RUN: diff -b %S/Inputs/instr-remap.expected %t.output diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index 61d0c156105..158b168107f 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -456,7 +456,8 @@ int main(int argc, char **argv) { errs() << "Here's the assembly:\n" << *Composite; std::error_code EC; - ToolOutputFile Out(OutputFilename, EC, sys::fs::OF_None); + ToolOutputFile Out(OutputFilename, EC, + OutputAssembly ? sys::fs::OF_Text : sys::fs::OF_None); if (EC) { WithColor::error() << EC.message() << '\n'; return 1; diff --git a/tools/llvm-profdata/llvm-profdata.cpp b/tools/llvm-profdata/llvm-profdata.cpp index 122ffe73bf0..ad188b6a5e9 100644 --- a/tools/llvm-profdata/llvm-profdata.cpp +++ b/tools/llvm-profdata/llvm-profdata.cpp @@ -296,7 +296,9 @@ static void writeInstrProfile(StringRef OutputFilename, ProfileFormat OutputFormat, InstrProfWriter &Writer) { std::error_code EC; - raw_fd_ostream Output(OutputFilename.data(), EC, sys::fs::OF_None); + raw_fd_ostream Output(OutputFilename.data(), EC, + OutputFormat == PF_Text ? sys::fs::OF_Text + : sys::fs::OF_None); if (EC) exitWithErrorCode(EC, OutputFilename);