Patch 5 deals with ISO C errors emitted by tests when the large memory model is
used. size_t and ptrdiff_t are __int20 with -mlarge, and if the test is
compiled with -pedantic-errors and -std=* or -ansi, then use of these types
causes an error of the form:
  ISO C does not support __int20 types
I fixed this by adding dg-prune-output directives to tests which cause this
error.

Alternatively, I considered adding typedefs preceded by  __extension__ to fix
these errors, but in many cases __SIZE_TYPE__ is directly used so replacing all
these with a new typedef'd type changes the code in more places, in some cases
changing the offset for dg-warning or dg-error directives. Changing the line
numbers for dg-warning/dg-error adds further manual steps to comparing
testresults and as these are generic tests I wanted to minimize the effect on
the testresults for other targets.

>From ed24754b1d97992400bb374916d87cce151f7e89 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <joze...@mittosystems.com>
Date: Sat, 10 Nov 2018 15:47:21 +0000
Subject: [PATCH 5/7] [TESTSUITE] Prune messages about ISO C not supporting
 __int20 from output of tests

2018-11-14  Jozef Lawrynowicz  <joze...@mittosystems.com>

	gcc/testsuite/ChangeLog:

	* gcc.dg/addr_builtin-1.c: Prune ISO C does not support __int20
	message from output.
	* gcc.dg/c11-static-assert-3.c: Likewise.
	* gcc.dg/c11-uni-string-1.c: Likewise.
	* gcc.dg/c99-const-expr-10.c: Likewise.
	* gcc.dg/c99-const-expr-6.c: Likewise.
	* gcc.dg/c99-const-expr-9.c: Likewise.
	* gcc.dg/c99-init-1.c: Likewise.
	* gcc.dg/c99-stdint-5.c: Likewise.
	* gcc.dg/c99-stdint-6.c: Likewise.
	* gcc.dg/pr52549.c: Likewise.
	* gcc.dg/pr61240.c: Likewise.
	* gcc.dg/pr71558.c: Likewise.
	* gcc.dg/pr77587.c: Likewise.
	* gcc.dg/pr79223.c: Likewise.
	* gcc.dg/vla-11.c: Likewise.
	* gcc.dg/vla-9.c: Likewise.

---
 gcc/testsuite/gcc.dg/addr_builtin-1.c      | 3 ++-
 gcc/testsuite/gcc.dg/c11-static-assert-3.c | 1 +
 gcc/testsuite/gcc.dg/c11-uni-string-1.c    | 1 +
 gcc/testsuite/gcc.dg/c99-const-expr-10.c   | 1 +
 gcc/testsuite/gcc.dg/c99-const-expr-6.c    | 1 +
 gcc/testsuite/gcc.dg/c99-const-expr-9.c    | 1 +
 gcc/testsuite/gcc.dg/c99-init-1.c          | 1 +
 gcc/testsuite/gcc.dg/c99-stdint-5.c        | 1 +
 gcc/testsuite/gcc.dg/c99-stdint-6.c        | 1 +
 gcc/testsuite/gcc.dg/pr52549.c             | 1 +
 gcc/testsuite/gcc.dg/pr61240.c             | 1 +
 gcc/testsuite/gcc.dg/pr71558.c             | 1 +
 gcc/testsuite/gcc.dg/pr77587.c             | 1 +
 gcc/testsuite/gcc.dg/pr79223.c             | 3 ++-
 gcc/testsuite/gcc.dg/vla-11.c              | 1 +
 gcc/testsuite/gcc.dg/vla-9.c               | 1 +
 16 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/addr_builtin-1.c b/gcc/testsuite/gcc.dg/addr_builtin-1.c
index 4a0888a..7d91c62 100644
--- a/gcc/testsuite/gcc.dg/addr_builtin-1.c
+++ b/gcc/testsuite/gcc.dg/addr_builtin-1.c
@@ -1,5 +1,6 @@
 /* PR66516 - missing diagnostic on taking the address of a builtin function
-   { dg-do compile }  */
+   { dg-do compile }
+   { dg-prune-output "ISO C does not support.*__int20" }  */
 
 typedef void (F)(void);
 typedef __UINTPTR_TYPE__ uintptr_t;
diff --git a/gcc/testsuite/gcc.dg/c11-static-assert-3.c b/gcc/testsuite/gcc.dg/c11-static-assert-3.c
index 9799b97..ea369e9 100644
--- a/gcc/testsuite/gcc.dg/c11-static-assert-3.c
+++ b/gcc/testsuite/gcc.dg/c11-static-assert-3.c
@@ -1,6 +1,7 @@
 /* Test C11 static assertions.  Invalid assertions.  */
 /* { dg-do compile } */
 /* { dg-options "-std=c11 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 _Static_assert (__INT_MAX__ * 2, "overflow"); /* { dg-warning "integer overflow in expression" } */
 /* { dg-error "overflow in constant expression" "error" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/c11-uni-string-1.c b/gcc/testsuite/gcc.dg/c11-uni-string-1.c
index 9f86bea..9b47f6a6 100644
--- a/gcc/testsuite/gcc.dg/c11-uni-string-1.c
+++ b/gcc/testsuite/gcc.dg/c11-uni-string-1.c
@@ -1,6 +1,7 @@
 /* Test Unicode strings in C11.  Test valid code.  */
 /* { dg-do run } */
 /* { dg-options "-std=c11 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 /* More thorough tests are in c-c++-common/raw-string-*.c; this test
    verifies the particular subset (Unicode but not raw strings) that
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-10.c b/gcc/testsuite/gcc.dg/c99-const-expr-10.c
index 2aca610..bb5af01 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-10.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-10.c
@@ -4,6 +4,7 @@
 /* Origin: Joseph Myers <jos...@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 void *p = (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
 struct s { void *a; } q = { (__SIZE_TYPE__)(void *)0 }; /* { dg-error "without a cast|near initialization" } */
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-6.c b/gcc/testsuite/gcc.dg/c99-const-expr-6.c
index ca60243..b985ade 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-6.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-6.c
@@ -3,6 +3,7 @@
 /* Origin: Joseph Myers <jos...@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 /* PR 29116.  */
 int n = 0, p[n * 0 + 1]; /* { dg-error "variabl" } */
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-9.c b/gcc/testsuite/gcc.dg/c99-const-expr-9.c
index 11e0b2c..eaacfa7 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-9.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-9.c
@@ -4,6 +4,7 @@
 /* Origin: Joseph Myers <jos...@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors -ftrack-macro-expansion=0" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 struct s {
   int a;
diff --git a/gcc/testsuite/gcc.dg/c99-init-1.c b/gcc/testsuite/gcc.dg/c99-init-1.c
index 95803c2..6a7300e 100644
--- a/gcc/testsuite/gcc.dg/c99-init-1.c
+++ b/gcc/testsuite/gcc.dg/c99-init-1.c
@@ -2,6 +2,7 @@
 /* Origin: Jakub Jelinek <ja...@redhat.com> */
 /* { dg-do run } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 typedef __SIZE_TYPE__ size_t;
 typedef __WCHAR_TYPE__ wchar_t;
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-5.c b/gcc/testsuite/gcc.dg/c99-stdint-5.c
index 6051323..3946f79 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-5.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-5.c
@@ -4,6 +4,7 @@
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
 /* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 #include <stdint.h>
 #ifndef SIGNAL_SUPPRESS
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-6.c b/gcc/testsuite/gcc.dg/c99-stdint-6.c
index 60ac31f..554f47a 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-6.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-6.c
@@ -3,6 +3,7 @@
 /* { dg-do compile { target inttypes_types } } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
 /* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 #include <inttypes.h>
 #ifndef SIGNAL_SUPPRESS
diff --git a/gcc/testsuite/gcc.dg/pr52549.c b/gcc/testsuite/gcc.dg/pr52549.c
index 4d0a3e0..bb81d5c 100644
--- a/gcc/testsuite/gcc.dg/pr52549.c
+++ b/gcc/testsuite/gcc.dg/pr52549.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 #ifdef __SIZE_TYPE__
 _mark (__SIZE_TYPE__ obj, int i, char *a)
diff --git a/gcc/testsuite/gcc.dg/pr61240.c b/gcc/testsuite/gcc.dg/pr61240.c
index 6332918..af7c3f6 100644
--- a/gcc/testsuite/gcc.dg/pr61240.c
+++ b/gcc/testsuite/gcc.dg/pr61240.c
@@ -1,5 +1,6 @@
 /* PR c/61240 */
 /* { dg-do compile } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 
diff --git a/gcc/testsuite/gcc.dg/pr71558.c b/gcc/testsuite/gcc.dg/pr71558.c
index 33a648e..6c97f3a 100644
--- a/gcc/testsuite/gcc.dg/pr71558.c
+++ b/gcc/testsuite/gcc.dg/pr71558.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/71588 */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 /* strcpy must not be pure, but make sure we don't ICE even when
    it is declared incorrectly.  */
diff --git a/gcc/testsuite/gcc.dg/pr77587.c b/gcc/testsuite/gcc.dg/pr77587.c
index 8f5afef..3028d07 100644
--- a/gcc/testsuite/gcc.dg/pr77587.c
+++ b/gcc/testsuite/gcc.dg/pr77587.c
@@ -3,6 +3,7 @@
 /* { dg-require-alias "" } */
 /* { dg-require-weak-override "" } */
 /* { dg-additional-sources "pr77587a.c" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 void
 bar (long x, long y, long z)
diff --git a/gcc/testsuite/gcc.dg/pr79223.c b/gcc/testsuite/gcc.dg/pr79223.c
index ef0dd1b..24c5f52 100644
--- a/gcc/testsuite/gcc.dg/pr79223.c
+++ b/gcc/testsuite/gcc.dg/pr79223.c
@@ -1,6 +1,7 @@
 /* PR middle-end/79223 - missing -Wstringop-overflow on a memmove overflow
    { dg-do compile }
-   { dg-additional-options "-O2 -Wall -Wno-array-bounds -std=gnu99" }  */
+   { dg-additional-options "-O2 -Wall -Wno-array-bounds -std=gnu99" }
+   { dg-prune-output "ISO C does not support.*__int20" }  */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/vla-11.c b/gcc/testsuite/gcc.dg/vla-11.c
index 1504853..f52d65d 100644
--- a/gcc/testsuite/gcc.dg/vla-11.c
+++ b/gcc/testsuite/gcc.dg/vla-11.c
@@ -5,6 +5,7 @@
 /* Origin: Joseph Myers <jos...@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=c99 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 void foo11a(int x[sizeof(int *(*)[*])]);	/* { dg-warning "not in a declaration" } */
 void foo11b(__SIZE_TYPE__ x, int y[(__UINTPTR_TYPE__)(int (*)[*])x]);	/* { dg-warning "not in a declaration" } */
diff --git a/gcc/testsuite/gcc.dg/vla-9.c b/gcc/testsuite/gcc.dg/vla-9.c
index 506a1a2..e6506d7 100644
--- a/gcc/testsuite/gcc.dg/vla-9.c
+++ b/gcc/testsuite/gcc.dg/vla-9.c
@@ -1,5 +1,6 @@
 /* { dg-do compile  } */
 /* { dg-options "-std=c99 -pedantic-errors -W -Wall" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 /* PR c/28280 */
 
 void f(__SIZE_TYPE__ d)
-- 
2.7.4

Reply via email to