add test for portability (kahansei_kojo in dev_V)

This commit is contained in:
Ken Sato
2017-11-28 17:55:23 +09:00
parent aebacb243e
commit c3c9187ed5
4 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#define ARRAY_SIZE 10
void handler(int sig) {
printf("[OK] unhandled_page_fault_01: received SIGSEGV\n");
exit(0);
}
int main(int argc, char** argv){
int* test = NULL;
signal(SIGSEGV, handler);
printf("try to access out of range!\n");
*test = 99;
return 0;
}