I've checked in this patch to clean up some test failures I noticed on nios2-elf.

This bare-metal target defaults to -fno-delete-null-pointer-checks at the request of Altera, because address 0 is valid and is typically where the interrupt vector lives. So tests for behavior that depends on -fdelete-null-pointer-checks have to specify that option explicitly. See r222777 for a bunch of other test cases that previously got this treatment.

Also, this target doesn't support -fpic or -rdynamic, so I've added some bits to skip a few new-ish test cases that depend on those options.

-Sandra

2016-09-29  Sandra Loosemore  <san...@codesourcery.com>

	gcc/testsuite/
	* c-c++-common/pr27336.c: Make dependency on 
	-fdelete-null-pointer-checks explicit.
	* g++.dg/cpp0x/constexpr-array-ptr10.C: Likewise.
	* g++.dg/cpp0x/constexpr-nullptr-1.C: Likewise.
	* g++.dg/lto/pr69589_0.C: Add nios2-*-elf to unsupported targets.
	* gcc.dg/pic-1.c: Require fpic target support.
	* gcc.dg/pic-2.c: Likewise.
Index: gcc/testsuite/c-c++-common/pr27336.c
===================================================================
--- gcc/testsuite/c-c++-common/pr27336.c	(revision 240596)
+++ gcc/testsuite/c-c++-common/pr27336.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-O2 -fdelete-null-pointer-checks -fdump-tree-vrp1" } */
 
 struct B { int x; };
 extern void g3(struct B *that)  __attribute__((nonnull));
Index: gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr10.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr10.C	(revision 240596)
+++ gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr10.C	(working copy)
@@ -8,7 +8,7 @@
 // that and involves all constexpr object pointers.
 
 // { dg-do compile { target c++11 } }
-// { dg-additional-options "-Wall -Wextra" }
+// { dg-additional-options "-Wall -Wextra -fdelete-null-pointer-checks" }
 
 namespace A {
 
Index: gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-1.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-1.C	(revision 240596)
+++ gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-1.C	(working copy)
@@ -6,7 +6,7 @@
 // c++/67376 on gcc-patches for additional background.
 
 // { dg-do compile { target c++11 } }
-// { dg-options "-fdump-tree-optimized" }
+// { dg-options "-fdelete-null-pointer-checks -fdump-tree-optimized" }
 
 // Runtime assert.  Used for potentially invalid expressions.
 #define RA(e)  ((e) ? (void)0 : __builtin_abort ())
Index: gcc/testsuite/g++.dg/lto/pr69589_0.C
===================================================================
--- gcc/testsuite/g++.dg/lto/pr69589_0.C	(revision 240596)
+++ gcc/testsuite/g++.dg/lto/pr69589_0.C	(working copy)
@@ -1,7 +1,7 @@
 // { dg-lto-do link }
 // { dg-lto-options "-O2 -rdynamic" }
 // { dg-extra-ld-options "-r -nostdlib" }
-// { dg-skip-if "Skip targets without -rdynamic support" { arm*-none-eabi aarch64*-*-elf } { "*" } { "" } }
+// { dg-skip-if "Skip targets without -rdynamic support" { arm*-none-eabi aarch64*-*-elf nios2-*-elf } { "*" } { "" } }
 
 #pragma GCC visibility push(hidden)
 struct A { int &operator[] (long); };
Index: gcc/testsuite/gcc.dg/pic-1.c
===================================================================
--- gcc/testsuite/gcc.dg/pic-1.c	(revision 240596)
+++ gcc/testsuite/gcc.dg/pic-1.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do compile { target { ! { *-*-darwin* hppa*-*-* } } } } */
+/* { dg-require-effective-target fpic } */
 /* { dg-options "-fpic" } */
 
 #if __PIC__ != 1
Index: gcc/testsuite/gcc.dg/pic-2.c
===================================================================
--- gcc/testsuite/gcc.dg/pic-2.c	(revision 240596)
+++ gcc/testsuite/gcc.dg/pic-2.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
 /* { dg-options "-fPIC" } */
 
 #if __PIC__ != 2

Reply via email to