diff mbox series

[5/7,MSP430,TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests

Message ID b8aaa6d2-bf30-c81c-e856-f867a91bd6c5@mittosystems.com
State New
Headers show
Series Fix GCC tests for msp430-elf | expand

Commit Message

Jozef Lawrynowicz Nov. 14, 2018, 3:56 p.m. UTC
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.

Comments

Mike Stump Nov. 26, 2018, 8:51 p.m. UTC | #1
On Nov 14, 2018, at 7:56 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> 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.

So, it is important that standard code not produce errors.  Kinda fundamental.

I think this should be fixed in some other way.  If a type is to be used as a standard type, producing an error for that type's use is wrong.  Instead, find a way (cough, __extension__), to mark or not warn (error) for it instead.



> 
> Alternatively, I considered adding typedefs preceded by  __extension__ to fix
> these errors, but in many cases __SIZE_TYPE__ is directly used

Can you fix __SIZE_TYPE__ itself to have __extension__ in it?  If not, then I'd find another way to remove that warning for the type.
Jozef Lawrynowicz Nov. 26, 2018, 11:07 p.m. UTC | #2
On Mon, 26 Nov 2018 12:51:26 -0800
Mike Stump <mikestump@comcast.net> wrote:

> On Nov 14, 2018, at 7:56 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> > 
> > 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.  
> 
> So, it is important that standard code not produce errors.  Kinda fundamental.
> 
> I think this should be fixed in some other way.  If a type is to be used as a standard type, producing an error for that type's use is wrong.  Instead, find a way (cough, __extension__), to mark or not warn (error) for it instead.

Thanks for the feedback.

> Can you fix __SIZE_TYPE__ itself to have __extension__ in it?  If not, then I'd find another way to remove that warning for the type.

It appears you can actually add __extension__ everywhere (that I tried), except
for the argument types in the declaration of a function i.e.
	foo (__extension__ __SIZE_TYPE__ a)
doesn't work.

So I added __extension__ where possible, and in a couple of other cases I
instead typedef'd with __extension__.

Fixed patch attached. For tests which check for messages on specific lines,
those line numbers remain unchanged. 
Ok for trunk?

2018-11-26  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

        Fix __int20 ISO C errors for msp430-elf -mlarge.

        gcc/testsuite/ChangeLog:

        * gcc.dg/addr_builtin-1.c: Add __extension__ before usage of
        __SIZE_TYPE__ and __UINTPTR_TYPE__.
        * gcc.dg/vla-11.c: Likewise.
        * gcc.dg/c11-static-assert-3.c: Add __extension__ before usage of
        __SIZE_TYPE__.
        * gcc.dg/c11-uni-string-1.c: Likewise.
        * gcc.dg/c99-const-expr-10.c: Likewise.
        * gcc.dg/c99-const-expr-9.c: Likewise.
        * gcc.dg/c99-init-1.c: Likewise.
        * gcc.dg/pr52549.c: Likewise.
        * gcc.dg/pr71558.c: Likewise.
        * gcc.dg/pr77587.c: Likewise.
        * gcc.dg/pr79223.c: Likewise.
        * gcc.dg/vla-9.c: Likewise.
        * gcc.dg/c99-const-expr-6.c: Add __extension__ before usage of
        __INTPTR_TYPE__.
        * gcc.dg/c99-stdint-5.c: Likewise.
        * gcc.dg/c99-stdint-6.c: Likewise.
        * gcc.dg/pr61240.c: Add __extension__ before usage of __PTRDIFF_TYPE_.
diff --git a/gcc/testsuite/gcc.dg/addr_builtin-1.c b/gcc/testsuite/gcc.dg/addr_builtin-1.c
index 4a0888a..d7ad785 100644
--- a/gcc/testsuite/gcc.dg/addr_builtin-1.c
+++ b/gcc/testsuite/gcc.dg/addr_builtin-1.c
@@ -2,7 +2,7 @@
    { dg-do compile }  */
 
 typedef void (F)(void);
-typedef __UINTPTR_TYPE__ uintptr_t;
+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
 
 /* Utility function to test passing built-in functions as an ordinary
    argument and via the ellipsis.  */
@@ -122,7 +122,7 @@ static F* test_taking_address_of_gcc_builtin (void)
    of a user-declared function that's also a GCC built-in.  */
 extern int abs (int);
 
-extern __SIZE_TYPE__ strlen (const char*);
+__extension__ extern __SIZE_TYPE__ strlen (const char*);
 
 /* Taking the address of a builtin with a library "fallback" must be
    allowed, either using the __builtin_xxx form or the xxx form, when
@@ -147,7 +147,7 @@ void test_taking_address_of_library_builtin (int i)
   }
 
   {
-    typedef __SIZE_TYPE__ size_t;
+    __extension__ typedef __SIZE_TYPE__ size_t;
     typedef size_t F (const char*);
 
     /* Compute the address of libc's strlen using the implicitly
diff --git a/gcc/testsuite/gcc.dg/c11-static-assert-3.c b/gcc/testsuite/gcc.dg/c11-static-assert-3.c
index 9799b97..25a9346 100644
--- a/gcc/testsuite/gcc.dg/c11-static-assert-3.c
+++ b/gcc/testsuite/gcc.dg/c11-static-assert-3.c
@@ -5,7 +5,7 @@
 _Static_assert (__INT_MAX__ * 2, "overflow"); /* { dg-warning "integer overflow in expression" } */
 /* { dg-error "overflow in constant expression" "error" { target *-*-* } .-1 } */
 
-_Static_assert ((void *)(__SIZE_TYPE__)16, "non-integer"); /* { dg-error "not an integer" } */
+_Static_assert (__extension__ (void *)(__SIZE_TYPE__)16, "non-integer"); /* { dg-error "not an integer" } */
 
 _Static_assert (1.0, "non-integer"); /* { dg-error "not an integer" } */
 
diff --git a/gcc/testsuite/gcc.dg/c11-uni-string-1.c b/gcc/testsuite/gcc.dg/c11-uni-string-1.c
index 9f86bea..6ace5e0 100644
--- a/gcc/testsuite/gcc.dg/c11-uni-string-1.c
+++ b/gcc/testsuite/gcc.dg/c11-uni-string-1.c
@@ -8,7 +8,7 @@
 
 typedef __CHAR16_TYPE__ char16_t;
 typedef __CHAR32_TYPE__ char32_t;
-typedef __SIZE_TYPE__ size_t;
+__extension__ typedef __SIZE_TYPE__ size_t;
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-10.c b/gcc/testsuite/gcc.dg/c99-const-expr-10.c
index 2aca610..0a81953 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-10.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-10.c
@@ -4,25 +4,25 @@
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
-
-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" } */
+__extension__ typedef __SIZE_TYPE__ size_t;
+void *p = (size_t)(void *)0; /* { dg-error "without a cast" } */
+struct s { void *a; } q = { (size_t)(void *)0 }; /* { dg-error "without a cast|near initialization" } */
 void *
 f (void)
 {
   void *r;
-  r = (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
-  return (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
+  r = (size_t)(void *)0; /* { dg-error "without a cast" } */
+  return (size_t)(void *)0; /* { dg-error "without a cast" } */
 }
 void g (void *); /* { dg-message "but argument is of type" } */
 void
 h (void)
 {
-  g ((__SIZE_TYPE__)(void *)0); /* { dg-error "without a cast" } */
+  g ((size_t)(void *)0); /* { dg-error "without a cast" } */
 }
 void g2 (int, void *); /* { dg-message "but argument is of type" } */
 void
 h2 (void)
 {
-  g2 (0, (__SIZE_TYPE__)(void *)0); /* { dg-error "without a cast" } */
+  g2 (0, (size_t)(void *)0); /* { dg-error "without a cast" } */
 }
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-6.c b/gcc/testsuite/gcc.dg/c99-const-expr-6.c
index ca60243..ecb048b 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-6.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-6.c
@@ -8,7 +8,7 @@
 int n = 0, p[n * 0 + 1]; /* { dg-error "variabl" } */
 
 /* PR 31871.  */
-extern int c[1 + ((__INTPTR_TYPE__) (void *) 0)]; /* { dg-error "variab" } */
+extern int c[1 + (__extension__ (__INTPTR_TYPE__) (void *) 0)]; /* { dg-error "variab" } */
 
 /* Implicit conversions from floating-point constants are not OK,
    although explicit ones are.  */
@@ -32,7 +32,7 @@ struct s {
 };
 
 enum e {
-  E = (1 + ((__INTPTR_TYPE__) (void *) 0)), /* { dg-error "constant" } */
+  E = (1 + (__extension__ (__INTPTR_TYPE__) (void *) 0)), /* { dg-error "constant" } */
   E2 = 0
 };
 
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-9.c b/gcc/testsuite/gcc.dg/c99-const-expr-9.c
index 11e0b2c..371e105 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-9.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-9.c
@@ -14,7 +14,7 @@ struct t {
   int b[2];
 };
 
-#define old_offsetof(TYPE, MEMBER) ((__SIZE_TYPE__)(__UINTPTR_TYPE__) &((TYPE *)0)->MEMBER)
+#define old_offsetof(TYPE, MEMBER) (__extension__ (__SIZE_TYPE__)(__UINTPTR_TYPE__) &((TYPE *)0)->MEMBER)
 
 enum e {
   E1 = old_offsetof (struct s, a), /* { dg-error "constant" } */
diff --git a/gcc/testsuite/gcc.dg/c99-init-1.c b/gcc/testsuite/gcc.dg/c99-init-1.c
index 95803c2..cefcfef 100644
--- a/gcc/testsuite/gcc.dg/c99-init-1.c
+++ b/gcc/testsuite/gcc.dg/c99-init-1.c
@@ -3,7 +3,7 @@
 /* { dg-do run } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
 
-typedef __SIZE_TYPE__ size_t;
+__extension__ typedef __SIZE_TYPE__ size_t;
 typedef __WCHAR_TYPE__ wchar_t;
 extern int memcmp (const void *, const void *, size_t);
 extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-5.c b/gcc/testsuite/gcc.dg/c99-stdint-5.c
index 6051323..97cd6f7 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-5.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-5.c
@@ -57,10 +57,10 @@ check_types (void)
   CHECK_TYPES(__UINT_FAST32_TYPE__, uint_fast32_t);
   CHECK_TYPES(__UINT_FAST64_TYPE__, uint_fast64_t);
 #ifdef __INTPTR_TYPE__
-  CHECK_TYPES(__INTPTR_TYPE__, intptr_t);
+  CHECK_TYPES(__extension__ __INTPTR_TYPE__, intptr_t);
 #endif
 #ifdef __UINTPTR_TYPE__
-  CHECK_TYPES(__UINTPTR_TYPE__, uintptr_t);
+  CHECK_TYPES(__extension__ __UINTPTR_TYPE__, uintptr_t);
 #endif
   CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
   CHECK_TYPES(__UINTMAX_TYPE__, uintmax_t);
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-6.c b/gcc/testsuite/gcc.dg/c99-stdint-6.c
index 60ac31f..1075828 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-6.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-6.c
@@ -60,10 +60,10 @@ check_types (void)
   CHECK_TYPES(__UINT_FAST64_TYPE__, uint_fast64_t);
 #endif
 #ifdef __INTPTR_TYPE__
-  CHECK_TYPES(__INTPTR_TYPE__, intptr_t);
+  CHECK_TYPES(__extension__ __INTPTR_TYPE__, intptr_t);
 #endif
 #ifdef __UINTPTR_TYPE__
-  CHECK_TYPES(__UINTPTR_TYPE__, uintptr_t);
+  CHECK_TYPES(__extension__ __UINTPTR_TYPE__, uintptr_t);
 #endif
 #ifndef NO_MAX_TYPES
   CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
diff --git a/gcc/testsuite/gcc.dg/pr52549.c b/gcc/testsuite/gcc.dg/pr52549.c
index 4d0a3e0..faf4e5d 100644
--- a/gcc/testsuite/gcc.dg/pr52549.c
+++ b/gcc/testsuite/gcc.dg/pr52549.c
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
 
 #ifdef __SIZE_TYPE__
-_mark (__SIZE_TYPE__ obj, int i, char *a)
+__extension__ typedef __SIZE_TYPE__ size_t;
+_mark (size_t obj, int i, char *a)
 {
   (char *)&(((long *)(obj)) [i]) - a;
 }
diff --git a/gcc/testsuite/gcc.dg/pr61240.c b/gcc/testsuite/gcc.dg/pr61240.c
index 6332918..8bbb347 100644
--- a/gcc/testsuite/gcc.dg/pr61240.c
+++ b/gcc/testsuite/gcc.dg/pr61240.c
@@ -1,7 +1,7 @@
 /* PR c/61240 */
 /* { dg-do compile } */
 
-typedef __PTRDIFF_TYPE__ ptrdiff_t;
+__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 
 ptrdiff_t
 foo (ptrdiff_t a[4])
diff --git a/gcc/testsuite/gcc.dg/pr71558.c b/gcc/testsuite/gcc.dg/pr71558.c
index 33a648e..ada830b 100644
--- a/gcc/testsuite/gcc.dg/pr71558.c
+++ b/gcc/testsuite/gcc.dg/pr71558.c
@@ -3,15 +3,17 @@
 /* strcpy must not be pure, but make sure we don't ICE even when
    it is declared incorrectly.  */
 char *strcpy (char *, const char *) __attribute__ ((__pure__));
-__SIZE_TYPE__ strlen (const char *);
-void *malloc (__SIZE_TYPE__);
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+size_t strlen (const char *);
+void *malloc (size_t);
 
 char a[20];
 
 char *
 foo (void)
 {
-  __SIZE_TYPE__ b = strlen (a);
+  size_t b = strlen (a);
   char *c = malloc (b);
   return strcpy (c, a);
 }
diff --git a/gcc/testsuite/gcc.dg/pr77587.c b/gcc/testsuite/gcc.dg/pr77587.c
index 8f5afef..c4a6ebf 100644
--- a/gcc/testsuite/gcc.dg/pr77587.c
+++ b/gcc/testsuite/gcc.dg/pr77587.c
@@ -10,6 +10,6 @@ bar (long x, long y, long z)
   struct __attribute__((aligned (16))) S { long a, b, c, d; } s;
   char *p = (char *) &s;
   __asm ("" : "+r" (p));
-  if (((__UINTPTR_TYPE__) p) & 15)
+  if ((__extension__ (__UINTPTR_TYPE__) p) & 15)
     __builtin_abort ();
 }
diff --git a/gcc/testsuite/gcc.dg/pr79223.c b/gcc/testsuite/gcc.dg/pr79223.c
index ef0dd1b..f043fc4 100644
--- a/gcc/testsuite/gcc.dg/pr79223.c
+++ b/gcc/testsuite/gcc.dg/pr79223.c
@@ -2,7 +2,7 @@
    { dg-do compile }
    { dg-additional-options "-O2 -Wall -Wno-array-bounds -std=gnu99" }  */
 
-typedef __SIZE_TYPE__ size_t;
+__extension__ typedef __SIZE_TYPE__ size_t;
 
 extern void* memcpy (void*, const void*, size_t);
 extern void* mempcpy (void*, const void*, size_t);
diff --git a/gcc/testsuite/gcc.dg/vla-11.c b/gcc/testsuite/gcc.dg/vla-11.c
index 1504853..e2d5488 100644
--- a/gcc/testsuite/gcc.dg/vla-11.c
+++ b/gcc/testsuite/gcc.dg/vla-11.c
@@ -5,8 +5,8 @@
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=c99 -pedantic-errors" } */
-
+__extension__ typedef __SIZE_TYPE__ size_t;
 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" } */
+void foo11b(size_t x, int y[__extension__ (__UINTPTR_TYPE__)(int (*)[*])x]);	/* { dg-warning "not in a declaration" } */
 void foo11c(struct s { int (*x)[*]; } *y);	/* { dg-error "a member of a structure or union cannot have a variably modified type" "variably modified" } */
 /* { dg-warning "'struct s' declared inside parameter list" "struct decl" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/vla-9.c b/gcc/testsuite/gcc.dg/vla-9.c
index 506a1a2..44a232b 100644
--- a/gcc/testsuite/gcc.dg/vla-9.c
+++ b/gcc/testsuite/gcc.dg/vla-9.c
@@ -2,7 +2,9 @@
 /* { dg-options "-std=c99 -pedantic-errors -W -Wall" } */
 /* PR c/28280 */
 
-void f(__SIZE_TYPE__ d)
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+void f(size_t d)
 {
   typedef int t[d];
   t *g = (__typeof (g)) d;
Mike Stump Nov. 27, 2018, 6:49 p.m. UTC | #3
On Nov 26, 2018, at 3:07 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> On Mon, 26 Nov 2018 12:51:26 -0800
> Mike Stump <mikestump@comcast.net> wrote:
> 
>> On Nov 14, 2018, at 7:56 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
>>> 
>>> 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.  
>> 
>> So, it is important that standard code not produce errors.  Kinda fundamental.
>> 
>> I think this should be fixed in some other way.  If a type is to be used as a standard type, producing an error for that type's use is wrong.  Instead, find a way (cough, __extension__), to mark or not warn (error) for it instead.
> 
> Thanks for the feedback.
> 
>> Can you fix __SIZE_TYPE__ itself to have __extension__ in it?  If not, then I'd find another way to remove that warning for the type.
> 
> It appears you can actually add __extension__ everywhere (that I tried), except
> for the argument types in the declaration of a function i.e.
> 	foo (__extension__ __SIZE_TYPE__ a)
> doesn't work.

Ouch.  Seems like a bug in the parsers.  Could you file a bug report for this against C and C++.  Once that bug is fixed, then you can just add __extension__ to SIZE_TYPE in your port file.

> So I added __extension__ where possible, and in a couple of other cases I
> instead typedef'd with __extension__.

> Ok for trunk?

No.  I mean, __extension__ should be added in SIZE_TYPE in your port.h file.  That, or, you need a type that won't complain when used.

Recall, you're not doing the port for the testsuite, you're doing the port for users.  Users don't want a ton of warnings or errors when compiling trivial standard code.
Jozef Lawrynowicz Nov. 28, 2018, 11:03 a.m. UTC | #4
On Tue, 27 Nov 2018 10:49:56 -0800
Mike Stump <mikestump@comcast.net> wrote:

> On Nov 26, 2018, at 3:07 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> > 
> > It appears you can actually add __extension__ everywhere (that I tried), except
> > for the argument types in the declaration of a function i.e.
> > 	foo (__extension__ __SIZE_TYPE__ a)
> > doesn't work.  
> 
> Ouch.  Seems like a bug in the parsers.  Could you file a bug report for this against C and C++.  Once that bug is fixed, then you can just add __extension__ to SIZE_TYPE in your port file.

Filed PR88237.

> 
> > So I added __extension__ where possible, and in a couple of other cases I
> > instead typedef'd with __extension__.  
> 
> > Ok for trunk?  
> 
> No.  I mean, __extension__ should be added in SIZE_TYPE in your port.h file.  That, or, you need a type that won't complain when used.
> 
> Recall, you're not doing the port for the testsuite, you're doing the port for users.  Users don't want a ton of warnings or errors when compiling trivial standard code.

Apologies, I made a mistake in the wording of my initial submission.

intptr_t, size_t and ptrdiff_t do NOT cause errors, despite the base type
being __int20.
__INTPTR_TYPE__, __SIZE_TYPE__ and __PTRDIFF_TYPE__ DO cause the ISO C errors,
as these are just macros which will expand to __int20 after
pre-processing.

The documentation says users should not use these __*_TYPE__ macros
directly (cpp.texi):
> You should not use these macros directly; instead, include the
> appropriate headers and use the typedefs.

Given that the errors only occur when using macros which expand to __int20,
would you agree that the current behaviour of the compiler is correct?

Thanks,
Jozef
diff mbox series

Patch

From ed24754b1d97992400bb374916d87cce151f7e89 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@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  <jozef.l@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 <joseph@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 <joseph@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 <joseph@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 <jakub@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 <joseph@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