public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed] testsuite, Objective-C : Fix call-super-2.m for newer NeXT  headers.
@ 2020-10-11 14:54 Iain Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain Sandoe @ 2020-10-11 14:54 UTC (permalink / raw)
  To: GCC Patches

Hi,

We were using a callout to runtime.h which, eventually brings in the system
runtime.h.  One newer versions of the Darwin/NeXT headers this declares the
objc_getClass() function as returning Class, rather than the internal
representation of that.  This breaks a fragile assumption in objc-act that
the use of these internal functions can be deduced by looking at the function
type.  Ultimately, the fragility should be fixed - but this fixes up the test
so that it only uses the compiler's forward declaration of the function.

tested across the Darwin range, and on x86_64-linux
pushed to master
thanks
Iain

gcc/testsuite/ChangeLog:

	* objc.dg/call-super-2.m: Remove inclusion of runtime.h.
	Add a FIXME about the test portability.
---
 gcc/testsuite/objc.dg/call-super-2.m | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/objc.dg/call-super-2.m b/gcc/testsuite/objc.dg/call-super-2.m
index 0a3765f07fb..836cad92126 100644
--- a/gcc/testsuite/objc.dg/call-super-2.m
+++ b/gcc/testsuite/objc.dg/call-super-2.m
@@ -3,7 +3,8 @@
 /* { dg-do compile } */
 
 #include "../objc-obj-c++-shared/TestsuiteObject.h"
-#include "../objc-obj-c++-shared/runtime.h"
+/* NOTE: we are relying on the built-in type for objc_getClass being used
+   rather than the one that might come from including <objc/runtime.h>.  */
 #include <stddef.h>
 
 /* FIXME: This is temporary.  At the moment, the compiler, when
@@ -14,6 +15,9 @@
 # define objc_getClass(C) objc_get_class(C)
 #endif
 
+/* FIXME: casting of super is not permitted by clang, so that many of the
+   tests here are testing non-portable code.  */
+
 @protocol Func
 + (int) class_func0;
 - (int) instance_func0;
-- 
2.24.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-11 14:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-11 14:54 [pushed] testsuite, Objective-C : Fix call-super-2.m for newer NeXT headers Iain Sandoe

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).