diff mbox series

[testsuite,committed] fix tests requiring -fdelete-null-pointer-checks

Message ID 2c8cca05-f9aa-7fc2-81cd-058b70fe3b3c@codesourcery.com
State New
Headers show
Series [testsuite,committed] fix tests requiring -fdelete-null-pointer-checks | expand

Commit Message

Sandra Loosemore Jan. 22, 2019, 6:34 p.m. UTC
The nios2-elf target defaults to -fno-delete-null-pointer-checks, at the 
request of Altera; they wanted to be able to manipulate pointers to 
memory at address zero.  From time to time I find new tests that have an 
implicit dependence on -fdelete-null-pointer-checks, which I've been 
fixing for this target by making the option explicit on those tests.

FWIW, for these tests I was seeing a compilation error like "e != 0 is 
not a constant expression".

-Sandra
diff mbox series

Patch

Index: gcc/testsuite/g++.dg/cpp0x/pr86397-1.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/pr86397-1.C	(revision 268160)
+++ gcc/testsuite/g++.dg/cpp0x/pr86397-1.C	(working copy)
@@ -1,4 +1,5 @@ 
 // { dg-do compile { target c++11 } }
+// { dg-options "-fdelete-null-pointer-checks" }
 void e();
 template <bool> void f(int() noexcept(e)) {}
 template void f<false>(int()); // { dg-error "does not match" "" { target c++17 } }
Index: gcc/testsuite/g++.dg/cpp0x/pr86397-2.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/pr86397-2.C	(revision 268160)
+++ gcc/testsuite/g++.dg/cpp0x/pr86397-2.C	(working copy)
@@ -1,4 +1,5 @@ 
 // { dg-do compile { target c++11 } }
+// { dg-options "-fdelete-null-pointer-checks" }
 void e();
 template <bool> void f(int() noexcept(e)) {}
 template void f<false>(int() noexcept);