Files
Digital-Research-Source-Code/CPM OPERATING SYSTEMS/CPM 68K/1.2 SOURCE/14/STJPTST.C
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

60 lines
1.1 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
This program tests DRC/rtl setjmp & longjmp functions.
program written by Bill Fitler
modified by Ken Chai 20-Dec-83
*/
#include <stdio.h>
#include <setjmp.h>
#include "bugdefs.h"
jmp_buf env;
GLOBAL WORD i;
GLOBAL BYTE *model, *bugnum="stjptst: \ttest of setjmp & longjmp\
\n\t\t\t" ;
main()
{
EXTERN WORD i;
WORD xret,ret;
printf("\n\tThis routine tests SETJMP & LONGJMP\n");
i = 0;
xret= setjmp(env);
printf("\n\tXRET= %d",xret);
if (xret != 0)
{
ASSERT(TRUE) ;
printf("\n\tExiting test routine");
exit();
} /* if (xret != 0) */
recur();
} /* stjptst main function */
recur()
{
EXTERN WORD i;
WORD ret;
while(i <= 100)
{
i +=1;
recur();
} /* while(i <= 100) */
longjmp(env,ret);
} /* recur */
00) */
longjmp(env,ret);
} /* recur */
00) */
longjmp(env,ret);
} /* recur */