On Mon, Dec 17, 2012 at 03:42:59PM +0100, Jakub Jelinek wrote:
> On Sun, Dec 16, 2012 at 04:19:11PM -0500, Jack Howarth wrote:
> > 2012-12-16  Jack Howarth <howa...@bromo.med.uc.edu>
> > 
> >     PR sanitizer/55679
> >     * g++.dg/asan/interception-test-1.C: Skip on darwin.
> >     * lib/target-supports.exp (check_effective_target_swapcontext): Use
> >     check_no_compiler_messages to test support in ucontext.h.
> 
> The above two changes were already approved, just check those in.
> 
> >     * c-c++-common/asan/rlimit-mmap-test-1.c: Likewise.
> 
> This doesn't look right.  Either you should add code testing for
> RLIMIT_AS presence into the setrlimit effective target proc, or
> add setrlimit_as as another effective target.  If we want to have more such
> tests in the future, we don't want to augment all those tests with
> dg-skip-if for broken targets.

Jakub,
      On darwin in /usr/include/sys/resource.h, we have...

#define RLIMIT_AS       5               /* address space (resident set size) */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define RLIMIT_RSS      RLIMIT_AS       /* source compatibility alias */

so I guess we could craft a setrlimit effective target proc which checks
if RLIMIT_AS has the same rlimit ID as RLIMIT_RSS. Any suggestions on how
to implement such a check?
            Jack

> 
> > --- gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c    (revision 
> > 194538)
> > +++ gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c    (working copy)
> > @@ -2,6 +2,7 @@
> >  
> >  /* { dg-do run { target setrlimit } } */
> >  /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
> > +// { dg-skip-if "Darwin lacks RLIMIT_AS in setrlimit" { *-*-darwin* } }
> >  /* { dg-shouldfail "asan" } */
> >  
> >  #include <stdlib.h>
> 
> 
>       Jakub

Reply via email to