Move the Darwin _nocancel tests to a different file so they can be tested

properly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10296
This commit is contained in:
Nicholas Nethercote 2009-06-10 23:09:40 +00:00
parent 7a095f31f3
commit a391386bc6
6 changed files with 76 additions and 36 deletions

View File

@ -8,10 +8,14 @@ noinst_HEADERS = scalar.h
EXTRA_DIST = $(noinst_SCRIPTS) \
scalar.stderr.exp scalar.vgtest \
scalar_fork.stderr.exp scalar_fork.vgtest \
scalar_nocancel.stderr.exp scalar_nocancel.vgtest \
scalar_vfork.stderr.exp scalar_vfork.vgtest
check_PROGRAMS = \
scalar scalar_fork scalar_vfork
scalar \
scalar_fork \
scalar_nocancel \
scalar_vfork
AM_CFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)

View File

@ -518,46 +518,16 @@ int main(void)
// __NR___mac_set_lctx 393
// __NR_setlcid 394
// __NR_getlcid 395
// __NR_read_nocancel 396
// __NR_write_nocancel 397
// __NR_open_nocancel 398
// __NR_close_nocancel 399
// __NR_wait4_nocancel 400
// __NR_recvmsg_nocancel 401
// __NR_sendmsg_nocancel 402
// __NR_recvfrom_nocancel 403
// __NR_accept_nocancel 404
// __NR_msync_nocancel 405
// __NR_fcntl_nocancel 406
// __NR_select_nocancel 407
// __NR_fsync_nocancel 408
// __NR_connect_nocancel 409
// __NR_sigsuspend_nocancel 410
// __NR_readv_nocancel 411
// __NR_writev_nocancel 412
// __NR_sendto_nocancel 413
// __NR_pread_nocancel 414
// __NR_pwrite_nocancel 415
// __NR_waitid_nocancel 416
// __NR_poll_nocancel 417
// __NR_msgsnd_nocancel 418
// __NR_msgrcv_nocancel 419
// __NR_sem_wait_nocancel 420
// The error doesn't appear because it's a dup of the one from sem_wait.
GO(__NR_sem_wait_nocancel, "0s* 0m");
SY(__NR_sem_wait_nocancel, x0); FAIL;
// The nocancel syscalls (396--423) are tested in scalar_nocancel.c.
// __NR_aio_suspend_nocancel 421
// __NR___sigwait_nocancel 422
// __NR___semwait_signal_nocancel 423
// __NR___mac_mount 424
// __NR___mac_get_mount 425
// __NR___mac_getfsstat 426
// __NR_MAXSYSCALL 427
#if 0
// XXX: all these are copied from x86-darwin/scalar.c.
// XXX: all these are copied from x86-linux/scalar.c.
// __NR_open 5
GO(__NR_open, "(2-args) 2s 1m");

View File

@ -358,9 +358,6 @@ Syscall param lstat64_extended(fsacl) points to unaddressable byte(s)
...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-----------------------------------------------------
x20001a4(420):__NR_sem_wait_nocancel 0s* 0m
-----------------------------------------------------
-----------------------------------------------------
x270f(9999): 9999 1e
-----------------------------------------------------
WARNING: unhandled syscall: unix:9999

View File

@ -0,0 +1,61 @@
#include "../../memcheck.h"
#include "scalar.h"
#include <unistd.h>
#include <sched.h>
#include <signal.h>
#include <sys/shm.h>
// See memcheck/tests/x86-linux/scalar.c for an explanation of what this test
// is doing.
int main(void)
{
// uninitialised, but we know px[0] is 0x0
long* px = malloc(sizeof(long));
long x0 = px[0];
long res;
VALGRIND_MAKE_MEM_NOACCESS(0, 0x1000);
// The nocancel syscalls all use the same wrappers as the corresponding
// non-nocancel syscall. This means that if we try to test both in the
// same file, the nocancel ones won't result in errors being generated
// because errors are too similar. So we test them in this separate file.
// __NR_read_nocancel 396
// __NR_write_nocancel 397
// __NR_open_nocancel 398
// __NR_close_nocancel 399
// __NR_wait4_nocancel 400
// __NR_recvmsg_nocancel 401
// __NR_sendmsg_nocancel 402
// __NR_recvfrom_nocancel 403
// __NR_accept_nocancel 404
// __NR_msync_nocancel 405
// __NR_fcntl_nocancel 406
// __NR_select_nocancel 407
// __NR_fsync_nocancel 408
// __NR_connect_nocancel 409
// __NR_sigsuspend_nocancel 410
// __NR_readv_nocancel 411
// __NR_writev_nocancel 412
// __NR_sendto_nocancel 413
// __NR_pread_nocancel 414
// __NR_pwrite_nocancel 415
// __NR_waitid_nocancel 416
// __NR_poll_nocancel 417
// __NR_msgsnd_nocancel 418
// __NR_msgrcv_nocancel 419
// __NR_sem_wait_nocancel 420
// The error doesn't appear because it's a dup of the one from sem_wait.
GO(__NR_sem_wait_nocancel, "1s 0m");
SY(__NR_sem_wait_nocancel, x0); FAIL;
// __NR_aio_suspend_nocancel 421
// __NR___sigwait_nocancel 422
// __NR___semwait_signal_nocancel 423
return 0;
}

View File

@ -0,0 +1,5 @@
-----------------------------------------------------
x20001a4(420):__NR_sem_wait_nocancel 1s 0m
-----------------------------------------------------
Syscall param sem_wait(sem) contains uninitialised byte(s)
...

View File

@ -0,0 +1,3 @@
prog: scalar_nocancel
vgopts: -q --error-limit=no
args: < scalar_nocancel.c