Check for SYS/GL during library init. Reason is that
[AROS.git] / test / exec / traptest.c
blob9d8c8c8b8ebe831d9e043e1760a07ebcd59b9e6b
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
10 int main(int argc, char **argv)
12 int a, b, c;
13 int do_illegal = 0;
14 int *ptr = (unsigned int *)0xABADC0DE;
16 if (argc > 1)
18 if (!stricmp("illegal", argv[1]))
20 do_illegal = 1;
21 if (argc > 2)
22 ptr = (int *)atol(argv[2]);
26 if (!do_illegal)
28 a = 3;
29 b = 0;
30 printf("Attempting to divide by zero...\n");
31 c = a/b;
32 printf("Done, result is: %d!\n", c);
35 printf("Trying illegal access at 0x%p now...\n", ptr);
36 a = *ptr;
37 printf("Done, result is: %d!\n", a);
39 return 0;