summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-18 22:35:56 +0000
committerDan Gohman <gohman@apple.com>2010-08-18 22:35:56 +0000
commit492c2ea31ee1da26199a67d14eb2abe3a524e366 (patch)
tree4bbd20c9a302da10f1114dd2f2d410e8d9dd13af
parent2dd19f1d5f927a4d32e5cb074b6c4f2c0d1d6363 (diff)
downloadbcm5719-llvm-492c2ea31ee1da26199a67d14eb2abe3a524e366.tar.gz
bcm5719-llvm-492c2ea31ee1da26199a67d14eb2abe3a524e366.zip
Add a testcase to verify that commands don't crash when they hit
errors on stderr. llvm-svn: 111440
-rw-r--r--llvm/test/Other/close-stderr.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Other/close-stderr.ll b/llvm/test/Other/close-stderr.ll
new file mode 100644
index 00000000000..ced32a8be33
--- /dev/null
+++ b/llvm/test/Other/close-stderr.ll
@@ -0,0 +1,9 @@
+; RUN: sh -c "\
+; RUN: opt --reject-this-option 2>&-; echo $?; \
+; RUN: opt -o /dev/null /dev/null 2>&-; echo $?; \
+; RUN: " | FileCheck %s
+; CHECK: {{^1$}}
+; CHECK: {{^0$}}
+
+; Test that the error handling when writing to stderr fails exits the
+; program cleanly rather than aborting.
OpenPOWER on IntegriCloud