compiler/mlib/complex.h: fix creal*() macro; list functions in alphabetic order
[AROS.git] / test / dos / exit.c
blob5ab75ab7d19b3ea309e580c8476d47a70504bbd4
1 #include <proto/exec.h>
2 #include <proto/dos.h>
4 struct DosLibrary *DOSBase;
5 static unsigned int level = 0;
7 void test()
9 Printf("Nest level: %lu\n", ++level);
11 if (level < 20)
12 test();
14 Exit(0);
15 Printf("Exit() did not work!\n");
18 AROS_ENTRY(__startup static int, Start,
19 AROS_UFHA(char *, argstr, A0),
20 AROS_UFHA(ULONG, argsize, D0),
21 struct ExecBase *, SysBase)
23 AROS_USERFUNC_INIT
25 struct Process *me;
26 IPTR *stackbase;
28 DOSBase = (struct DosLibrary *)OpenLibrary("dos.library", 36);
29 if (!DOSBase)
30 return RETURN_FAIL;
32 /* Let's check correctness of stack size passing */
33 me = (struct Process *)FindTask(NULL);
34 stackbase = me->pr_ReturnAddr;
35 Printf("Launch stack size is %ld, total size is %ld\n", stackbase[0], me->pr_Task.tc_SPUpper - me->pr_Task.tc_SPLower);
37 test();
39 CloseLibrary(&DOSBase->dl_lib);
40 return RETURN_OK;
42 AROS_USERFUNC_EXIT