This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] LeakSanitizer testsuite
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Maxim Ostapenko <m dot ostapenko at partner dot samsung dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Yury Gribov <y dot gribov at samsung dot com>, Slava Garbuzov <v dot garbuzov at samsung dot com>
- Date: Mon, 24 Mar 2014 09:50:39 +0100
- Subject: Re: [PATCH] LeakSanitizer testsuite
- Authentication-results: sourceware.org; auth=none
- References: <532A892E dot 4010607 at partner dot samsung dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Mar 20, 2014 at 10:22:38AM +0400, Maxim Ostapenko wrote:
> Hi,
>
> This patch adds initial set of tests and dg infrastructure for
> LeakSanitizer runtime.
>
> Tested on x86_64.
>
> Ok to commit?
Are you sure we need testsuite for something that doesn't have a GCC code
generation counterpart at all?
In any case, this isn't ok for 4.9, we are too late in the development
cycle.
Perhaps it could go in during next stage1.
> --- /dev/null
> +++ b/gcc/testsuite/c-c++-common/lsan/fork.c
> @@ -0,0 +1,23 @@
> +// Test that thread local data is handled correctly after forking without exec().
> +/* { dg-do run } */
> +
> +#include <assert.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <sys/wait.h>
> +#include <unistd.h>
> +
> +__thread void *thread_local_var;
Tests using __thread should be guarded with
/* { dg-require-effective-target tls_runtime } */
Also, I wonder given the explicit uses of unistd.h if you just shouldn't
limit the test to *-*-linux* or similar.
> --- /dev/null
> +++ b/gcc/testsuite/c-c++-common/lsan/swapcontext-1.c
> @@ -0,0 +1,41 @@
> +// We can't unwind stack if we're running coroutines on heap-allocated
> +// memory. Make sure we don't report these leaks.
I guess setcontext/getcontext/makecontext is supported even on far fewer
OSes.
Jakub