[llvm-commits] [llvm] r111440 - /llvm/trunk/test/Other/close-stderr.ll

Dan Gohman gohman at apple.com
Thu Aug 19 18:25:08 PDT 2010


What kind of unit test would you suggest? This kind of test
doesn't seem to fit easily into the main harnesses.

Dan

On Aug 19, 2010, at 10:14 AM, Daniel Dunbar wrote:

> Hi Dan,
> 
> Can you rewrite this as a unit test instead?
> 
> - Daniel
> 
> On Wed, Aug 18, 2010 at 3:35 PM, Dan Gohman <gohman at apple.com> wrote:
>> Author: djg
>> Date: Wed Aug 18 17:35:56 2010
>> New Revision: 111440
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=111440&view=rev
>> Log:
>> Add a testcase to verify that commands don't crash when they hit
>> errors on stderr.
>> 
>> Added:
>>    llvm/trunk/test/Other/close-stderr.ll
>> 
>> Added: llvm/trunk/test/Other/close-stderr.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/close-stderr.ll?rev=111440&view=auto
>> ==============================================================================
>> --- llvm/trunk/test/Other/close-stderr.ll (added)
>> +++ llvm/trunk/test/Other/close-stderr.ll Wed Aug 18 17:35:56 2010
>> @@ -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.





More information about the llvm-commits mailing list