mirror of
https://github.com/golang/go
synced 2024-11-21 21:34:40 -07:00
parent
11e254e62c
commit
16cdba8572
15
test/errchk
15
test/errchk
@ -17,6 +17,13 @@
|
||||
|
||||
use POSIX;
|
||||
|
||||
my $exitcode = 1;
|
||||
|
||||
if(@ARGV >= 1 && $ARGV[0] eq "-0") {
|
||||
$exitcode = 0;
|
||||
shift;
|
||||
}
|
||||
|
||||
if(@ARGV < 1) {
|
||||
print STDERR "Usage: errchk COMPILER [OPTS] SOURCEFILES\n";
|
||||
exit 1;
|
||||
@ -47,12 +54,18 @@ $out = join('', <CMD>);
|
||||
|
||||
close CMD;
|
||||
|
||||
if($? == 0) {
|
||||
if($exitcode != 0 && $? == 0) {
|
||||
print STDERR "BUG: errchk: command succeeded unexpectedly\n";
|
||||
print STDERR @out;
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if($exitcode == 0 && $? != 0) {
|
||||
print STDERR "BUG: errchk: command failed unexpectedly\n";
|
||||
print STDERR @out;
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if(!WIFEXITED($?)) {
|
||||
print STDERR "BUG: errchk: compiler crashed\n";
|
||||
print STDERR @out, "\n";
|
||||
|
Loading…
Reference in New Issue
Block a user