public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix up method-nonnull-1.mm testcase on Solaris (PR testsuite/88090)
@ 2018-11-20 20:36 Jakub Jelinek
  2018-11-26 21:23 ` Mike Stump
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2018-11-20 20:36 UTC (permalink / raw)
  To: Rainer Orth, Mike Stump; +Cc: gcc-patches

Hi!

The following testcase fails on Solaris, because it doesn't print there
'size_t', but 'std::size_t', as the type is defined by system headers and
it is not under gcc control how exactly is size_t defined.

The following patch fixes that by using a different typedef which we have
total control over.

Tested on x86_64-linux and i686-linux, ok for trunk?

2018-11-20  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/88090
	* obj-c++.dg/attributes/method-nonnull-1.mm (my_size_t): New typedef.
	(MyArray::removeObjectAtIndex): Use my_size_t instead of size_t and
	expect it in diagnostics.

--- gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm.jj	2018-11-16 10:22:17.817272221 +0100
+++ gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm	2018-11-20 09:10:28.404872788 +0100
@@ -5,6 +5,8 @@
 #include <objc/objc.h>
 #include <stdlib.h>
 
+typedef __SIZE_TYPE__ my_size_t;
+
 @interface MyArray
 {
   Class isa;
@@ -25,8 +27,8 @@
 + (void) removeObject: (id)object __attribute__ ((nonnull (2))); /* { dg-warning "exceeds the number of function parameters 3" } */
 - (void) removeObject: (id)object __attribute__ ((nonnull (2))); /* { dg-warning "exceeds the number of function parameters 3" } */
 
-+ (void) removeObjectAtIndex: (size_t)object __attribute__ ((nonnull (1))); /* { dg-warning "refers to parameter type .size_t." } */
-- (void) removeObjectAtIndex: (size_t)object __attribute__ ((nonnull (1))); /* { dg-warning "refers to parameter type .size_t." } */
++ (void) removeObjectAtIndex: (my_size_t)object __attribute__ ((nonnull (1))); /* { dg-warning "refers to parameter type .my_size_t." } */
+- (void) removeObjectAtIndex: (my_size_t)object __attribute__ ((nonnull (1))); /* { dg-warning "refers to parameter type .my_size_t." } */
 
 + (void) removeObject: (id)object __attribute__ ((nonnull (MyArray))); /* { dg-error "" } */
   /* { dg-warning "attribute argument is invalid" "" { target *-*-* } .-1 } */

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix up method-nonnull-1.mm testcase on Solaris (PR testsuite/88090)
  2018-11-20 20:36 [PATCH] Fix up method-nonnull-1.mm testcase on Solaris (PR testsuite/88090) Jakub Jelinek
@ 2018-11-26 21:23 ` Mike Stump
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Stump @ 2018-11-26 21:23 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Rainer Orth, gcc-patches

On Nov 20, 2018, at 12:36 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> 
> The following testcase fails on Solaris, because it doesn't print there
> 'size_t', but 'std::size_t', as the type is defined by system headers and
> it is not under gcc control how exactly is size_t defined.
> 
> The following patch fixes that by using a different typedef which we have
> total control over.
> 
> Tested on x86_64-linux and i686-linux, ok for trunk?

Ok.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-26 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 20:36 [PATCH] Fix up method-nonnull-1.mm testcase on Solaris (PR testsuite/88090) Jakub Jelinek
2018-11-26 21:23 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).