Bring back darwin hosted port to live, might also work for android hosted but is...
[AROS.git] / test / exec / traptest.c
blob802e1d384022db8eebbd8d3a680aaf25ec474e0f
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
5 int main(int argc, char **argv)
7 int a, b, c;
8 int do_illegal = 0;
9 int *ptr = (unsigned int *)0xABADC0DE;
11 if (argc > 1)
13 if (!stricmp("illegal", argv[1]))
15 do_illegal = 1;
16 if (argc > 2)
17 ptr = (int *)atol(argv[2]);
21 if (!do_illegal)
23 a = 3;
24 b = 0;
25 printf("Attempting to divide by zero...\n");
26 c = a/b;
27 printf("Done, result is: %d!\n", c);
30 printf("Trying illegal access at 0x%p now...\n", ptr);
31 a = *ptr;
32 printf("Done, result is: %d!\n", a);
34 return 0;