From: Iain Sandoe Date: Mon, 5 Oct 2020 10:38:12 +0000 (+0100) Subject: testsuite, Objective-C : Add initialize method to root class. X-Git-Tag: basepoints/gcc-12~4466 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40330e70770d1c42ca51f6d84b70b04537687bc5;p=thirdparty%2Fgcc.git testsuite, Objective-C : Add initialize method to root class. 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. gcc/testsuite/ChangeLog: * objc.dg/ivar-scope-4.m: Add inititialize method to the root class. --- diff --git a/gcc/testsuite/objc.dg/ivar-scope-4.m b/gcc/testsuite/objc.dg/ivar-scope-4.m index f7209724be99..5fc29f90bdcb 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);