summaryrefslogtreecommitdiff
path: root/test/setjmp/jmpbug.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-11-16 21:47:57 +0000
committerMike Frysinger <vapier@gentoo.org>2006-11-16 21:47:57 +0000
commitc9929dd5ddc6e6d4eca08785aad7f6c543b06565 (patch)
tree779e3348125cf4ae007790518cff1788bf295e0d /test/setjmp/jmpbug.c
parentd709a4787df1319567bfc64993225f6280ddcf0a (diff)
make default output silence and have the exit status indicate error
Diffstat (limited to 'test/setjmp/jmpbug.c')
-rw-r--r--test/setjmp/jmpbug.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/setjmp/jmpbug.c b/test/setjmp/jmpbug.c
index 125977b2f..4337e527a 100644
--- a/test/setjmp/jmpbug.c
+++ b/test/setjmp/jmpbug.c
@@ -4,6 +4,9 @@
#include <setjmp.h>
#include <alloca.h>
+int ret;
+int verbose;
+
static void
sub5 (jmp_buf buf)
{
@@ -17,10 +20,14 @@ test (int x)
char *foo;
int arr[100];
+ ++ret;
+
arr[77] = x;
if (setjmp (buf))
{
- printf ("made it ok; %d\n", arr[77]);
+ --ret;
+ if (verbose)
+ printf ("made it ok; %d\n", arr[77]);
return;
}
@@ -29,12 +36,15 @@ test (int x)
}
int
-main (void)
+main (int argc, char *argv[])
{
int i;
+ verbose = (argc != 1);
+ ret = 0;
+
for (i = 123; i < 345; ++i)
test (i);
- return 0;
+ return ret;
}