aboutsummaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2022-02-27 00:16:24 +0200
committerMartin Storsjö <martin@martin.st>2022-03-03 13:31:31 +0200
commit9e2236fb7bd0177024f396d44ed208c46218ca6a (patch)
tree86a066d6ca508674e5b07e104ea618eede8d89b0 /llvm
parentdf1e43c496b43e998f66c610b0e15a0951f316b3 (diff)
downloadllvm-9e2236fb7bd0177024f396d44ed208c46218ca6a.zip
llvm-9e2236fb7bd0177024f396d44ed208c46218ca6a.tar.gz
llvm-9e2236fb7bd0177024f396d44ed208c46218ca6a.tar.bz2
Reapply [lit] Read command stdout/stderr as text on Windows
This takes care of normalizing newlines back to single LF instead of CRLF. Fix up a couple tests that accidentally pass binary data to stdout. Differential Revision: https://reviews.llvm.org/D120623
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/MC/ELF/diff2.s2
-rw-r--r--llvm/test/MC/Mips/relocation-xfail.s2
-rw-r--r--llvm/test/Other/cfg-printer-branch-weights-percent.ll2
-rw-r--r--llvm/test/Other/cfg-printer-branch-weights.ll2
-rw-r--r--llvm/test/Other/cfg-printer-filter.ll4
-rw-r--r--llvm/test/Other/cfg_deopt_unreach.ll8
-rw-r--r--llvm/utils/lit/lit/TestRunner.py4
7 files changed, 13 insertions, 11 deletions
diff --git a/llvm/test/MC/ELF/diff2.s b/llvm/test/MC/ELF/diff2.s
index 4a9fbd1..625b300 100644
--- a/llvm/test/MC/ELF/diff2.s
+++ b/llvm/test/MC/ELF/diff2.s
@@ -1,4 +1,4 @@
-// RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s 2> %t
+// RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s 2> %t > /dev/null
// RUN: FileCheck -input-file %t %s
.global zed
diff --git a/llvm/test/MC/Mips/relocation-xfail.s b/llvm/test/MC/Mips/relocation-xfail.s
index 25db54a..4bb3502 100644
--- a/llvm/test/MC/Mips/relocation-xfail.s
+++ b/llvm/test/MC/Mips/relocation-xfail.s
@@ -1,5 +1,5 @@
// RUN: llvm-mc -filetype=obj -triple mips-unknown-linux -mattr=+micromips < %s \
-// RUN: | llvm-readobj --sections --section-data \
+// RUN: | llvm-readobj --sections --section-data - \
// RUN: | FileCheck -check-prefix=DATA %s
//
// XFAIL: *
diff --git a/llvm/test/Other/cfg-printer-branch-weights-percent.ll b/llvm/test/Other/cfg-printer-branch-weights-percent.ll
index d1a647d..b7e82aa 100644
--- a/llvm/test/Other/cfg-printer-branch-weights-percent.ll
+++ b/llvm/test/Other/cfg-printer-branch-weights-percent.ll
@@ -1,4 +1,4 @@
-;RUN: opt < %s -dot-cfg -cfg-weights -cfg-dot-filename-prefix=%t 2>/dev/null
+;RUN: opt < %s -dot-cfg -cfg-weights -cfg-dot-filename-prefix=%t 2>/dev/null > /dev/null
;RUN: FileCheck %s -input-file=%t.f.dot
define void @f(i32) {
diff --git a/llvm/test/Other/cfg-printer-branch-weights.ll b/llvm/test/Other/cfg-printer-branch-weights.ll
index 52dfd20..bf32f2e 100644
--- a/llvm/test/Other/cfg-printer-branch-weights.ll
+++ b/llvm/test/Other/cfg-printer-branch-weights.ll
@@ -1,4 +1,4 @@
-;RUN: opt < %s -dot-cfg -cfg-weights -cfg-raw-weights -cfg-dot-filename-prefix=%t 2>/dev/null
+;RUN: opt < %s -dot-cfg -cfg-weights -cfg-raw-weights -cfg-dot-filename-prefix=%t 2>/dev/null > /dev/null
;RUN: FileCheck %s -input-file=%t.f.dot
define void @f(i32) {
diff --git a/llvm/test/Other/cfg-printer-filter.ll b/llvm/test/Other/cfg-printer-filter.ll
index 0d3bf3d..e4089c1 100644
--- a/llvm/test/Other/cfg-printer-filter.ll
+++ b/llvm/test/Other/cfg-printer-filter.ll
@@ -1,12 +1,12 @@
; RUN: rm -f %t.other.dot %t-only.other.dot
;; Both f and func are dumped because their names contain the pattern 'f' as a substring.
-; RUN: opt < %s -dot-cfg -cfg-dot-filename-prefix=%t -cfg-func-name=f 2>/dev/null
+; RUN: opt < %s -dot-cfg -cfg-dot-filename-prefix=%t -cfg-func-name=f 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t.f.dot -check-prefix=F
; RUN: FileCheck %s -input-file=%t.func.dot -check-prefix=Func
; RUN: not test -f %t.other.dot
-; RUN: opt < %s -dot-cfg-only -cfg-dot-filename-prefix=%t-only -cfg-func-name=f 2>/dev/null
+; RUN: opt < %s -dot-cfg-only -cfg-dot-filename-prefix=%t-only -cfg-func-name=f 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t-only.f.dot -check-prefix=F
; RUN: FileCheck %s -input-file=%t-only.func.dot -check-prefix=Func
; RUN: not test -f %t-only.other.dot
diff --git a/llvm/test/Other/cfg_deopt_unreach.ll b/llvm/test/Other/cfg_deopt_unreach.ll
index 2aa0433..1cde68b 100644
--- a/llvm/test/Other/cfg_deopt_unreach.ll
+++ b/llvm/test/Other/cfg_deopt_unreach.ll
@@ -1,12 +1,12 @@
; RUN: rm -rf %t
; RUN: mkdir -p %t
-; RUN: opt < %s -dot-cfg -cfg-hide-unreachable-paths -cfg-dot-filename-prefix=%t/unreach 2>/dev/null
+; RUN: opt < %s -dot-cfg -cfg-hide-unreachable-paths -cfg-dot-filename-prefix=%t/unreach 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t/unreach.callee.dot -check-prefix=UNREACH
-; RUN: opt < %s -dot-cfg -cfg-hide-deoptimize-paths -cfg-dot-filename-prefix=%t/deopt 2>/dev/null
+; RUN: opt < %s -dot-cfg -cfg-hide-deoptimize-paths -cfg-dot-filename-prefix=%t/deopt 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t/deopt.callee.dot -check-prefix=DEOPT
-; RUN: opt < %s -dot-cfg -cfg-dot-filename-prefix=%t/no-flags 2>/dev/null
+; RUN: opt < %s -dot-cfg -cfg-dot-filename-prefix=%t/no-flags 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t/no-flags.callee.dot -check-prefix=NO-FLAGS
-; RUN: opt < %s -dot-cfg -cfg-hide-unreachable-paths -cfg-hide-deoptimize-paths -cfg-dot-filename-prefix=%t/both-flags 2>/dev/null
+; RUN: opt < %s -dot-cfg -cfg-hide-unreachable-paths -cfg-hide-deoptimize-paths -cfg-dot-filename-prefix=%t/both-flags 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t/both-flags.callee.dot -check-prefix=BOTH-FLAGS
declare i8 @llvm.experimental.deoptimize.i8(...)
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 35afa03..c95ccc7 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -783,7 +783,9 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
stdout = stdout,
stderr = stderr,
env = cmd_shenv.env,
- close_fds = kUseCloseFDs))
+ close_fds = kUseCloseFDs,
+ universal_newlines = True,
+ errors = 'replace'))
proc_not_counts.append(not_count)
# Let the helper know about this process
timeoutHelper.addProcess(procs[-1])