move a bunch of tests from testcode/lib to test/val (and a failing one to test/todo)

This commit is contained in:
mrdudz
2020-07-13 21:25:13 +02:00
parent d940c9aa85
commit 882194c221
11 changed files with 0 additions and 0 deletions

29
test/val/signal-test.c Normal file
View File

@@ -0,0 +1,29 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
void __fastcall__ sighandler (int sig)
{
printf ("Got signal #%d\n", sig);
}
int main (void)
{
if (signal (SIGSEGV, sighandler) == SIG_ERR) {
printf ("signal failure %d: %s\n", errno, strerror (errno));
return 1;
}
printf ("About to raise SIGSEGV...\n");
raise (SIGSEGV);
printf ("Back from signal handler\n");
printf ("About to raise SIGILL...\n");
raise (SIGILL);
printf ("Back from signal handler\n");
return 0;
}