From 740f9751fbd5ab7475cd358a6f60e4ab04b923cd Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Mon, 4 Jul 2016 16:19:03 +0000 Subject: [testsuite] asan/clone-test-1.c: Handle clone() failure 2016-07-04 Christophe Lyon * c-c++-common/asan/clone-test-1.c (main): Handle clone() failure. From-SVN: r237987 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/c-c++-common/asan/clone-test-1.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 59a437c..9066d0f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-07-04 Christophe Lyon + + * c-c++-common/asan/clone-test-1.c (main): Handle clone() failure. + 2016-07-04 Dominik Vogt * gcc.target/s390/vector/vec-scalar-cmp-1.c: Expect lochi instead of diff --git a/gcc/testsuite/c-c++-common/asan/clone-test-1.c b/gcc/testsuite/c-c++-common/asan/clone-test-1.c index eeca09f..c58c376 100644 --- a/gcc/testsuite/c-c++-common/asan/clone-test-1.c +++ b/gcc/testsuite/c-c++-common/asan/clone-test-1.c @@ -29,6 +29,10 @@ int main(int argc, char **argv) { char *sp = child_stack + kStackSize; /* Stack grows down. */ printf("Parent: %p\n", sp); pid_t clone_pid = clone(Child, sp, CLONE_FILES | CLONE_VM, NULL, 0, 0, 0); + if (clone_pid == -1) { + perror("clone"); + return 1; + } int status; pid_t wait_result = waitpid(clone_pid, &status, __WCLONE); if (wait_result < 0) { -- cgit v1.1