diff mbox series

[pushed] testsuite, Objective-C : Add initialize method to root class.

Message ID 5E9FE341-A42E-45F9-94D9-B1870EB253CC@sandoe.co.uk
State New
Headers show
Series [pushed] testsuite, Objective-C : Add initialize method to root class. | expand

Commit Message

Iain Sandoe Oct. 11, 2020, 2:27 p.m. UTC
Hi

Older versions of the runtime don't like it when the root class
has a missing initialize method.  They try to forward to an non-
existent super class resulting in a crash.

TODO: maybe we can diagnose this.

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

gcc/testsuite/ChangeLog:

	* objc.dg/ivar-scope-4.m: Add inititialize method to the
	root class.
---
 gcc/testsuite/objc.dg/ivar-scope-4.m | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/gcc/testsuite/objc.dg/ivar-scope-4.m b/gcc/testsuite/objc.dg/ivar-scope-4.m
index f7209724be9..5fc29f90bdc 100644
--- a/gcc/testsuite/objc.dg/ivar-scope-4.m
+++ b/gcc/testsuite/objc.dg/ivar-scope-4.m
@@ -18,6 +18,7 @@  int someivar = 1;
   int someivar;
 }
 
++ (id) initialize;
 + (id) alloc;
 - (id) init;
 - (int) getGlobal;
@@ -26,6 +27,11 @@  int someivar = 1;
 @end
 
 @implementation MyClass
++ (id) initialize
+{
+  return self;
+}
+
 + (id) alloc
 {
   return class_createInstance (self, 0);