From: Jason Merrill Date: Wed, 11 Apr 2018 23:43:28 +0000 (-0400) Subject: * lib/asan-dg.exp: Don't run tests if ulimit -v is set. X-Git-Tag: upstream/12.2.0~32364 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34ffaf66e9a52f3944d664126bedf05c1581b8dc;p=platform%2Fupstream%2Fgcc.git * lib/asan-dg.exp: Don't run tests if ulimit -v is set. From-SVN: r259333 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9bb1a70..578e73b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-11 Jason Merrill + + * lib/asan-dg.exp (check_effective_target_fsanitize_address): False + if ulimit -v is set. + 2018-04-11 Bin Cheng PR testsuite/85190 diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp index 25f1de4..39451b9 100644 --- a/gcc/testsuite/lib/asan-dg.exp +++ b/gcc/testsuite/lib/asan-dg.exp @@ -18,9 +18,24 @@ # code, 0 otherwise. proc check_effective_target_fsanitize_address {} { - return [check_no_compiler_messages fsanitize_address executable { + if ![check_no_compiler_messages fsanitize_address executable { int main (void) { return 0; } - }] + }] { + return 0; + } + + # 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 0; + } + } + + return 1; } proc asan_include_flags {} {