On Wed, Apr 11, 2018 at 01:59:40PM -0400, Jason Merrill wrote:
> And this one puts the check in asan_init rather than its users.  OK?

tsan tests have the same problem.  Wouldn't it be better to have a helper
procedure for this and use it next to
if [check_effective_target_fsanitize_address] {
or fsanitize_thread
in g*.dg/[at]san/[at]san.exp?
What exactly does return -code return?  asan_init is invoked after dg-init
and so I'd be afraid dg-finish which should be done will not be invoked.

> commit 8b2e4c11607171426da477d6a81225e333c0b735
> Author: Jason Merrill <ja...@redhat.com>
> Date:   Fri Mar 23 11:14:50 2018 -0400
> 
>             * lib/asan-dg.exp (asan_init): Don't run tests if ulimit -v is 
> set.
> 
> diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp
> index 25f1de45879..11a96ad000a 100644
> --- a/gcc/testsuite/lib/asan-dg.exp
> +++ b/gcc/testsuite/lib/asan-dg.exp
> @@ -89,6 +89,17 @@ proc asan_init { args } {
>      global asan_saved_TEST_ALWAYS_FLAGS
>      global asan_saved_ALWAYS_CXXFLAGS
>  
> +    # asan doesn't work if there's a ulimit on virtual memory.
> +    if ![is_remote target] {
> +     if [catch {exec sh -c "ulimit -v"} ulimit_v] {
> +         # failed to get ulimit
> +     } elseif [regexp {^[0-9]+$} $ulimit_v] {
> +         # ulimit -v gave a numeric limit
> +         warning "skipping asan tests due to ulimit -v"
> +         return -code return
> +     }
> +    }
> +
>      set link_flags ""
>      if ![is_remote host] {
>       if [info exists TOOL_OPTIONS] {


        Jakub

Reply via email to