--- nono/exp/optestm88k/optestm88k_main.c 2026/04/29 17:04:57 1.1.1.1 +++ nono/exp/optestm88k/optestm88k_main.c 2026/04/29 17:05:00 1.1.1.2 @@ -20,7 +20,7 @@ int global_work[2]; #define exception_expected (global_work[1]) static void -sigfpe(int signo, siginfo_t *si, void *ctx) +signal_handler(int signo, siginfo_t *si, void *ctx) { if (si->si_signo == SIGFPE) { if (si->si_code == FPE_INTOVF) { @@ -30,6 +30,14 @@ sigfpe(int signo, siginfo_t *si, void *c exception_occurred = 2; return; } + printf("%s: signo=SIGFPE si_code=%x\n", __func__, si->si_code); + } + if (si->si_signo == SIGILL) { + if (si->si_code == ILL_ILLOPC) { + exception_occurred = 0x1000; + return; + } + printf("%s: signo=SIGILL si_code=%x\n", __func__, si->si_code); } // XXX exception_occurred = -1; @@ -53,9 +61,10 @@ main(int ac, char *av[]) struct sigaction act; memset(&act, 0, sizeof(act)); - act.sa_sigaction = sigfpe; + act.sa_sigaction = signal_handler; act.sa_flags = SA_SIGINFO; sigaction(SIGFPE, &act, NULL); + sigaction(SIGILL, &act, NULL); for (i = j = 0; test_table[i].code != NULL; i++, j = 0) { t = &test_table[i];