diff mbox series

testsuite: Compile asan_test.C with -Wno-alloc-size-larger-than

Message ID CAFULd4b_Bhncxn4QCjaZXY329DmhUtLg=kUGsaVZPydfV+e4nA@mail.gmail.com
State New
Headers show
Series testsuite: Compile asan_test.C with -Wno-alloc-size-larger-than | expand

Commit Message

Uros Bizjak March 5, 2020, 9:05 a.m. UTC
asan_test.cc tries to allocate 0xf0000000 bytes for 32bit targets in
a disabled DISABLED_DemoOOM test.  Since the testcase is compiled with
-Werror, the compilation fails with:

error: argument 1 value '4026531840' exceeds maximum object size 2147483647

Compile with -Wno-alloc-size-larger-than to avoid compilation failure.

2020-03-05  Uroš Bizjak  <ubizjak@gmail.com>

    * g++.de/asan/asan_test.C (dg-options): Add
    -Wno-alloc-size-larger-than.

Tested on x86_64-linux-gnu {,-m32}.

unix/-m32 asan test results went from

# of unexpected failures    1
# of unresolved testcases    1
# of unsupported tests        6

to

# of expected passes        1193
# of unsupported tests        6

OK for mainline?

Uros.

Comments

Jakub Jelinek March 5, 2020, 9:12 a.m. UTC | #1
On Thu, Mar 05, 2020 at 10:05:43AM +0100, Uros Bizjak wrote:
> asan_test.cc tries to allocate 0xf0000000 bytes for 32bit targets in
> a disabled DISABLED_DemoOOM test.  Since the testcase is compiled with
> -Werror, the compilation fails with:
> 
> error: argument 1 value '4026531840' exceeds maximum object size 2147483647
> 
> Compile with -Wno-alloc-size-larger-than to avoid compilation failure.
> 
> 2020-03-05  Uroš Bizjak  <ubizjak@gmail.com>
> 
>     * g++.de/asan/asan_test.C (dg-options): Add

s/de/dg/

>     -Wno-alloc-size-larger-than.

Ok, thanks.

	Jakub
diff mbox series

Patch

diff --git a/gcc/testsuite/g++.dg/asan/asan_test.C b/gcc/testsuite/g++.dg/asan/asan_test.C
index f3f7626ef3be..a151979946ac 100644
--- a/gcc/testsuite/g++.dg/asan/asan_test.C
+++ b/gcc/testsuite/g++.dg/asan/asan_test.C
@@ -2,7 +2,7 @@ 
 // { dg-skip-if "" { *-*-* } { "*" } { "-O2" } }
 // { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
 // { dg-additional-sources "asan_globals_test-wrapper.cc" }
-// { dg-options "-std=c++11 -fsanitize=address -fno-builtin -Wall -Werror -g -DASAN_UAR=0 -DASAN_HAS_EXCEPTIONS=1 -DASAN_HAS_BLACKLIST=0 -DSANITIZER_USE_DEJAGNU_GTEST=1 -lasan -lpthread -ldl" }
+// { dg-options "-std=c++11 -fsanitize=address -fno-builtin -Wall -Werror -Wno-alloc-size-larger-than -g -DASAN_UAR=0 -DASAN_HAS_EXCEPTIONS=1 -DASAN_HAS_BLACKLIST=0 -DSANITIZER_USE_DEJAGNU_GTEST=1 -lasan -lpthread -ldl" }
 // { dg-additional-options "-DASAN_NEEDS_SEGV=1" { target { ! arm*-*-* } } }
 // { dg-additional-options "-DASAN_LOW_MEMORY=1 -DASAN_NEEDS_SEGV=0" { target arm*-*-* } }
 // { dg-additional-options "-DASAN_AVOID_EXPENSIVE_TESTS=1" { target { ! run_expensive_tests } } }