Added more userprog tests, mostly relating to boundary conditions
[pintos-anon] / src / tests / userprog / sc-boundary-3.c
1 /* Invokes a system call with the system call number positioned
2    such that its first byte is valid but the remaining bytes of
3    the number are in invalid memory. Must kill process. */
4
5 #include <syscall-nr.h>
6 #include "tests/userprog/boundary.h"
7 #include "tests/lib.h"
8 #include "tests/main.h"
9
10 void
11 test_main (void) 
12 {
13   char *p = get_bad_boundary ();
14   p--;
15   *p = 100;
16
17   /* Invoke the system call. */
18   asm volatile ("movl %0, %%esp; int $0x30" : : "g" (p));
19   fail ("should have killed process");
20 }