Commit cbdbb7713da116f2ba534470de6707bc0f8cc91b
1 parent
4f400ab5
Add small testcase for ordinary signals.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3998 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
27 additions
and
0 deletions
tests/cris/Makefile
| @@ -114,6 +114,7 @@ TESTCASES += check_mapbrk.ctst | @@ -114,6 +114,7 @@ TESTCASES += check_mapbrk.ctst | ||
| 114 | TESTCASES += check_mmap1.ctst | 114 | TESTCASES += check_mmap1.ctst |
| 115 | TESTCASES += check_mmap2.ctst | 115 | TESTCASES += check_mmap2.ctst |
| 116 | TESTCASES += check_mmap3.ctst | 116 | TESTCASES += check_mmap3.ctst |
| 117 | +TESTCASES += check_sigalrm.ctst | ||
| 117 | TESTCASES += check_time1.ctst | 118 | TESTCASES += check_time1.ctst |
| 118 | TESTCASES += check_time2.ctst | 119 | TESTCASES += check_time2.ctst |
| 119 | 120 |
tests/cris/check_sigalrm.c
0 → 100644
| 1 | +#include <stdio.h> | ||
| 2 | +#include <stdlib.h> | ||
| 3 | +#include <signal.h> | ||
| 4 | +#include <unistd.h> | ||
| 5 | + | ||
| 6 | +#define MAGIC (0xdeadbeef) | ||
| 7 | + | ||
| 8 | +int s = 0; | ||
| 9 | +void sighandler(int sig) | ||
| 10 | +{ | ||
| 11 | + s = MAGIC; | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +int main(int argc, char **argv) | ||
| 15 | +{ | ||
| 16 | + int p; | ||
| 17 | + | ||
| 18 | + p = getpid(); | ||
| 19 | + signal(SIGALRM, sighandler); | ||
| 20 | + kill(p, SIGALRM); | ||
| 21 | + if (s != MAGIC) | ||
| 22 | + return EXIT_FAILURE; | ||
| 23 | + | ||
| 24 | + printf ("passed\n"); | ||
| 25 | + return EXIT_SUCCESS; | ||
| 26 | +} |