From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3025 invoked by alias); 6 Jun 2011 20:09:21 -0000 Received: (qmail 2983 invoked by uid 22791); 6 Jun 2011 20:08:50 -0000 X-SWARE-Spam-Status: No, hits=4.1 required=5.0 tests=AWL,BAYES_99,KAM_STOCKTIP,RCVD_IN_DNSWL_LOW,SARE_MONEYTERMS,TW_BJ,TW_CP,TW_CX,TW_FN X-Spam-Check-By: sourceware.org Received: from smtp141.iad.emailsrvr.com (HELO smtp141.iad.emailsrvr.com) (207.97.245.141) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jun 2011 20:08:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp54.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id C8C592B0494; Mon, 6 Jun 2011 16:08:02 -0400 (EDT) Received: by smtp54.relay.iad1a.emailsrvr.com (Authenticated sender: nicola.pero-AT-meta-innovation.com) with ESMTPSA id 06DE52B0397; Mon, 6 Jun 2011 16:07:57 -0400 (EDT) Subject: Re: objc/objc++: switch all testcases to Modern Objective-C runtime API Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/mixed; boundary=Apple-Mail-18-518678609 From: Nicola Pero In-Reply-To: <20110606192843.DBCA93BE19@mailhost.lps.ens.fr> Date: Mon, 06 Jun 2011 20:09:00 -0000 Cc: gcc-patches@gcc.gnu.org, howarth@bromo.med.uc.edu, mikestump@comcast.net, developer@sandoe-acoustics.co.uk Message-Id: <50A7B149-815A-4E4B-A301-0C0FD462D31B@meta-innovation.com> References: <20110606192843.DBCA93BE19@mailhost.lps.ens.fr> To: dominiq@lps.ens.fr (Dominique Dhumieres) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00460.txt.bz2 --Apple-Mail-18-518678609 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Content-length: 435 Thanks Dominique :-) > On x86_64-apple-darwin10 I have the following failures with -m32 darwin10 is Mac OS X 10.6, right ? I have access to that. So, how do you = test with -m32 ? I thought the testsuite would do that (test both with -m32 and -m64 if they= are available) automatically, but clearly it doesn't, because I never saw these failures ;-) > The failures are The revamped patch in attach should fix them. :-) Thanks --Apple-Mail-18-518678609 Content-Disposition: attachment; filename=patch.txt Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: quoted-printable Content-length: 348143 Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ChangeLog (revision 174696) +++ ChangeLog (working copy) @@ -1,3 +1,401 @@ +2011-06-06 Nicola Pero + + Updated all testcases in the ObjC/ObjC++ testsuites to use the + Modern Objective-C runtime API. + * objc/execute/next_mapping.h: Removed. + * objc-obj-c++-shared/next-mapping.h: Removed. + * objc-obj-c++-shared/Object1.h: Removed. + * objc-obj-c++-shared/Object1.m: Removed. + * objc-obj-c++-shared/Object1.mm: Removed. + * objc-obj-c++-shared/Object1-implementation.h: Removed. + * objc-obj-c++-shared/Protocol1.h: Removed. + * objc-obj-c++-shared/objc-test-suite-types.h: Removed definition + of ProtoBool, IVAR_T and METHOD. + * objc-obj-c++-shared/runtime.h: New. + * objc-obj-c++-shared/TestsuiteObject.h: New. + * objc-obj-c++-shared/TestsuiteObject.m: New. +=09 + * objc/compile/trivial.m: Use TestsuiteObject instead of Object.=09 + * objc/execute/IMP.m: Include ../../objc-obj-c++-shared/runtime.h. + Use the Modern Objective-C runtime API. ([TestClass -next:]): Made + it a class method. + * objc/execute/_cmd.m: Include + ../../objc-obj-c++-shared/runtime.h. Use the Modern Objective-C + runtime API. ([TestClass +initialize]): Include this method also + with the GNU runtime. + * objc/execute/accessing_ivars.m: Use TestsuiteObject instead of + Object. ([-setValue:]): Return void. + * objc/execute/bf-common.h: Do not include objc/objc-encoding.h + with the GNU runtime. Include + ../../objc-obj-c++-shared/runtime.h. Do not define objc_get_class + for the NeXT runtime. Use the existing print_ivars() and + compare_structures() implementations for the old NeXT runtime. + Added new implementations for the Modern GNU and NeXT runtimes. + Enable the testcase (and hence all the bf-* ones) for __OBJC2__ as + well. (main): Use objc_getClass(). Use return instead of exit. + * objc/execute/bycopy-1.m: Include objc/objc.h instead of + ../../objc-obj-c++-shared/Protocol1.h. (main): Use return instead + of exit(). + * objc/execute/bycopy-2.m: Include objc/objc.h instead of + ../../objc-obj-c++-shared/Protocol1.h. Use TestsuiteObject + instead of Object. (main): Use return instead of exit(). + * objc/execute/bycopy-3.m: Updated includes. Use TestsuiteObject + instead of Object. Removed prototype for exit(). (main): Use + return instead of exit(). Use the Modern Objective-C runtime API. + * objc/execute/cascading-1.m: Use TestsuiteObject instead of + Object. + * objc/execute/class-tests-1.h: Include + ../../objc-obj-c++-shared/runtime.h. Use the Modern Objective-C + runtime API. (test_class_with_superclass): Do not call [Object + class]. There is no need to with the current libobjc. + * objc/execute/class-tests-2.h: Include + ../../objc-obj-c++-shared/runtime.h. Use the Modern Objective-C + runtime API. + * objc/execute/class-1.m: Do not include and + ../../objc-obj-c++-shared/next-mapping.h. + * objc/execute/class-2.m: Likewise. + * objc/execute/class-3.m: Likewise. + * objc/execute/class-4.m: Do not include and + ../../objc-obj-c++-shared/next-mapping.h. ([RootClass + +initialize]): Include this method also with the GNU + runtime. (main): Use the Modern Objective-C runtime API. + * objc/execute/class-5.m: Likewise. + * objc/execute/class-6.m: Likewise. + * objc/execute/class-7.m: Likewise. + * objc/execute/class-8.m: Likewise. + * objc/execute/class-9.m: Likewise. + * objc/execute/class-10.m: Likewise. + * objc/execute/class-11.m: Likewise. + * objc/execute/class-12.m: Likewise. + * objc/execute/class-13.m: Likewise. + * objc/execute/class-14.m: Likewise. + * objc/execute/class_self-1.m ([TestClass +initialize]): Include + this method also with the GNU runtime. + * objc/execute/class_self-2.m: ([TestClass +initialize], [ClassA + +initialize]): Include this method also with the GNU runtime. + * objc/execute/compatibility_alias.m: Use TestsuiteObject instead + of Object. + * objc/execute/encode-1.m: Likewise. + * objc/execute/enumeration-1.m: Likewise. + * objc/execute/enumeration-2.m: Likewise. + * objc/execute/exceptions/catchall-1.m: Likewise. + * objc/execute/exceptions/finally-1.m: Likewise. + * objc/execute/exceptions/foward-1.m: Likewise. + * objc/execute/exceptions/local-variables-1.m: Likewise.=09 + * objc/execute/exceptions/throw-nil.m: Likewise. + * objc/execute/exceptions/trivial.m: Likewise. + * objc/execute/exceptions/handler-1.m: Use TestsuiteObject instead + of Object. Include objc/runtime.h instead of objc/objc-api.h. + * objc/execute/exceptions/matcher-1.m: Likewise. + * objc/execute/formal_protocol-1.m: Use TestsuiteObject instead of + Object. + * objc/execute/formal_protocol-2.m: Likewise. + * objc/execute/formal_protocol-3.m: Likewise. + * objc/execute/formal_protocol-4.m: Likewise. + * objc/execute/formal_protocol-5.m: Include + ../../objc-obj-c++-shared/runtime.h. (main): Always use + protocol_getName(). + * objc/execute/formal_protocol-6.m: Likewise. + * objc/execute/formal_protocol-7.m: Use TestsuiteObject instead of + Object. Include instead of + ../../objc-obj-c++-shared/Protocol1.h. + * objc/execute/function-message-1.m: Use TestsuiteObject intead of + Object. + * objc/execute/informal_protocol.m: Likewise. + * objc/execute/load-3.m: Likewise. + * objc/execute/many_args_method.m ([TestClass +initialize]): + Include this method with the GNU runtime as well. + * objc/execute/nested-3.m ([Test +initialize]): Likewise. + * objc/execute/nested-func-1.m: Use TestsuiteObject + instead of Object. + * objc/execute/nil_method-1.m: Likewise. + * objc/execute/no_clash.m: Likewise. + * objc/execute/np-1.m: Do not include + ../../objc-obj-c++-shared/Protocol1.h. + (main): Use return instead of exit(). + * objc/execute/np-2.m: Do not include + ../../objc-obj-c++-shared/Protocol1.h. + ([MyObject +initialize]): Include this method also with the GNU + runtime. (main): Use return instead of exit(). + * objc/execute/object_is_class.m: Include + ../../objc-obj-c++-shared/runtime.h. Use TestsuiteObject instead + of Object. (main): Use the Modern Objective-C runtime API. + * objc/execute/object_is_meta_class.m: Likewise. + * objc/execute/private.m: Use TestsuiteObject instead of Object. + * objc/execute/protocol-isEqual-1.m: Include objc/Protocol.h + instead of ../objc-obj-c++-shared/Protocol1.h. Include + ../../objc-obj-c++-shared/runtime.h. (main): Use the Modern + Objective-C runtime API. + * objc/execute/protocol-isEqual-2.m: Likewise. + * objc/execute/protocol-isEqual-3.m: Likewise. + * objc/execute/protocol-isEqual-4.m: Likewise. + * objc/execute/redefining_self.m ([TestClass +initialize]): + Include this method with the GNU runtime as well. + * objc/execute/root_methods.m: Include + ../../objc-obj-c++-shared/runtime.h. ([RootClass +initialize]): + Include this method with the GNU runtime as well. + (main): Use the Modern Objective-C runtime API. + * objc/execute/selector-1.m: Include + ../../objc-obj-c++-shared/runtime.h. Use TestsuiteObject instead + of Object. (main): Use the Modern Objective-C runtime API. + * objc/execute/static-1.m ([Test +initialize]): Include this + method with the GNU runtime as well. + * objc/execute/static-2.m: Likewise. + * objc/execute/trivial.m: Use TestsuiteObject instead of Object. + * objc/execute/va_method.m: Do not include objc/objc-api.h. + ([MathClass +initialize]): Include this method with the GNU + runtime as well. + * objc.dg/attributes/categ-attribute-1.m: Use TestsuiteObject + instead of Object. + * obj-c++.dg/attributes/categ-attribute-1.mm: Likewise.=09 + * objc.dg/attributes/categ-attributes-2.m: Likewise. + * obj-c++.dg/attributes/categ-attributes-2.mm: Likewise. + * objc.dg/attributes/method-attribute-1.m: Likewise. + * obj-c++.dg/attributes/method-attribute-1.mm: Likewise.=09 + * objc.dg/attributes/method-attribute-2.m: Likewise. + * obj-c++.dg/attributes/method-attribute-2.mm: Likewise.=09 + * objc.dg/attributes/method-attribute-3.m: Likewise. + * obj-c++.dg/attributes/method-attribute-3.mm: Likewise.=09 + * obj-c++.dg/basic.mm: Use TestsuiteObject instead of Object. + * objc.dg/bitfield-1.m: Use TestsuiteObject instead of Object. + * obj-c++.dg/bitfield-1.mm: Likewise. + * obj-c++.dg/bitfield-2.mm: Likewise + * objc.dg/bitfield-3.m: Likewise. + * obj-c++.dg/bitfield-4.mm: Likewise. + * objc.dg/bitfield-5.m: Likewise + * objc.dg/call-super-1.m: Likewise. + * objc.dg/call-super-2.m: Use TestsuiteObject instead of Object. + Use objc_getClass() instead of objc_get_class(), but for the GNU + runtime redefine objc_getClass as objc_get_class. Include + ../objc-obj-c++-shared/runtime.h. + * objc.dg/call-super-3.m: Use TestsuiteObject instead of Object. + * objc.dg/category-1.m: Use TestsuiteObject instead of Object. + Use the Modern Objective-C runtime API.=09 + * objc.dg/class-protocol-1.m: Include + ../objc-obj-c++-shared/runtime.h instead of objc/objc-api.h. + * obj-c++.dg/class-protocol-1.mm: Likewise.=09 + * objc.dg/comp-types-8.m: Use TestsuiteObject instead of Object. + * objc.dg/comp-types-10.m: Likewise. + * objc.dg/comp-types-11.m: Likewise. + * objc.dg/comp-types-12.m: Likewise. + * obj-c++.dg/comp-types-9.mm: Likewise. + * obj-c++.dg/comp-types-11.mm: Likewise. + * obj-c++.dg/comp-types-12.mm: Likewise. + * obj-c++.dg/comp-types-13.mm: Likewise. + * obj-c++.dg/cxx-ivars-1.mm: Likewise. + * obj-c++.dg/cxx-ivars-2.mm: Likewise. + * obj-c++.dg/cxx-scope-1.mm: Likewise. + * obj-c++.dg/cxx-scope-2.mm: Likewise. + * objc.dg/defs.m: Use TestsuiteObject instead of Object. + * objc.dg/desig-init-1.m: Likewise. + * obj-c++.dg/defs.mm: Likewise. + * objc.dg/exceptions-2.m: Likewise. + * obj-c++.dg/except-1.mm: Likewise. + * obj-c++.dg/exceptions-2.mm: Likewise. + * objc.dg/encode-2.m: Use TestsuiteObject instead of Object. + Use the Modern Objective-C runtime API. + * objc.dg/encode-3.m: Use TestsuiteObject instead of Object. Use + the Modern Objective-C runtime API. Do not include + ../objc-obj-c++-shared/objc-test-suite-types.h. Define ProtoBool. + * objc.dg/encode-4.m: Use TestsuiteObject instead of Object. Use + the Modern Objective-C runtime API except when using an older NeXT + runtime. + * objc.dg/encode-5.m: Use TestsuiteObject instead of Object. Use + the Modern Objective-C runtime API. + * objc.dg/encode-7.m: Include objc/runtime.h instead of + objc/encoding.h.=09 + * objc.dg/encode-7-next.m: Use TestsuiteObject instead of Object. + * objc.dg/encode-7-next-64bit.m: Updated include. + * objc.dg/encode-8.m: Include objc/runtime.h instead of + objc/encoding.h. + * obj-c++.dg/encode-4.mm: Use TestsuiteObject instead of Object. Use + the Modern Objective-C runtime API. + * obj-c++.dg/encode-5.mm: Use TestsuiteObject instead of Object. + Use the Modern Objective-C runtime API. Include objc/Protocol.h + instead of ../objc-obj-c++-shared/Protocol1.h. + * obj-c++.dg/encode-6.mm: Use TestsuiteObject instead of Object. Use + the Modern Objective-C runtime API except when using an older NeXT + runtime. + * obj-c++.dg/encode-7.mm: Use TestsuiteObject instead of Object. Use + the Modern Objective-C runtime API.=09 + * objc.dg/fix-and-continue-1.m: Use TestsuiteObject instead of + Object. + * obj-c++.dg/fix-and-continue-2.mm: Likewise. + * objc.dg/fix-and-continue-2.m: Likewise. + * objc.dg/foreach-1.m: Likewise. + * objc.dg/foreach-2.m: Likewise. + * objc.dg/foreach-3.m: Likewise. + * objc.dg/foreach-4.m: Likewise. + * objc.dg/foreach-5.m: Likewise. + * objc.dg/foreach-6.m: Likewise. + * objc.dg/foreach-7.m: Likewise. + * objc.dg/func-ptr-1.m: Use TestsuiteObject instead of + Object. + * objc.dg/func-ptr-2.m: Likewise. + * objc.dg/fsf-package-0.m: Use TestsuiteObject instead of Object. + Do not include objc/objc-api.h. + * obj-c++.dg/fsf-package-0.mm: Likewise. + * objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c (switchfiles): + Include objc/runtime.h instead of objc/encoding.h.=09 + * objc.dg/gnu-runtime-1.m: Updated to use TestsuiteObject instead + of Object. + * obj-c++.dg/gnu-runtime-1.mm: Likewise. + * objc.dg/gnu-runtime-3.m: Likewise. + * obj-c++.dg/gnu-runtime-3.mm: Likewise. + * objc.dg/headers.m: Include objc/runtime.h instead of + objc/encoding.h for the GNU runtime. Include objc/objc-api.h only + for the NeXT runtime. + * objc.dg/isa-field-1.m: Use TestsuiteObject instead of Object. + * obj-c++.dg/isa-field-1.mm: Likewise. + * obj-c++.dg/ivar-list-semi.mm: Likewise. + * objc.dg/layout-1.m: Likewise. + * objc.dg/layout-2.m: Likewise. + * objc.dg/local-decl-2.m: Likewise. + * objc.dg/lookup-1.m: Use TestsuiteObject instead of + Object. ([Container +elementForView:]): Use + class_conformsToProtocol(). + * obj-c++.dg/lookup-2.mm: Likewise. + * obj-c++.dg/layout-1.mm: Use TestsuiteObject instead of Object. + * obj-c++.dg/local-decl-1.mm: Likewise. + * objc.dg/method-3.m: Likewise. + * objc.dg/method-4.m: Likewise. + * objc.dg/method-6.m: Include objc/Protocol.h instead of + ../objc-obj-c++-shared/Protocol1.h. + * objc.dg/method-7.m: Use TestsuiteObject instead of Object. + * objc.dg/method-9.m: Likewise. + * objc.dg/method-10.m: Likewise. + * objc.dg/method-13.m ([Root +initialize]): Include this method + also for the GNU runtime. (main): Use objc_getClass() also for + the GNU runtime. + * objc.dg/method-15.m: Use TestsuiteObject instead of Object. + * objc.dg/method-17.m: Likewise. + * objc.dg/method-19.m: Likewise. + * objc.dg/method-20b.m: Likewise. + * obj-c++.dg/method-2.mm: Likewise. + * obj-c++.dg/method-6.mm: Likewise. + * obj-c++.dg/method-10.mm: Likewise. + * obj-c++.dg/method-11.mm: Likewise. + * obj-c++.dg/method-12.mm: Include objc/Protocol.h instead of + ../objc-obj-c++-shared/Protocol1.h. + * obj-c++.dg/method-13.mm: Use TestsuiteObject instead of Object. + * obj-c++.dg/method-15.mm: Likewise. + * obj-c++.dg/method-17.mm: Likewise. + * obj-c++.dg/method-19.mm: Updated includes. ([Root + +initialize]): Include this method also for the GNU + runtime. (main): Use objc_getClass() also for the GNU runtime. + * obj-c++.dg/method-21.mm: Use TestsuiteObject instead of Object. + * obj-c++.dg/method-22.mm: Likewise. + * obj-c++.dg/method-23.mm: Likewise. + * obj-c++.dg/no-extra-load.mm: Likewise. + * objc.dg/objc-fast-4.m: Likewise. + * objc.dg/objc-gc-4.m: Likewise. + * obj-c++.dg/objc-gc-3.mm: Likewise. + * objc.dg/pr18255.m: Include objc/runtime.h. (main): Use + protocol_getMethodDescription() instead of [Protocol + -descriptionForInstanceMethod]. + * objc.dg/pr23214.m ([Object(TS_CAT) -class]): Renamed to test. + Made it available with all runtimes. (main): Call -test instead + of -class. + * objc.dg/pr45878.m ([Object -isEqual:]): Renamed to testIsEqual, + and put into a category. + * objc.dg/proto-lossage-2.m: Use TestsuiteObject instead of + Object. Include objc/objc.h. + * obj-c++.dg/proto-lossage-2.mm: Likewise. + * objc.dg/proto-lossage-3.m: Updated includes. (MyClass): + New. (main): Use protocol_getMethodDescription() instead + of [Protocol -descriptionForInstanceMethod] and [Protocol + -descriptionForClassMethod]. + * obj-c++.dg/proto-lossage-3.mm: Likewise. + * objc.dg/proto-qual-1.m: Updated includes. Use the Modern + Objective-C runtime API. + * obj-c++.dg/proto-qual-1.mm: Likewise.=09 + * objc.dg/property/property-1.m: Use TestsuiteObject instead of + Object. + * obj-c++.dg/property/property-1.mm: Likewise. + * obj-c++.dg/qual-types-1.mm: Likewise. + * objc.dg/selector-2.m: Include objc/objc.h instead of + ../objc-obj-c++-shared/Object1.h. + * obj-c++.dg/selector-2.mm: Likewise. + * obj-c++.dg/selector-5.mm: Likewise. + * obj-c++.dg/selector-6.mm: Likewise. + * objc.dg/set-not-used-1.m: Use TestsuiteObject instead of + Object. Do not include objc/objc-api.h. + * obj-c++.dg/set-not-used-1.mm: Likewise. + * objc.dg/sizeof-1.m: Use TestsuiteObject instead of Object. + * objc.dg/stret-1.m: Likewise. + * objc.dg/stret-2.m: Likewise. + * obj-c++.dg/super-class-2.mm: Likewise. + * objc.dg/super-class-3.m: Likewise. + * objc.dg/super-class-4.m: Likewise. + * objc.dg/sync-2.m: Likewise. + * obj-c++.dg/sync-2.mm: Likewise. + * objc.dg/sync-1.m: Include objc/objc.h instead of + ../objc-obj-c++-shared/Object1.h. + * objc.dg/special/unclaimed-category-1.h (TestClass): Always use + 'Class' as the type of 'isa'. + * objc.dg/special/unclaimed-category-1.m: Use the Modern + Objective-C runtime API. ([TestClass +initialize]): Include this + method with the GNU runtime as well. + * objc.dg/strings/strings-1.m: Updated includes. + * obj-c++.dg/strings/strings-1.mm: Likewise. + * obj-c++.dg/strings/const-str-12.mm: Updated to be identical to + objc.dg/strings/const-str-12b.m. + * obj-c++.dg/template-1.mm: Use TestsuiteObject intead of Object. + * obj-c++.dg/template-3.mm: Likewise. + * obj-c++.dg/template-4.mm: Likewise. + * objc.dg/threedotthree-abi-1.m: Updated includes. Use Modern + Objective-C runtime API. + * obj-c++.dg/threedotthree-abi-1.mm: Likewise. + * objc.dg/try-catch-1.m: Use TestsuiteObject instead of Object. + * obj-c++.dg/try-catch-1.mm: Likewise. + * obj-c++.dg/try-catch-2.mm: Likewise. + * objc.dg/try-catch-3.m: Likewise. + * obj-c++.dg/try-catch-3.mm: Likewise. + * objc.dg/try-catch-6.m: Likewise. + * objc.dg/try-catch-7.m: Likewise. + * obj-c++.dg/try-catch-7.mm: Likewise. + * obj-c++.dg/try-catch-8.mm: Likewise. + * obj-c++.dg/try-catch-9.mm: Likewise. + * objc.dg/try-catch-10.m: Likewise. + * obj-c++.dg/try-catch-11.mm: Likewise. + * objc.dg/typedef-alias-1.m: Use TestsuiteObject instead of + Object. Include objc/objc.h. + * obj-c++.dg/typedef-alias-1.mm: Likewise. + * objc.dg/type-size-2.m: Use the Modern Objective-C runtime API. + * objc.dg/torture/forward-1.m: Use TestsuiteObject intead of + Object. Use Modern Objective-C runtime API. Do not use + performv::. + * objc.dg/torture/trivial.m: Use TestsuiteObject intead of Object. + * obj-c++.dg/torture/trivial.mm: Likewise.=09 + * objc.dg/torture/strings/const-str-10.m: Include objc/Object.h + instead of ../objc-obj-c++-shared/Object1.h. Include + ../objc-obj-c++-shared/runtime.h. + * obj-c++.dg/torture/strings/const-str-10.mm: Likewise. + * objc.dg/torture/strings/const-str-11.m: Likewise. + * obj-c++.dg/torture/strings/const-str-11.mm: Likewise. + * objc.dg/torture/strings/const-str-9.m: Likewise. + * obj-c++.dg/torture/strings/const-str-9.mm: Likewise. + * objc.dg/torture/strings/const-str-7.m: Use TestsuiteObject + instead of Object. Only add _FooClassReference if + __NEXT_RUNTIME__. + * obj-c++.dg/torture/strings/const-str-7.mm: Likewise. + * objc.dg/torture/strings/const-str-8.m: Likewise. + * obj-c++.dg/torture/strings/const-str-8.mm: Likewise. + * obj-c++.dg/torture/strings/string1.mm: Updated includes and + additional sources. + * objc.dg/torture/tls/thr-init-3.m: Use TestsuiteObject instead of + Object. + * obj-c++.dg/torture/tls/thr-init-3.mm: Likewise. + * objc.dg/va-meth-1.m: Use TestsuiteObject instead of Object. + * obj-c++.dg/va-meth-1.mm: Likewise. + * objc.dg/zero-link-1.m: Include objc/Object.h instead of + ../objc-obj-c++-shared/Object1.h. + * objc.dg/zero-link-3.m: Likewise.=09 +=09 +2011-06-06 Nicola Pero + + * obj-c++.dg/try-catch-2.mm: Fixed unterminated comment. +=09 2011-06-06 Mikael Pettersson =20 PR tree-optimization/49243 Index: objc/execute/class-11.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-11.m (revision 174696) +++ objc/execute/class-11.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with an ivar and accessor methods and a subclass overriding the superclass' @@ -16,9 +14,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 @interface SubClass : RootClass @@ -76,10 +72,10 @@ int main (void) test_that_class_has_instance_method ("SubSubClass", @selector (state)); test_that_class_has_instance_method ("SubSubClass", @selector (shift)); =20=20=20 - object =3D class_create_instance (objc_lookup_class ("SubClass")); + object =3D class_createInstance (objc_getClass ("SubClass"), 0); test_accessor_method (object, 0, -1, -1, 1, 1); =20 - sub_object =3D class_create_instance (objc_lookup_class ("SubSubClass")); + sub_object =3D class_createInstance (objc_getClass ("SubSubClass"), 0); test_accessor_method (sub_object, 1, -1, 0, 1, 2); =20 return 0; Index: objc/execute/enumeration-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/enumeration-1.m (revision 174696) +++ objc/execute/enumeration-1.m (working copy) @@ -1,7 +1,6 @@ /* Contributed by Nicola Pero - Wed Dec 5 17:12:40 GMT 2001 */ #include -#import "../../objc-obj-c++-shared/Object1.h" -#include +#import "../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* Test using a bitfield enumeration ivar. */ =20 @@ -11,7 +10,7 @@ typedef enum white } color; =20 -@interface TestClass: Object +@interface TestClass: TestsuiteObject { color c:2; } @@ -48,4 +47,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/static-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/static-2.m (revision 174696) +++ objc/execute/static-2.m (working copy) @@ -22,9 +22,7 @@ static int test (void) return test (); } =20 -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 int main (void) Index: objc/execute/object_is_class.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/object_is_class.m (revision 174696) +++ objc/execute/object_is_class.m (working copy) @@ -1,16 +1,13 @@ /* Contributed by Nicola Pero - Tue Jul 3 10:55:21 BST 2001 */ -#ifdef __NEXT_RUNTIME__ -# include "../../objc-obj-c++-shared/next-mapping.h" -#else -# include -#endif -#include "../../objc-obj-c++-shared/Object1.h" =20 +#include "../../objc-obj-c++-shared/runtime.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" + /* This test demonstrate a failure in object_is_class which was fixed */ =20 /* Create a class whose instance variables mirror the struct used for Class structures in the runtime ... yes we're feeling evil today */ -@interface EvilClass : Object +@interface EvilClass : TestsuiteObject { Class super_class; const char* name; @@ -35,7 +32,7 @@ int main (void) EvilClass *evilObject =3D [EvilClass new]; =20=20=20 /* Now check that the object is not a class object */ - if (object_is_class (evilObject)) + if (class_isMetaClass (object_getClass (evilObject))) { printf ("object_is_class failed\n"); abort (); @@ -43,4 +40,3 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" Index: objc/execute/class-13.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-13.m (revision 174696) +++ objc/execute/class-13.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with a class accessor methods and a subclass overriding the superclass' implementation @@ -15,9 +13,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 static int class_variable =3D 0; @@ -65,10 +61,10 @@ int main (void) test_that_class_has_class_method ("SubSubClass", @selector (setState:)); test_that_class_has_class_method ("SubSubClass", @selector (state)); =20=20=20 - class =3D objc_lookup_class ("SubClass"); + class =3D objc_getClass ("SubClass"); test_accessor_method (class, 0, -1, -1, 1, 1); =20 - sub_class =3D objc_lookup_class ("SubSubClass"); + sub_class =3D objc_getClass ("SubSubClass"); class_variable =3D 0; test_accessor_method (sub_class, 1, -1, 0, 1, 2); =20 Index: objc/execute/formal_protocol-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/formal_protocol-2.m (revision 174696) +++ objc/execute/formal_protocol-2.m (working copy) @@ -1,7 +1,7 @@ /* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */ =20 #include -#import "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* Test defining a protocol, a class adopting it, and using an object of type `id '. */ @@ -11,7 +11,7 @@ - (void) setEnabled: (BOOL)flag; @end =20 -@interface Feature : Object +@interface Feature : TestsuiteObject { const char *name; BOOL isEnabled; @@ -43,4 +43,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/formal_protocol-4.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/formal_protocol-4.m (revision 174696) +++ objc/execute/formal_protocol-4.m (working copy) @@ -1,7 +1,7 @@ /* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */ =20 #include -#import "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* Test defining a protocol, a class adopting it in a category */ =20 @@ -9,7 +9,7 @@ - (int) importance; @end =20 -@interface Feature : Object +@interface Feature : TestsuiteObject @end =20 @implementation Feature @@ -38,4 +38,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/class-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-1.m (revision 174696) +++ objc/execute/class-1.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a RootClass */ =20 Index: objc/execute/bycopy-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/bycopy-1.m (revision 174696) +++ objc/execute/bycopy-1.m (working copy) @@ -2,9 +2,8 @@ * Contributed by Nicola Pero * Fri Feb 2 11:48:01 GMT 2001 */ +#include =20 -#include "../../objc-obj-c++-shared/Protocol1.h" - @protocol MyProtocol - (bycopy id) bycopyMethod; @end @@ -13,7 +12,7 @@ int main (void) { [nil bycopyMethod]; =20 - exit (0); + return 0; } =20 =20 Index: objc/execute/formal_protocol-6.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/formal_protocol-6.m (revision 174696) +++ objc/execute/formal_protocol-6.m (working copy) @@ -2,7 +2,7 @@ =20 #include #include -#include "../../objc-obj-c++-shared/next-mapping.h" +#include "../../objc-obj-c++-shared/runtime.h" =20 /* Test defining a protocol, and accessing it using @protocol */ =20 @@ -17,11 +17,7 @@ int main (void) { Protocol *protocol =3D @protocol (Evaluating); =20 -#ifdef NEXT_OBJC_USE_NEW_INTERFACE if (strcmp (protocol_getName(protocol), "Evaluating")) -#else - if (strcmp ([protocol name], "Evaluating")) -#endif { abort (); } Index: objc/execute/bycopy-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/bycopy-3.m (revision 174696) +++ objc/execute/bycopy-3.m (working copy) @@ -9,27 +9,18 @@ * interfere with what we are testing, which is that the `bycopy' * keyword generates the _F_BYCOPY qualifier for the return type. */ =20 -extern void exit (int) __attribute__ ((noreturn)); extern int printf (const char *, ...); =20 -#include +#include +#include "../../objc-obj-c++-shared/runtime.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 -#ifndef __NEXT_RUNTIME__ -#include -#endif - @protocol MyProtocol + (bycopy id) bycopyMethod; @end =20 /* This no-op class to keep it compile under broken gcc 3.x */ -@interface MyObject : Object =20 -#ifdef __OBJC2__ -+ (id) initialize; -+ (id) alloc; -+ new; -- init; -#endif +@interface MyObject : TestsuiteObject =20 @end =20 @implementation MyObject @@ -37,12 +28,6 @@ extern int printf (const char *, ...); { return [MyObject alloc]; } -#ifdef __OBJC2__ -+ initialize {return self;} -+ alloc { return class_createInstance (self, 0);} -+ new { return [[self alloc] init]; } -- init {return self;} -#endif @end =20 /* The following header, together with the implementation included below, @@ -52,7 +37,7 @@ extern int printf (const char *, ...); =20 int main (void) { - struct objc_method_description *method; + struct objc_method_description method; const char *method_types; unsigned qualifiers; Protocol *protocol; @@ -64,17 +49,19 @@ int main (void) protocol =3D @protocol (MyProtocol); =20 /* Ask to the protocol for the description of the method bycopyMethod */ - method =3D [protocol descriptionForClassMethod: @selector (bycopyMethod)= ]; - if (method =3D=3D NULL) - { - printf ("Could not find method bycopyMethod in protocol!\n"); - exit (1); - } + method =3D protocol_getMethodDescription (protocol, @selector (bycopyMet= hod), + YES, NO); =20 /* Get the method types for the method - which encode return type, arguments etc. */ - method_types =3D method->types; + method_types =3D method.types; =20 + if (method_types =3D=3D NULL) + { + printf ("Could not find method bycopyMethod in protocol!\n"); + return 1; + } + /* Get the qualifiers for the return type */ qualifiers =3D objc_get_type_qualifiers (method_types); =20 @@ -82,7 +69,7 @@ int main (void) if (! (qualifiers & _F_BYCOPY)) { printf ("Failed - selector does not contain _F_BYCOPY qualifier!\n"); - exit (1); + return 1; } =20 /* Else, happy end */ Index: objc/execute/class-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-3.m (revision 174696) +++ objc/execute/class-3.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a minimal subclass tree */ =20 Index: objc/execute/class-5.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-5.m (revision 174696) +++ objc/execute/class-5.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with an ivar and accessor methods and a subclass overriding the superclass' @@ -15,9 +13,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 @interface SubClass : RootClass @@ -66,10 +62,10 @@ int main (void) test_that_class_has_instance_method ("SubSubClass", @selector (setState:= )); test_that_class_has_instance_method ("SubSubClass", @selector (state)); =20=20=20 - object =3D class_create_instance (objc_lookup_class ("SubClass")); + object =3D class_createInstance (objc_getClass ("SubClass"), 0); test_accessor_method (object, 0, -1, -1, 1, 1); =20 - sub_object =3D class_create_instance (objc_lookup_class ("SubSubClass")); + sub_object =3D class_createInstance (objc_getClass ("SubSubClass"), 0); test_accessor_method (sub_object, 1, -1, 0, 1, 2); =20 return 0; Index: objc/execute/class-7.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-7.m (revision 174696) +++ objc/execute/class-7.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with an ivar and accessor methods; accessor methods implemented in a separate @@ -15,9 +13,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 @interface SubClass : RootClass @@ -64,7 +60,7 @@ int main (void) test_that_class_has_instance_method ("SubClass", @selector (setState:)); test_that_class_has_instance_method ("SubClass", @selector (state)); =20 - object =3D class_create_instance (objc_lookup_class ("SubClass")); + object =3D class_createInstance (objc_getClass ("SubClass"), 0); test_accessor_method (object, 0, 1, 1, -3, -3); =20 return 0; Index: objc/execute/class-9.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-9.m (revision 174696) +++ objc/execute/class-9.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with an ivar and accessor methods and a subclass overriding the superclass' @@ -15,9 +13,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 @interface SubClass : RootClass @@ -69,10 +65,10 @@ int main (void) test_that_class_has_instance_method ("SubSubClass", @selector (setState:= )); test_that_class_has_instance_method ("SubSubClass", @selector (state)); =20=20=20 - object =3D class_create_instance (objc_lookup_class ("SubClass")); + object =3D class_createInstance (objc_getClass ("SubClass"), 0); test_accessor_method (object, 0, -1, -1, 1, 1); =20 - sub_object =3D class_create_instance (objc_lookup_class ("SubSubClass")); + sub_object =3D class_createInstance (objc_getClass ("SubSubClass"), 0); test_accessor_method (sub_object, 1, -1, 0, 1, 2); =20 return 0; Index: objc/execute/selector-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/selector-1.m (revision 174696) +++ objc/execute/selector-1.m (working copy) @@ -1,7 +1,7 @@ /* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */ #include -#include -#include +#include "../../objc-obj-c++-shared/runtime.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 int main (void) { @@ -9,11 +9,7 @@ int main (void) char *selname; =20 selector =3D @selector (alloc); -#ifdef __NEXT_RUNTIME__ selname =3D sel_getName (selector); -#else - selname =3D sel_get_name (selector); -#endif if (strcmp (selname, "alloc")) abort (); =20 Index: objc/execute/many_args_method.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/many_args_method.m (revision 174696) +++ objc/execute/many_args_method.m (working copy) @@ -30,9 +30,7 @@ { return [self sumInteger: a withInteger: b withInteger: c]; } -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 =20 Index: objc/execute/IMP.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/IMP.m (revision 174696) +++ objc/execute/IMP.m (working copy) @@ -1,9 +1,7 @@ /* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */ =20 #include -#include "../../objc-obj-c++-shared/next-mapping.h" -#include -#include +#include "../../objc-obj-c++-shared/runtime.h" =20 /* Test getting and calling the IMP of a method */ =20 @@ -11,11 +9,11 @@ { Class isa; } -- (int) next: (int)a; ++ (int) next: (int)a; @end =20 @implementation TestClass -- (int) next: (int)a ++ (int) next: (int)a { return a + 1; } @@ -27,10 +25,10 @@ int main (void) SEL selector; int (* imp) (id, SEL, int); =20=20=20 - class =3D objc_get_class ("TestClass"); + class =3D objc_getClass ("TestClass"); selector =3D @selector (next:); - imp =3D (int (*)(id, SEL, int))method_get_imp=20 - (class_get_class_method (class, selector)); + imp =3D (int (*)(id, SEL, int))method_getImplementation + (class_getClassMethod (class, selector)); =20=20=20 if (imp (class, selector, 5) !=3D 6) { Index: objc/execute/exceptions/catchall-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/exceptions/catchall-1.m (revision 174696) +++ objc/execute/exceptions/catchall-1.m (working copy) @@ -4,7 +4,7 @@ =20 #include #include -#import "../../../objc-obj-c++-shared/Object1.h" +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* The following is not required in actual user code; we include it here to check that the compiler generates an internal definition of @@ -13,10 +13,10 @@ =20 #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface Frob: Object +@interface Frob: TestsuiteObject @end =20 -@implementation Frob: Object +@implementation Frob: TestsuiteObject @end =20 static Frob* _connection =3D nil; @@ -24,7 +24,7 @@ static Frob* _connection =3D nil; //-------------------------------------------------------------------- =20 =20 -void test (Object* sendPort) +void test (TestsuiteObject* sendPort) { int cleanupPorts =3D 1; Frob* receivePort =3D nil; @@ -51,7 +51,7 @@ static Frob* _connection =3D nil; printf ("cleanupPorts =3D %d\n", cleanupPorts); printf ("---\n");=09=09 =20=09=09 - @throw [Object new]; + @throw [TestsuiteObject new]; } @catch(Frob *obj) { printf ("Exception caught by incorrect handler!\n"); @@ -71,7 +71,7 @@ static Frob* _connection =3D nil; =20 int main (void) { =20 - test((Object *)-1); + test((TestsuiteObject *)-1); return 0; } -#import "../../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/exceptions/trivial.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/exceptions/trivial.m (revision 174696) +++ objc/execute/exceptions/trivial.m (working copy) @@ -1,5 +1,5 @@ #include -#import "../../../objc-obj-c++-shared/Object1.h" +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* do nothing except prove we can compile and link code calling the ecceptions mechanism */ @@ -8,12 +8,10 @@ int main(void) { @try { int a =3D 1 ; - @throw [Object new]; + @throw [TestsuiteObject new]; } - @catch (Object *obj) { + @catch (TestsuiteObject *obj) { return 0; } abort(); } - -#import "../../../objc-obj-c++-shared/Object1-implementation.h" Index: objc/execute/exceptions/handler-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/exceptions/handler-1.m (revision 174696) +++ objc/execute/exceptions/handler-1.m (working copy) @@ -13,9 +13,9 @@ int main(void) =20 #else =20 -#include +#include #include -#include +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" #include =20 static unsigned int handlerExpected =3D 0; @@ -37,14 +37,14 @@ main(int argc, char *argv[]) =20 @try { - @throw [Object new]; + @throw [TestsuiteObject new]; } @catch (id exc) { handlerExpected =3D 1; } =20 - @throw [Object new]; + @throw [TestsuiteObject new]; abort(); return 0; } Index: objc/execute/exceptions/finally-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/exceptions/finally-1.m (revision 174696) +++ objc/execute/exceptions/finally-1.m (working copy) @@ -1,23 +1,7 @@ #include #include -//#import "../../../objc-obj-c++-shared/Object1.h" -#ifdef __OBJC2__ -#include -@interface Object -+ initialize; -+ new; -- free; -@end -@implementation Object -+ initialize { return self; } -+ new { return class_createInstance (self, 0); } -- free { return object_dispose(self);} -@end +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" =20 -#else -#import "../../../objc-obj-c++-shared/Object1.h" -#endif - static int made_try =3D 0; =20 int @@ -42,7 +26,7 @@ thrower() @try { thrower_try_body(); - @throw [Object new]; + @throw [TestsuiteObject new]; } @finally { @@ -73,4 +57,4 @@ main(int ac, char *av[]) abort (); return 0; } -//#import "../../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/exceptions/local-variables-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/exceptions/local-variables-1.m (revision 174696) +++ objc/execute/exceptions/local-variables-1.m (working copy) @@ -4,7 +4,7 @@ =20 #include #include -#import "../../../objc-obj-c++-shared/Object1.h" +#import "../../../objc-obj-c++-shared/TestsuiteObject.m" =20 int gi1 =3D 9, gi2 =3D 19; float gf1 =3D 9.0, gf2 =3D 19.0; @@ -29,13 +29,13 @@ void foo (int arg1, float *arg2) local6 =3D 18.0; pi =3D &gi2; pf =3D &gf2; - obj2 =3D obj1 =3D [Object new]; + obj2 =3D obj1 =3D [TestsuiteObject new]; arg1 =3D 17; arg2 =3D &gf2; =20=20=20=20=20 - @throw [Object new]; + @throw [TestsuiteObject new]; } - @catch (Object *obj) { + @catch (TestsuiteObject *obj) { if (local1 !=3D 123 || local2 !=3D 345 || local3 !=3D 5.0 || local4 != =3D 6.0 || local5 !=3D 17 || local6 !=3D 18.0) { printf("Abort 1\n"); @@ -60,4 +60,4 @@ int main(void) { foo(15, &gf1); return 0; } -#import "../../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/exceptions/foward-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/exceptions/foward-1.m (revision 174696) +++ objc/execute/exceptions/foward-1.m (working copy) @@ -1,34 +1,14 @@ /* Check that throwing an exception from a -forward:: works. */ /* Developed by Marcin Koziej . */ =20 +#include #include -#include -#ifndef __NEXT_RUNTIME__ -#import -#endif +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" =20 -#ifdef __OBJC2__ -@interface Object (TEST_SUITE_ADDITIONS) -+ initialize; -+ alloc; -+ new; -- init; -- free; -@end - -@implementation Object (TEST_SUITE_ADDITIONS) -+ initialize { return self; } -+ alloc { return class_createInstance (self, 0); } -+ new { return [[self alloc] init]; } -- init { return self; } -- free { return object_dispose(self); } -@end -#endif - static int i; =20 __attribute__((objc_exception))=20 -@interface Thrower : Object=20 +@interface Thrower : TestsuiteObject=20 - forward: (SEL) s : (void*) a; @end =20 @@ -36,7 +16,7 @@ __attribute__((objc_exception)) - forward: (SEL) s : (void*) a { i++; - @throw [Object new]; + @throw [TestsuiteObject new]; return nil; } @end Index: objc/execute/exceptions/matcher-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/exceptions/matcher-1.m (revision 174696) +++ objc/execute/exceptions/matcher-1.m (working copy) @@ -13,9 +13,9 @@ int main(void) =20 #else =20 -#include +#include #include -#include +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" #include =20 static unsigned int handlerExpected =3D 0; @@ -27,13 +27,13 @@ my_exception_matcher(Class match_class, id excepti return 1; } =20 -@interface A : Object +@interface A : TestsuiteObject @end =20 @implementation A @end =20 -@interface B : Object +@interface B : TestsuiteObject @end =20 @implementation B Index: objc/execute/exceptions/throw-nil.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/exceptions/throw-nil.m (revision 174696) +++ objc/execute/exceptions/throw-nil.m (working copy) @@ -1,5 +1,5 @@ #include -#include +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" =20 #ifdef __NEXT_RUNTIME__ /* This test only runs for the GNU runtime. */ @@ -24,7 +24,7 @@ int main (void) { @throw nil; } - @catch (Object *exc) + @catch (TestsuiteObject *exc) { abort (); } Index: objc/execute/informal_protocol.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/informal_protocol.m (revision 174696) +++ objc/execute/informal_protocol.m (working copy) @@ -1,8 +1,8 @@ /* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */ -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.h" #include =20 -@interface Object (StopProtocol) +@interface TestsuiteObject (StopProtocol) - (void) stop; @end =20 Index: objc/execute/class-tests-1.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-tests-1.h (revision 174696) +++ objc/execute/class-tests-1.h (working copy) @@ -2,9 +2,7 @@ =20 #include #include -#include "../../objc-obj-c++-shared/Object1.h" -#include -#include +#include "../../objc-obj-c++-shared/runtime.h" =20 /* * Standard Tests For Classes and Objects - abort upon failing; return @@ -14,23 +12,17 @@ /* Test that `class' is a Class */ static void test_is_class (Class class) { - if (object_is_class (class) =3D=3D NO) + if (class_isMetaClass (object_getClass (class)) =3D=3D NO) { printf ("test_is_class failed\n"); abort (); } - - if (class_is_class (class) =3D=3D NO) - { - printf ("test_is_class failed\n"); - abort (); - } } =20 /* Test that the superclass of `class' is `superclass' */ static void test_superclass (Class class, Class superclass) { - if (class_get_super_class (class) !=3D superclass)=20 + if (class_getSuperclass (class) !=3D superclass) { printf ("test_superclass failed\n"); abort (); @@ -40,7 +32,7 @@ static void test_superclass (Class class, Class su /* Test that the classname of `class' is `classname' */ static void test_class_name (Class class, const char *classname) { - if (strcmp (class_get_class_name (class), classname)) + if (strcmp (class_getName (class), classname)) { printf ("test_class_name failed\n"); abort (); @@ -51,7 +43,7 @@ static void test_class_name (Class class, const ch static void test_allocate (Class class) { /* The object we create is leaked but who cares, this is only a test */ - id object =3D class_create_instance (class); + id object =3D class_createInstance (class, 0); =20 if (object =3D=3D nil) { @@ -63,9 +55,9 @@ static void test_allocate (Class class) /* Test that instances of `class' are instances and not classes */ static void test_instances (Class class) { - id object =3D class_create_instance (class); + id object =3D class_createInstance (class, 0); =20 - if (object_is_class (object) =3D=3D YES) + if (class_isMetaClass (object_getClass (object)) =3D=3D YES) { printf ("test_instances failed\n"); abort (); @@ -75,7 +67,7 @@ static void test_instances (Class class) /* Test that we can deallocate instances of `class' */ static void test_deallocate (Class class) { - id object =3D class_create_instance (class); + id object =3D class_createInstance (class, 0); =20 object_dispose (object); } @@ -83,27 +75,15 @@ static void test_deallocate (Class class) /* Test that the object and the class agree on what the class is */ static void test_object_class (Class class) { - id object =3D class_create_instance (class); + id object =3D class_createInstance (class, 0); =20 - if (object_get_class (object) !=3D class) + if (object_getClass (object) !=3D class) { printf ("test_object_class failed\n"); abort (); } } =20 -/* Test that the object and the class agree on what the superclass is */ -static void test_object_super_class (Class class) -{ - id object =3D class_create_instance (class); - - if (object_get_super_class (object) !=3D class_get_super_class (class)) - { - printf ("test_object_super_class failed\n"); - abort (); - } -} - /*=20 * Runs all the tests in this file for the specified class=20 */ @@ -113,16 +93,12 @@ void test_class_with_superclass (const char *class Class class;=20 Class superclass;=20 =20 - /* We need at least a method call before playing with the internals,=20 - so that the runtime will call __objc_resolve_class_links () */ - [Object class]; - /* class_name must be an existing class */ - class =3D objc_lookup_class (class_name); + class =3D objc_getClass (class_name); test_is_class (class); =20 /* But superclass_name can be "", which means `Nil' */ - superclass =3D objc_lookup_class (superclass_name);=20=20 + superclass =3D objc_getClass (superclass_name);=20=20 if (superclass !=3D Nil) { test_is_class (superclass); @@ -135,5 +111,4 @@ void test_class_with_superclass (const char *class test_instances (class); test_deallocate (class); test_object_class (class); - test_object_super_class (class); } Index: objc/execute/protocol-isEqual-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/protocol-isEqual-1.m (revision 174696) +++ objc/execute/protocol-isEqual-1.m (working copy) @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero - Fri Jun 4 03:16:17 BST 2004 */ /* Test that a protocol is equal to itself. */ -#include "../../objc-obj-c++-shared/Protocol1.h" +#include +#include "../../objc-obj-c++-shared/runtime.h" =20 @protocol Foo - (void)foo; @@ -10,11 +11,7 @@ int main (void) { Protocol *protocol =3D @protocol(Foo); =20 -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - if ( !protocol_isEqual (protocol, protocol)) -#else - if (! [protocol isEqual: protocol]) -#endif + if (!protocol_isEqual (protocol, protocol)) { abort (); } Index: objc/execute/protocol-isEqual-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/protocol-isEqual-3.m (revision 174696) +++ objc/execute/protocol-isEqual-3.m (working copy) @@ -1,19 +1,15 @@ /* Contributed by Nicola Pero - Fri Jun 4 03:16:17 BST 2004 */ /* Test that a protocol is not equal to nil. */ +#include "../../objc-obj-c++-shared/runtime.h" +#include =20 -#include "../../objc-obj-c++-shared/Protocol1.h" - @protocol Foo - (void)foo; @end =20 int main (void) { -#ifdef NEXT_OBJC_USE_NEW_INTERFACE if (protocol_isEqual (@protocol(Foo), nil)) -#else - if ([@protocol(Foo) isEqual: nil]) -#endif { abort (); } Index: objc/execute/_cmd.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/_cmd.m (revision 174696) +++ objc/execute/_cmd.m (working copy) @@ -1,8 +1,7 @@ /* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */ =20 #include -#include "../../objc-obj-c++-shared/next-mapping.h" -#include +#include "../../objc-obj-c++-shared/runtime.h" =20 /* Test the hidden argument _cmd to method calls */ =20 @@ -16,11 +15,9 @@ @implementation TestClass + (const char*) method { - return sel_get_name (_cmd); + return sel_getName (_cmd); } -#ifdef __NEXT_RUNTIME__ + initialize { return self; } -#endif @end =20 =20 Index: objc/execute/function-message-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/function-message-1.m (revision 174696) +++ objc/execute/function-message-1.m (working copy) @@ -1,6 +1,6 @@ -#import "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 -@interface Foo : Object +@interface Foo : TestsuiteObject + bar; @end =20 Index: objc/execute/bf-common.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/bf-common.h (revision 174696) +++ objc/execute/bf-common.h (working copy) @@ -1,17 +1,14 @@ #include #include =20 -#ifndef __NEXT_RUNTIME__ -#include -#else +#include "../../objc-obj-c++-shared/runtime.h" + /* The following header, together with the implementation included below, emulate functionality provided by the GNU runtime but not available from the NeXT runtime. */ #include "../../objc-obj-c++-shared/objc-test-suite-next-encode-assist.h" -#define objc_get_class(C) objc_getClass(C) -#endif =20 -#ifndef __OBJC2__ +#if defined(__NEXT_RUNTIME__) && !defined(NEXT_OBJC_USE_NEW_INTERFACE) void print_ivars (Class class) { struct objc_ivar_list* ivars =3D class->ivars; @@ -62,17 +59,67 @@ void compare_structures (Class class, const char* =20=20=20 printf ("%d ivars checked\n", i); } +#else +void print_ivars (Class class) +{ + unsigned int count, i; + Ivar *list =3D class_copyIvarList (class, &count); + + for (i =3D 0; i < count; i++) { + printf ("ivar '%s', type '%s', offset %ud\n", + ivar_getName (list[i]), + ivar_getTypeEncoding (list[i]), + (unsigned int)ivar_getOffset (list[i])); + } +} + +void compare_structures (Class class, const char* type) +{ + struct objc_struct_layout layout; + unsigned int count; + Ivar *list =3D class_copyIvarList (class, &count); + int i =3D 0; + int position; + + objc_layout_structure (type, &layout); + + while (objc_layout_structure_next_member (&layout)) + { + const char *ivar_type; + + if (i > count) + { + printf ("too many ivars in type %s, layout =3D %s\n", + type, layout.type); + exit (1); + } + + objc_layout_structure_get_info (&layout, &position, NULL, &ivar_type= ); + printf ("real ivar '%s' offset %ud\n", + ivar_getName (list[i]), (unsigned int)ivar_getOffset (list[i= ])); + printf ("computed type '%s' offset %d\n", ivar_type, position); + if ((unsigned int)position !=3D (unsigned int)ivar_getOffset (list[i= ])) + { + printf ("offset %ud and computed position %d don't match on ivar= '%s'" + " (i =3D %d)\n", + (unsigned int)ivar_getOffset (list[i]), position, ivar_g= etName (list[i]), i); + exit (1); + } + i++; + } +=20=20 + printf ("%d ivars checked\n", i); +} #endif =20 int main () { -#ifndef __OBJC2__ struct class_vars { @defs (MyObject); }; int size1, size2; - Class class =3D objc_get_class ("MyObject"); + Class class =3D objc_getClass ("MyObject"); printf ("type =3D %s\n", @encode (struct class_vars)); print_ivars (class); =20 @@ -83,10 +130,7 @@ int main () printf ("sizes don't match (computed %d, exact %d)\n", size1, size2); abort (); } -#endif =20=20=20 - exit (0); + return 0; } -#ifndef __OBJC2__ #include "../../objc-obj-c++-shared/objc-test-suite-next-encode-assist-imp= l.h" -#endif Index: objc/execute/np-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/np-2.m (revision 174696) +++ objc/execute/np-2.m (working copy) @@ -2,7 +2,7 @@ * Contributed by Nicola Pero * Tue Sep 19 4:34AM */ -#include "../../objc-obj-c++-shared/Protocol1.h" + #include =20 @protocol MyProtocol @@ -17,16 +17,14 @@ { printf ("methodA\n"); } -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 int main (void) { [MyObject methodA]; =20 - exit (0); + return 0; } =20 =20 Index: objc/execute/class_self-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class_self-1.m (revision 174696) +++ objc/execute/class_self-1.m (working copy) @@ -51,9 +51,7 @@ struct d { return 4; } -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 =20 Index: objc/execute/redefining_self.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/redefining_self.m (revision 174696) +++ objc/execute/redefining_self.m (working copy) @@ -17,9 +17,7 @@ =20 return self; } -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 =20 Index: objc/execute/class-10.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-10.m (revision 174696) +++ objc/execute/class-10.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with an ivar and accessor methods and a subclass overriding the superclass' @@ -15,9 +13,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 @interface SubClass : RootClass @@ -72,10 +68,10 @@ int main (void) test_that_class_has_instance_method ("SubSubClass", @selector (state)); test_that_class_has_instance_method ("SubSubClass", @selector (shift)); =20=20=20 - object =3D class_create_instance (objc_lookup_class ("SubClass")); + object =3D class_createInstance (objc_getClass ("SubClass"), 0); test_accessor_method (object, 0, -1, -1, 1, 1); =20 - sub_object =3D class_create_instance (objc_lookup_class ("SubSubClass")); + sub_object =3D class_createInstance (objc_getClass ("SubSubClass"), 0); test_accessor_method (sub_object, 1, -1, 0, 1, 2); =20 return 0; Index: objc/execute/static-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/static-1.m (revision 174696) +++ objc/execute/static-1.m (working copy) @@ -19,9 +19,7 @@ static int test =3D 1; return test; } =20 -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 int main (void) Index: objc/execute/class-12.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-12.m (revision 174696) +++ objc/execute/class-12.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with a class methods */ =20 @@ -13,9 +11,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 static int class_variable =3D 0; @@ -48,7 +44,7 @@ int main (void) test_that_class_has_class_method ("SubClass", @selector (setState:)); test_that_class_has_class_method ("SubClass", @selector (state)); =20 - class =3D objc_lookup_class ("SubClass"); + class =3D objc_getClass ("SubClass"); test_accessor_method (class, 0, -1, -1, 1, 1); =20 return 0; Index: objc/execute/enumeration-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/enumeration-2.m (revision 174696) +++ objc/execute/enumeration-2.m (working copy) @@ -1,7 +1,6 @@ /* Contributed by Nicola Pero - Wed Dec 5 17:12:40 GMT 2001 */ #include -#import "../../objc-obj-c++-shared/Object1.h" -#include +#import "../../objc-obj-c++-shared/TestsuiteObject.m" =20 typedef enum { black, white } color; =20 @@ -11,7 +10,7 @@ typedef struct color b:2; } color_couple; =20 -@interface TestClass: Object +@interface TestClass: TestsuiteObject { color_couple *c; } @@ -50,4 +49,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/class-14.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-14.m (revision 174696) +++ objc/execute/class-14.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with a class accessor methods and a subclass overriding the superclass' implementation, @@ -15,9 +13,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 static int class_variable =3D 0; @@ -70,10 +66,10 @@ int main (void) test_that_class_has_class_method ("SubSubClass", @selector (state)); test_that_class_has_class_method ("SubSubClass", @selector (shift)); =20=20=20 - class =3D objc_lookup_class ("SubClass"); + class =3D objc_getClass ("SubClass"); test_accessor_method (class, 0, -1, -1, 1, 1); =20 - sub_class =3D objc_lookup_class ("SubSubClass"); + sub_class =3D objc_getClass ("SubSubClass"); class_variable =3D 0; test_accessor_method (sub_class, 1, -1, 0, 1, 2); =20 Index: objc/execute/encode-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/encode-1.m (revision 174696) +++ objc/execute/encode-1.m (working copy) @@ -1,8 +1,7 @@ /* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */ #include -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.h" #include -#include =20 /* Test very simple @encode */ =20 @@ -18,7 +17,7 @@ int main (void) abort (); } =20 - if (strcmp ("@", @encode (Object *))) + if (strcmp ("@", @encode (TestsuiteObject *))) { abort (); } Index: objc/execute/formal_protocol-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/formal_protocol-1.m (revision 174696) +++ objc/execute/formal_protocol-1.m (working copy) @@ -1,7 +1,7 @@ /* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */ =20 #include -#import "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* Tests defining a protocol and a class adopting it */ =20 @@ -10,7 +10,7 @@ - (void) setEnabled: (BOOL)flag; @end =20 -@interface Feature : Object +@interface Feature : TestsuiteObject { const char *name; BOOL isEnabled; @@ -42,4 +42,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/formal_protocol-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/formal_protocol-3.m (revision 174696) +++ objc/execute/formal_protocol-3.m (working copy) @@ -1,7 +1,7 @@ /* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */ =20 #include -#import "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* Test defining two protocol, a class adopting both of them,=20 and using an object of type `id ' */=20 @@ -15,7 +15,7 @@ - (int) importance; @end =20 -@interface Feature : Object +@interface Feature : TestsuiteObject { const char *name; BOOL isEnabled; @@ -56,4 +56,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/accessing_ivars.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/accessing_ivars.m (revision 174696) +++ objc/execute/accessing_ivars.m (working copy) @@ -1,23 +1,20 @@ /* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */ #include -#ifndef __NEXT_RUNTIME__ -#include -#endif -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* Test that by using -> we can access ivars of other objects of the same= =20 class */ =20 -@interface TestClass : Object +@interface TestClass : TestsuiteObject { int value; } - (int) value; -- (int) setValue: (int)number; +- (void) setValue: (int)number; - (void) takeValueFrom: (TestClass *)object; @end =20 -@implementation TestClass : Object +@implementation TestClass : TestsuiteObject { int value; } @@ -25,9 +22,9 @@ {=20 return value; } -- (int) setValue: (int)number +- (void) setValue: (int)number { - value =3D number;=20 + value =3D number; } - (void) takeValueFrom: (TestClass *)object { @@ -55,4 +52,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/formal_protocol-5.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/formal_protocol-5.m (revision 174696) +++ objc/execute/formal_protocol-5.m (working copy) @@ -2,7 +2,7 @@ =20 #include #include -#include "../../objc-obj-c++-shared/next-mapping.h" +#include "../../objc-obj-c++-shared/runtime.h" =20 /* Test defining a protocol, and accessing it using @protocol */ =20 @@ -25,11 +25,7 @@ int main (void) { Protocol *protocol =3D @protocol (Evaluating); =20 -#ifdef NEXT_OBJC_USE_NEW_INTERFACE if (strcmp (protocol_getName(protocol), "Evaluating")) -#else - if (strcmp ([protocol name], "Evaluating")) -#endif { abort (); } Index: objc/execute/bycopy-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/bycopy-2.m (revision 174696) +++ objc/execute/bycopy-2.m (working copy) @@ -2,14 +2,14 @@ * Contributed by Nicola Pero * Fri Feb 2 11:48:01 GMT 2001 */ +#include +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 -#include "../../objc-obj-c++-shared/Protocol1.h" - @protocol MyProtocol + (bycopy id) bycopyMethod; @end =20 -@interface MyObject : Object =20 +@interface MyObject : TestsuiteObject =20 @end =20 @implementation MyObject @@ -25,6 +25,6 @@ int main (void) =20 object =3D [MyObject bycopyMethod]; =20 - exit (0); + return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/class-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-2.m (revision 174696) +++ objc/execute/class-2.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass */ =20 Index: objc/execute/formal_protocol-7.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/formal_protocol-7.m (revision 174696) +++ objc/execute/formal_protocol-7.m (working copy) @@ -1,7 +1,8 @@ /* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */ =20 #include -#import "../../objc-obj-c++-shared/Protocol1.h" +#include +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* Test defining two protocols, one incorporating the other one. */ =20 @@ -14,7 +15,7 @@ @end =20 /* A class adopting the protocol */ -@interface Test : Object +@interface Test : TestsuiteObject { BOOL didConfigure; BOOL didProcess; @@ -41,4 +42,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/root_methods.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/root_methods.m (revision 174696) +++ objc/execute/root_methods.m (working copy) @@ -1,6 +1,6 @@ /* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */ =20 -#import "../../objc-obj-c++-shared/next-mapping.h" +#import "../../objc-obj-c++-shared/runtime.h" #import =20 /* Test that instance methods of root classes are available as class=20 @@ -18,9 +18,7 @@ { return self; } -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 @interface NormalClass : RootClass @@ -31,7 +29,7 @@ =20 int main (void) { - Class normal =3D objc_get_class ("NormalClass"); + Class normal =3D objc_getClass ("NormalClass"); =20 if (normal =3D=3D Nil) { Index: objc/execute/class-4.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-4.m (revision 174696) +++ objc/execute/class-4.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with an ivar and accessor methods */ @@ -14,9 +12,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 @interface SubClass : RootClass @@ -50,7 +46,7 @@ int main (void) test_that_class_has_instance_method ("SubClass", @selector (setState:)); test_that_class_has_instance_method ("SubClass", @selector (state)); =20 - object =3D class_create_instance (objc_lookup_class ("SubClass")); + object =3D class_createInstance (objc_getClass ("SubClass"), 0); test_accessor_method (object, 0, 1, 1, -3, -3); =20 return 0; Index: objc/execute/class-6.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-6.m (revision 174696) +++ objc/execute/class-6.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with an ivar and accessor methods and a subclass overriding the superclass' @@ -15,9 +13,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 @interface SubClass : RootClass @@ -66,10 +62,10 @@ int main (void) test_that_class_has_instance_method ("SubSubClass", @selector (setState:= )); test_that_class_has_instance_method ("SubSubClass", @selector (state)); =20=20=20 - object =3D class_create_instance (objc_lookup_class ("SubClass")); + object =3D class_createInstance (objc_getClass ("SubClass"), 0); test_accessor_method (object, 0, -1, -1, 1, 1); =20 - sub_object =3D class_create_instance (objc_lookup_class ("SubSubClass")); + sub_object =3D class_createInstance (objc_getClass ("SubSubClass"), 0); test_accessor_method (sub_object, 1, -1, 0, 1, 2); =20 return 0; Index: objc/execute/nested-func-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/nested-func-1.m (revision 174696) +++ objc/execute/nested-func-1.m (working copy) @@ -3,7 +3,7 @@ /* Contributed by Ziemowit Laski . */ #include #include -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.m" #include =20 int bappy (int (*blargh) (int a, int b, int c)) @@ -11,7 +11,7 @@ int bappy (int (*blargh) (int a, int b, int c)) return blargh (4, 7, 2) + 3; } =20 -@interface Foo: Object +@interface Foo: TestsuiteObject + (int)foo; @end =20 Index: objc/execute/class-8.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-8.m (revision 174696) +++ objc/execute/class-8.m (working copy) @@ -1,8 +1,6 @@ /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */ =20 -#include "../../objc-obj-c++-shared/next-mapping.h" #include -#include =20 /* Tests creating a root class and a subclass with an ivar and accessor methods and a subclass overriding the superclass' @@ -15,9 +13,7 @@ @end =20 @implementation RootClass -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 @interface SubClass : RootClass @@ -69,10 +65,10 @@ int main (void) test_that_class_has_instance_method ("SubSubClass", @selector (setState:= )); test_that_class_has_instance_method ("SubSubClass", @selector (state)); =20=20=20 - object =3D class_create_instance (objc_lookup_class ("SubClass")); + object =3D class_createInstance (objc_getClass ("SubClass"), 0); test_accessor_method (object, 0, -1, -1, 1, 1); =20 - sub_object =3D class_create_instance (objc_lookup_class ("SubSubClass")); + sub_object =3D class_createInstance (objc_getClass ("SubSubClass"), 0); test_accessor_method (sub_object, 1, -1, 0, 1, 2); =20 return 0; Index: objc/execute/private.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/private.m (revision 174696) +++ objc/execute/private.m (working copy) @@ -1,11 +1,11 @@ /* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */ -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.m" #include =20 /* Test the @private, @protected, @public keyworks for ivars. We only check syntax. */ =20 -@interface TestClass : Object +@interface TestClass : TestsuiteObject { int a; =20 Index: objc/execute/load-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/load-3.m (revision 174696) +++ objc/execute/load-3.m (working copy) @@ -9,10 +9,10 @@ */ =20 #include -#import "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" #include =20 -@interface A : Object +@interface A : TestsuiteObject @end =20 @interface B : A Index: objc/execute/compatibility_alias.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/compatibility_alias.m (revision 174696) +++ objc/execute/compatibility_alias.m (working copy) @@ -1,8 +1,7 @@ /* Contributed by Nicola Pero - Thu Mar 8 17:23:59 CET 2001 */ -#import "../../objc-obj-c++-shared/Object1.h" -#include +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 -@compatibility_alias MyObject Object; +@compatibility_alias MyObject TestsuiteObject; =20 int main (void) { @@ -10,4 +9,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/nested-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/nested-3.m (revision 174696) +++ objc/execute/nested-3.m (working copy) @@ -22,9 +22,7 @@ return test (); } =20 -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 int main (void) Index: objc/execute/next_mapping.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/next_mapping.h (revision 174696) +++ objc/execute/next_mapping.h (working copy) @@ -1,906 +0,0 @@ -/* This file "renames" various ObjC GNU runtime entry points - (and fakes the existence of several others) - if the NeXT runtime is being used. */ -/* Authors: Ziemowit Laski */ -/* David Ayers */ - -#ifdef __NEXT_RUNTIME__ -#include -#include -#include -#include -#include - -#define objc_get_class(C) objc_getClass(C) -#define objc_get_meta_class(C) objc_getMetaClass(C) -#define class_get_class_method(C, S) class_getClassMethod(C, S) -#define class_get_instance_method(C, S) class_getInstanceMethod(C, S) -#define method_get_imp(M) (((Method)M)->method_imp) -#define sel_get_name(S) sel_getName(S) -#define class_create_instance(C) class_createInstance(C, 0) -#define class_get_class_name(C) object_getClassName(C) -#define class_get_super_class(C) (((struct objc_class *)C)->super_class) -#define object_get_super_class(O) class_get_super_class(*(struct objc_cla= ss **)O) -#define objc_lookup_class(N) objc_lookUpClass(N) -#define object_get_class(O) (*(struct objc_class **)O) -#define class_is_class(C) (CLS_GETINFO((struct objc_class *)C, CLS_CLASS= )? YES: NO) -#define class_is_meta_class(C) (CLS_GETINFO((struct objc_class *)C, CLS_= META)? YES: NO) -#define object_is_class(O) class_is_meta_class(*(struct objc_class **)O) -#define object_is_meta_class(O) (class_is_meta_class(O) && class_is_meta= _class(*(struct objc_class **)O)) - -/* You need either an empty +initialize method or an empty -forward:: meth= od.=20 - The NeXT runtime unconditionally sends +initialize to classes when they= are=20 - first used, and unconditionally tries to forward methods that the class= =20 - doesn't understand (including +initialize). If you have neither +initia= lize=20 - nor -forward::, the runtime complains.=20=20 - - The simplest workaround is to add - - + initialize { return self; } - - to every root class @implementation. */ - -#ifndef NULL -#define NULL 0 -#endif - -/* The following is necessary to "cover" the bf*.m test cases on NeXT. */ - -#undef MAX -#undef MIN -#undef ROUND - -#ifdef __cplusplus -#define MAX(X, Y) ((X > Y) ? X : Y) -#define MIN(X, Y) ((X < Y) ? X : Y) -#define ROUND(V, A) (A * ((V + A - 1) / A)) -#else -#define MAX(X, Y) \ - ({ typeof (X) __x =3D (X), __y =3D (Y); \ - (__x > __y ? __x : __y); }) -#define MIN(X, Y) \ - ({ typeof (X) __x =3D (X), __y =3D (Y); \ - (__x < __y ? __x : __y); }) -#define ROUND(V, A) \ - ({ typeof (V) __v =3D (V); typeof (A) __a =3D (A); \ - __a * ((__v+__a - 1)/__a); }) -#endif - -#define BITS_PER_UNIT __CHAR_BIT__ -typedef struct{ char a; } __small_struct; -#define STRUCTURE_SIZE_BOUNDARY (BITS_PER_UNIT * sizeof (__small_struct)) - -/* Not sure why the following are missing from NeXT objc headers... */ - -#ifndef _C_LNG_LNG -#define _C_LNG_LNG 'q' -#endif -#ifndef _C_ULNG_LNG -#define _C_ULNG_LNG 'Q' -#endif -#ifndef _C_ATOM -#define _C_ATOM '%' -#endif -#ifndef _C_BOOL -#define _C_BOOL 'B' -#endif - -#define _C_CONST 'r' -#define _C_IN 'n' -#define _C_INOUT 'N' -#define _C_OUT 'o' -#define _C_BYCOPY 'O' -#define _C_BYREF 'R' -#define _C_ONEWAY 'V' -#define _C_GCINVISIBLE '!' -=20=20=20 -#define _F_CONST 0x01 -#define _F_IN 0x01 -#define _F_OUT 0x02 -#define _F_INOUT 0x03 -#define _F_BYCOPY 0x04=20=20 -#define _F_BYREF 0x08=20=20 -#define _F_ONEWAY 0x10 -#define _F_GCINVISIBLE 0x20 - -struct objc_struct_layout -{ - const char *original_type; - const char *type; - const char *prev_type; - unsigned int record_size;=20 - unsigned int record_align; -}; - -typedef union arglist { - char *arg_ptr; - char arg_regs[sizeof (char*)]; -} *arglist_t; /* argument frame */ - -const char *objc_skip_typespec (const char *type); -void objc_layout_structure_get_info (struct objc_struct_layout *layout, - unsigned int *offset, unsigned int *align, const char **type); -void objc_layout_structure (const char *type, - struct objc_struct_layout *layout); -BOOL objc_layout_structure_next_member (struct objc_struct_layout *layout); -void objc_layout_finish_structure (struct objc_struct_layout *layout, - unsigned int *size, unsigned int *align); -int objc_aligned_size (const char *type); - -/* - return the size of an object specified by type -*/ - -int -objc_sizeof_type (const char *type) -{ - /* Skip the variable name if any */ - if (*type =3D=3D '"') - { - for (type++; *type++ !=3D '"';) - /* do nothing */; - } - - switch (*type) { - case _C_ID: - return sizeof (id); - break; - - case _C_CLASS: - return sizeof (Class); - break; - - case _C_SEL: - return sizeof (SEL); - break; - - case _C_CHR: - return sizeof (char); - break; - - case _C_UCHR: - return sizeof (unsigned char); - break; - - case _C_SHT: - return sizeof (short); - break; - - case _C_USHT: - return sizeof (unsigned short); - break; - - case _C_INT: - return sizeof (int); - break; - - case _C_UINT: - return sizeof (unsigned int); - break; - - case _C_LNG: - return sizeof (long); - break; - - case _C_ULNG: - return sizeof (unsigned long); - break; - - case _C_LNG_LNG: - return sizeof (long long); - break; - - case _C_ULNG_LNG: - return sizeof (unsigned long long); - break; - - case _C_FLT: - return sizeof (float); - break; - - case _C_DBL: - return sizeof (double); - break; - - case _C_PTR: - case _C_ATOM: - case _C_CHARPTR: - return sizeof (char *); - break; - - case _C_ARY_B: - { - int len =3D atoi (type + 1); - while (isdigit ((unsigned char)*++type)) - ; - return len * objc_aligned_size (type); - } - break; - - case _C_BFLD: - { - /* The NeXT encoding of bitfields is _still_: b 'size' */ - int size =3D atoi (type + 1); - /* Return an upper bound on byte size */ - return (size + BITS_PER_UNIT - 1) / BITS_PER_UNIT; - } - - case _C_STRUCT_B: - { - struct objc_struct_layout layout; - unsigned int size; - - objc_layout_structure (type, &layout); - while (objc_layout_structure_next_member (&layout)) - /* do nothing */ ; - objc_layout_finish_structure (&layout, &size, NULL); - - return size; - } - - case _C_UNION_B: - { - int max_size =3D 0; - while (*type !=3D _C_UNION_E && *type++ !=3D '=3D') - /* do nothing */; - while (*type !=3D _C_UNION_E) - { - /* Skip the variable name if any */ - if (*type =3D=3D '"') - { - for (type++; *type++ !=3D '"';) - /* do nothing */; - } - max_size =3D MAX (max_size, objc_sizeof_type (type)); - type =3D objc_skip_typespec (type); - } - return max_size; - } - } - return 0; /* error */ -} - - -/* - Return the alignment of an object specified by type -*/ - -int -objc_alignof_type (const char *type) -{ - /* Skip the variable name if any */ - if (*type =3D=3D '"') - { - for (type++; *type++ !=3D '"';) - /* do nothing */; - } - switch (*type) { - case _C_ID: - return __alignof__ (id); - break; - - case _C_CLASS: - return __alignof__ (Class); - break; - - case _C_SEL: - return __alignof__ (SEL); - break; - - case _C_CHR: - return __alignof__ (char); - break; - - case _C_UCHR: - return __alignof__ (unsigned char); - break; - - case _C_SHT: - return __alignof__ (short); - break; - - case _C_USHT: - return __alignof__ (unsigned short); - break; - - case _C_INT: - case _C_BFLD: /* This is for the NeXT only */ - return __alignof__ (int); - break; - - case _C_UINT: - return __alignof__ (unsigned int); - break; - - case _C_LNG: - return __alignof__ (long); - break; - - case _C_ULNG: - return __alignof__ (unsigned long); - break; - - case _C_LNG_LNG: - return __alignof__ (long long); - break; - - case _C_ULNG_LNG: - return __alignof__ (unsigned long long); - break; - - case _C_FLT: - return __alignof__ (float); - break; - - case _C_DBL: - return __alignof__ (double); - break; - - case _C_PTR: - case _C_ATOM: - case _C_CHARPTR: - return __alignof__ (char *); - break; - - case _C_ARY_B: - while (isdigit ((unsigned char)*++type)) - /* do nothing */; - return objc_alignof_type (type); - - case _C_STRUCT_B: - { - struct objc_struct_layout layout; - unsigned int align; - - objc_layout_structure (type, &layout); - while (objc_layout_structure_next_member (&layout)) - /* do nothing */; - objc_layout_finish_structure (&layout, NULL, &align); - - return align; - } - - case _C_UNION_B: - { - int maxalign =3D 0; - while (*type !=3D _C_UNION_E && *type++ !=3D '=3D') - /* do nothing */; - while (*type !=3D _C_UNION_E) - { - /* Skip the variable name if any */ - if (*type =3D=3D '"') - { - for (type++; *type++ !=3D '"';) - /* do nothing */; - } - maxalign =3D MAX (maxalign, objc_alignof_type (type)); - type =3D objc_skip_typespec (type); - } - return maxalign; - } - } - return 0; /* error */ -} - -/* - The aligned size if the size rounded up to the nearest alignment. -*/ - -int -objc_aligned_size (const char *type) -{ - int size, align; - - /* Skip the variable name */ - if (*type =3D=3D '"') - { - for (type++; *type++ !=3D '"';) - /* do nothing */; - } - - size =3D objc_sizeof_type (type); - align =3D objc_alignof_type (type); - - return ROUND (size, align); -} - -/* - The size rounded up to the nearest integral of the wordsize, taken - to be the size of a void *. -*/ - -int -objc_promoted_size (const char *type) -{ - int size, wordsize; - - /* Skip the variable name */ - if (*type =3D=3D '"') - { - for (type++; *type++ !=3D '"';) - /* do nothing */; - } - - size =3D objc_sizeof_type (type); - wordsize =3D sizeof (void *); - - return ROUND (size, wordsize); -} - -/* - Skip type qualifiers. These may eventually precede typespecs - occurring in method prototype encodings. -*/ - -inline const char * -objc_skip_type_qualifiers (const char *type) -{ - while (*type =3D=3D _C_CONST - || *type =3D=3D _C_IN - || *type =3D=3D _C_INOUT - || *type =3D=3D _C_OUT - || *type =3D=3D _C_BYCOPY - || *type =3D=3D _C_BYREF - || *type =3D=3D _C_ONEWAY - || *type =3D=3D _C_GCINVISIBLE) - { - type +=3D 1; - } - return type; -} - - -/* - Skip one typespec element. If the typespec is prepended by type - qualifiers, these are skipped as well. -*/ - -const char * -objc_skip_typespec (const char *type) -{ - /* Skip the variable name if any */ - if (*type =3D=3D '"') - { - for (type++; *type++ !=3D '"';) - /* do nothing */; - } - - type =3D objc_skip_type_qualifiers (type); - - switch (*type) { - - case _C_ID: - /* An id may be annotated by the actual type if it is known - with the @"ClassName" syntax */ - - if (*++type !=3D '"') - return type; - else - { - while (*++type !=3D '"') - /* do nothing */; - return type + 1; - } - - /* The following are one character type codes */ - case _C_CLASS: - case _C_SEL: - case _C_CHR: - case _C_UCHR: - case _C_CHARPTR: - case _C_ATOM: - case _C_SHT: - case _C_USHT: - case _C_INT: - case _C_UINT: - case _C_LNG: - case _C_ULNG: - case _C_LNG_LNG: - case _C_ULNG_LNG: - case _C_FLT: - case _C_DBL: - case _C_VOID: - case _C_UNDEF: - return ++type; - break; - - case _C_ARY_B: - /* skip digits, typespec and closing ']' */ - - while (isdigit ((unsigned char)*++type)) - ; - type =3D objc_skip_typespec (type); - if (*type =3D=3D _C_ARY_E) - return ++type; - else - break; /* error */ - - case _C_BFLD: - /* The NeXT encoding for bitfields is _still_: b 'size' */ - while (isdigit ((unsigned char)*++type)) - ; /* skip type and size */ - return type; - - case _C_STRUCT_B: - /* skip name, and elements until closing '}' */ - - while (*type !=3D _C_STRUCT_E && *type++ !=3D '=3D') - ; - while (*type !=3D _C_STRUCT_E) - { - type =3D objc_skip_typespec (type); - } - return ++type; - - case _C_UNION_B: - /* skip name, and elements until closing ')' */ - - while (*type !=3D _C_UNION_E && *type++ !=3D '=3D') - ; - while (*type !=3D _C_UNION_E) - { - type =3D objc_skip_typespec (type); - } - return ++type; - - case _C_PTR: - /* Just skip the following typespec */ - - return objc_skip_typespec (++type); - } - return 0; /* error */ -} - -/* - Skip an offset as part of a method encoding. This is prepended by a - '+' if the argument is passed in registers. -*/ -inline const char * -objc_skip_offset (const char *type) -{ - if (*type =3D=3D '+') - type++; - while (isdigit ((unsigned char) *++type)) - ; - return type; -} - -/* - Skip an argument specification of a method encoding. -*/ -const char * -objc_skip_argspec (const char *type) -{ - type =3D objc_skip_typespec (type); - type =3D objc_skip_offset (type); - return type; -} - -/* - Return the number of arguments that the method MTH expects. - Note that all methods need two implicit arguments `self' and - `_cmd'. -*/ -int -method_get_number_of_arguments (struct objc_method *mth) -{ - int i =3D 0; - const char *type =3D mth->method_types; - while (*type) - { - type =3D objc_skip_argspec (type); - i +=3D 1; - } - return i - 1; -} - -/* - Return the size of the argument block needed on the stack to invoke - the method MTH. This may be zero, if all arguments are passed in - registers. -*/ - -int -method_get_sizeof_arguments (struct objc_method *mth) -{ - const char *type =3D objc_skip_typespec (mth->method_types); - return atoi (type); -} - -/* - Return a pointer to the next argument of ARGFRAME. type points to - the last argument. Typical use of this look like: - - { - char *datum, *type; - for (datum =3D method_get_first_argument (method, argframe, &type); - datum; datum =3D method_get_next_argument (argframe, &type)) - { - unsigned flags =3D objc_get_type_qualifiers (type); - type =3D objc_skip_type_qualifiers (type); - if (*type !=3D _C_PTR) - [portal encodeData: datum ofType: type]; - else - { - if ((flags & _F_IN) =3D=3D _F_IN) - [portal encodeData: *(char **) datum ofType: ++type]; - } - } - } -*/ - -char * -method_get_next_argument (arglist_t argframe, const char **type) -{ - const char *t =3D objc_skip_argspec (*type); - - if (*t =3D=3D '\0') - return 0; - - *type =3D t; - t =3D objc_skip_typespec (t); - - if (*t =3D=3D '+') - return argframe->arg_regs + atoi (++t); - else - return argframe->arg_ptr + atoi (t); -} - -/* - Return a pointer to the value of the first argument of the method - described in M with the given argumentframe ARGFRAME. The type - is returned in TYPE. type must be passed to successive calls of - method_get_next_argument. -*/ -char * -method_get_first_argument (struct objc_method *m, - arglist_t argframe, - const char **type) -{ - *type =3D m->method_types; - return method_get_next_argument (argframe, type); -} - -/* - Return a pointer to the ARGth argument of the method - M from the frame ARGFRAME. The type of the argument - is returned in the value-result argument TYPE -*/ - -char * -method_get_nth_argument (struct objc_method *m, - arglist_t argframe, int arg, - const char **type) -{ - const char *t =3D objc_skip_argspec (m->method_types); - - if (arg > method_get_number_of_arguments (m)) - return 0; - - while (arg--) - t =3D objc_skip_argspec (t); - - *type =3D t; - t =3D objc_skip_typespec (t); - - if (*t =3D=3D '+') - return argframe->arg_regs + atoi (++t); - else - return argframe->arg_ptr + atoi (t); -} - -unsigned -objc_get_type_qualifiers (const char *type) -{ - unsigned res =3D 0; - BOOL flag =3D YES; - - while (flag) - switch (*type++) - { - case _C_CONST: res |=3D _F_CONST; break; - case _C_IN: res |=3D _F_IN; break; - case _C_INOUT: res |=3D _F_INOUT; break; - case _C_OUT: res |=3D _F_OUT; break; - case _C_BYCOPY: res |=3D _F_BYCOPY; break; - case _C_BYREF: res |=3D _F_BYREF; break; - case _C_ONEWAY: res |=3D _F_ONEWAY; break; - case _C_GCINVISIBLE: res |=3D _F_GCINVISIBLE; break; - default: flag =3D NO; - } - - return res; -} - - -/* The following three functions can be used to determine how a - structure is laid out by the compiler. For example: - - struct objc_struct_layout layout; - int i; - - objc_layout_structure (type, &layout); - while (objc_layout_structure_next_member (&layout)) - { - int position, align; - const char *type; - - objc_layout_structure_get_info (&layout, &position, &align, &type); - printf ("element %d has offset %d, alignment %d\n", - i++, position, align); - } - - These functions are used by objc_sizeof_type and objc_alignof_type - functions to compute the size and alignment of structures. The - previous method of computing the size and alignment of a structure - was not working on some architectures, particulary on AIX, and in - the presence of bitfields inside the structure. */ -void -objc_layout_structure (const char *type, - struct objc_struct_layout *layout) -{ - const char *ntype; - - layout->original_type =3D ++type; - - /* Skip "=3D" if any. Avoid embedded structures and unions. */ - ntype =3D type; - while (*ntype !=3D _C_STRUCT_E && *ntype !=3D _C_STRUCT_B && *ntype !=3D= _C_UNION_B - && *ntype++ !=3D '=3D') - /* do nothing */; - - /* If there's a "=3D", ntype - 1 points to '=3D'; skip the name */ - if (*(ntype - 1) =3D=3D '=3D') - type =3D ntype; - - layout->type =3D type; - layout->prev_type =3D NULL; - layout->record_size =3D 0; - layout->record_align =3D MAX (BITS_PER_UNIT, STRUCTURE_SIZE_BOUNDARY); -} - - -BOOL -objc_layout_structure_next_member (struct objc_struct_layout *layout) -{ - register int desired_align =3D 0; - - /* The current type without the type qualifiers */ - const char *type; - - /* Add the size of the previous field to the size of the record. */ - if (layout->prev_type) - { - type =3D objc_skip_type_qualifiers (layout->prev_type); - - if (*type !=3D _C_BFLD) - layout->record_size +=3D objc_sizeof_type (type) * BITS_PER_UNIT; - else - layout->record_size +=3D atoi (++type); - } - - if (*layout->type =3D=3D _C_STRUCT_E) - return NO; - - /* Skip the variable name if any */ - if (*layout->type =3D=3D '"') - { - for (layout->type++; *layout->type++ !=3D '"';) - /* do nothing */; - } - - type =3D objc_skip_type_qualifiers (layout->type); - - desired_align =3D objc_alignof_type (type) * BITS_PER_UNIT; - - /* Record must have at least as much alignment as any field. - Otherwise, the alignment of the field within the record - is meaningless. */ - layout->record_align =3D MAX (layout->record_align, desired_align); - - if (*type =3D=3D _C_BFLD) - { - int bfld_size =3D atoi (++type); - int int_align =3D __alignof__ (int) * BITS_PER_UNIT; - /* If this bitfield would traverse a word alignment boundary, push i= t out=20 - to that boundary instead. */ - if (layout->record_size % int_align - && (layout->record_size / int_align - < (layout->record_size + bfld_size - 1) / int_align)) - layout->record_size =3D ROUND (layout->record_size, int_align); - } - else if (layout->record_size % desired_align !=3D 0) - { - /* We need to skip space before this field. - Bump the cumulative size to multiple of field alignment. */ - layout->record_size =3D ROUND (layout->record_size, desired_align); - } - - /* Jump to the next field in record. */ - - layout->prev_type =3D layout->type; - layout->type =3D objc_skip_typespec (layout->type); /* skip compone= nt */ - - return YES; -} - - -void objc_layout_finish_structure (struct objc_struct_layout *layout, - unsigned int *size, - unsigned int *align) -{ - if (layout->type && *layout->type =3D=3D _C_STRUCT_E) - { - /* Round the size up to be a multiple of the required alignment */ - layout->record_size =3D ROUND (layout->record_size, layout->record_a= lign); - layout->type =3D NULL; - } - if (size) - *size =3D layout->record_size / BITS_PER_UNIT; - if (align) - *align =3D layout->record_align / BITS_PER_UNIT; -} - - -void objc_layout_structure_get_info (struct objc_struct_layout *layout, - unsigned int *offset, - unsigned int *align, - const char **type) -{ - if (offset) - *offset =3D layout->record_size / BITS_PER_UNIT; - if (align) - *align =3D layout->record_align / BITS_PER_UNIT; - if (type) - *type =3D layout->prev_type; -} - -/* A small, portable NSConstantString implementation for use with the NeXT - runtime. -=20=20=20 - On full-fledged Mac OS X systems, NSConstantString is provided - as part of the Foundation framework. However, on bare Darwin systems, - Foundation is not included, and hence there is no NSConstantString=20 - implementation to link against. - - This code is derived from the GNU runtime's NXConstantString implementa= tion. -*/ - -struct objc_class _NSConstantStringClassReference; - -@interface NSConstantString : Object -{ - char *c_string; - unsigned int len; -} - --(const char *) cString; --(unsigned int) length; - -@end - -@implementation NSConstantString - --(const char *) cString -{ - return (c_string); -} - --(unsigned int) length -{ - return (len); -} - -@end - -/* The NSConstantString metaclass will need to be initialized before we can - send messages to strings. */ - -void objc_constant_string_init (void) __attribute__((constructor)); -void objc_constant_string_init (void) { - memcpy (&_NSConstantStringClassReference, - objc_getClass ("NSConstantString"), - sizeof (_NSConstantStringClassReference)); -} - -#endif /* #ifdef __NEXT_RUNTIME__ */ Index: objc/execute/no_clash.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/no_clash.m (revision 174696) +++ objc/execute/no_clash.m (working copy) @@ -1,11 +1,11 @@ /* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */ -#import "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" #import =20 /* Test that using the same name for different things makes no=20 problem */ =20 -@interface TestClass : Object +@interface TestClass : TestsuiteObject { int test; } @@ -39,4 +39,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/object_is_meta_class.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/object_is_meta_class.m (revision 174696) +++ objc/execute/object_is_meta_class.m (working copy) @@ -1,14 +1,11 @@ /* Contributed by Nicola Pero - Tue Jul 3 10:55:21 BST 2001 */ -#ifdef __NEXT_RUNTIME__ -# include "../../objc-obj-c++-shared/next-mapping.h" -#else -# include -#endif -#include "../../objc-obj-c++-shared/Object1.h" =20 +#include "../../objc-obj-c++-shared/runtime.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.m" + /* This test demonstrate a failure in object_is_meta_class which was fixed= */ =20 -@interface EvilClass : Object +@interface EvilClass : TestsuiteObject { Class super_class; const char* name; @@ -33,7 +30,8 @@ int main (void) EvilClass *evilObject =3D [EvilClass new]; =20=20=20 /* Now check that the object is not a meta class object */ - if (object_is_meta_class (evilObject)) + if (class_isMetaClass (object_getClass (evilObject)) + && class_isMetaClass (evilObject)) { printf ("object_is_meta_class failed\n"); abort (); @@ -41,4 +39,4 @@ int main (void) =20 return 0; } -#include "../../objc-obj-c++-shared/Object1-implementation.h" + Index: objc/execute/class-tests-2.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class-tests-2.h (revision 174696) +++ objc/execute/class-tests-2.h (working copy) @@ -1,8 +1,7 @@ /* Contributed by Nicola Pero on Tue Mar 6 23:05:53 CET 2001 */ -#include -#include #include #include +#include "../../objc-obj-c++-shared/runtime.h" =20 /* * Standard Tests For Methods of Classes and Objects - abort upon @@ -13,9 +12,9 @@ void test_that_class_has_instance_method (const char *class_name,=20 SEL selector) { - Class class =3D objc_lookup_class (class_name); + Class class =3D objc_getClass (class_name); =20 - if (class_get_instance_method (class, selector) =3D=3D NULL) + if (class_getInstanceMethod (class, selector) =3D=3D NULL) { printf ("test_class_has_instance_method failed\n"); abort (); @@ -26,9 +25,9 @@ void test_that_class_has_instance_method (const ch void test_that_class_has_class_method (const char *class_name,=20 SEL selector) { - Class meta_class =3D objc_get_meta_class (class_name); + Class class =3D objc_getClass (class_name); =20 - if (class_get_class_method (meta_class, selector) =3D=3D NULL) + if (class_getClassMethod (class, selector) =3D=3D NULL) { printf ("test_class_has_class_method failed\n"); abort (); Index: objc/execute/protocol-isEqual-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/protocol-isEqual-2.m (revision 174696) +++ objc/execute/protocol-isEqual-2.m (working copy) @@ -1,8 +1,8 @@ /* Contributed by Nicola Pero - Fri Jun 4 03:16:17 BST 2004 */ /* Test that protocols with different names are different. */ +#include "../../objc-obj-c++-shared/runtime.h" +#include =20 -#include "../../objc-obj-c++-shared/Protocol1.h" - @protocol Foo1 - (void)foo1; @end @@ -13,11 +13,7 @@ =20 int main (void) { -#ifdef NEXT_OBJC_USE_NEW_INTERFACE if (protocol_isEqual (@protocol(Foo1), @protocol(Foo2))) -#else - if ([@protocol(Foo1) isEqual: @protocol(Foo2)]) -#endif { abort (); } Index: objc/execute/protocol-isEqual-4.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/protocol-isEqual-4.m (revision 174696) +++ objc/execute/protocol-isEqual-4.m (working copy) @@ -1,8 +1,8 @@ /* Contributed by David Ayers - Fri Jun 4 03:16:17 BST 2004 */ /* Test that a protocol is not equal to something which is not a protocol.= */ +#include "../../objc-obj-c++-shared/runtime.h" +#include =20 -#include "../../objc-obj-c++-shared/Protocol1.h" - @protocol Foo - (void)foo; @end @@ -10,11 +10,7 @@ int main (void) { /* A Protocol object should not be equal to a Class object. */ -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - if (protocol_isEqual (@protocol(Foo), objc_getClass("Protocol"))) -#else - if ([@protocol(Foo) isEqual: [Protocol class]]) -#endif + if (protocol_isEqual (@protocol(Foo), (id)objc_getClass("Protocol"))) { abort (); } Index: objc/execute/va_method.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/va_method.m (revision 174696) +++ objc/execute/va_method.m (working copy) @@ -1,6 +1,5 @@ /* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */ #include -#include #include =20 /* Test method with variable number of arguments */ @@ -32,9 +31,7 @@ =20 return sum; } -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 int main (void) Index: objc/execute/cascading-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/cascading-1.m (revision 174696) +++ objc/execute/cascading-1.m (working copy) @@ -1,7 +1,7 @@ #include -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.m" =20 -@interface Foo : Object +@interface Foo : TestsuiteObject + foo; + bar; @end Index: objc/execute/trivial.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/trivial.m (revision 174696) +++ objc/execute/trivial.m (working copy) @@ -1,9 +1,8 @@ -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.m" =20 int main(void) { - [Object class]; + [TestsuiteObject class]; return 0; } =20 -#import "../../objc-obj-c++-shared/Object1-implementation.h" Index: objc/execute/np-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/np-1.m (revision 174696) +++ objc/execute/np-1.m (working copy) @@ -3,7 +3,6 @@ * Tue Sep 19 4:29AM */ =20 -#include "../../objc-obj-c++-shared/Protocol1.h" #include =20 @protocol MyProtocol @@ -25,7 +24,7 @@ int main (void) =20 [object methodA]; =20 - exit (0); + return 0; } =20 =20 Index: objc/execute/class_self-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/class_self-2.m (revision 174696) +++ objc/execute/class_self-2.m (working copy) @@ -33,9 +33,7 @@ struct d =20=20=20 return u; } -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 /* The second class */ @@ -58,9 +56,7 @@ struct d } } =20 -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 =20 Index: objc/execute/nil_method-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/execute/nil_method-1.m (revision 174696) +++ objc/execute/nil_method-1.m (working copy) @@ -1,12 +1,12 @@ /* Contributed by Nicola Pero - Fri Aug 30 12:55:37 2002 */=20 #include -#include +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 /* Test that calling a method of a nil object results in nothing to happen (but not a crash), and nil to be returned. */ =20 -@interface TestClass : Object +@interface TestClass : TestsuiteObject =20 - (void) testVoid; - (id) testId; Index: objc/compile/trivial.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc/compile/trivial.m (revision 174696) +++ objc/compile/trivial.m (working copy) @@ -1,6 +1,6 @@ -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.h" =20 int main(void) { - [Object class]; + [TestsuiteObject class]; } Index: objc.dg/desig-init-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/desig-init-1.m (revision 174696) +++ objc.dg/desig-init-1.m (working copy) @@ -5,11 +5,11 @@ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 #include =20 -@interface Cls : Object +@interface Cls : TestsuiteObject + (int) meth1; + (int) meth2; + (void) doTests; @@ -48,4 +48,4 @@ int main(void) { /* { dg-warning "will be assumed to return .id. and accept" "" { target *-= *-* } 0 } */ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 0 } */ =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: objc.dg/try-catch-6.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/try-catch-6.m (revision 174696) +++ objc.dg/try-catch-6.m (working copy) @@ -1,10 +1,10 @@ /* { dg-do compile } */ /* { dg-options "-fobjc-exceptions" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 int main (int argc, const char * argv[]) { - Object * pool =3D [Object new]; + TestsuiteObject * pool =3D [TestsuiteObject new]; int a; =20 if ( 1 ) { @@ -12,7 +12,7 @@ int main (int argc, const char * argv[]) { @try { a =3D 1; } - @catch (Object *e) { + @catch (TestsuiteObject *e) { a =3D 2; } @finally { Index: objc.dg/super-class-4.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/super-class-4.m (revision 174696) +++ objc.dg/super-class-4.m (working copy) @@ -3,11 +3,11 @@ should be traversed to find the @interface. */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @class MyWpModule; =20 -@compatibility_alias MyObject Object; +@compatibility_alias MyObject TestsuiteObject; @compatibility_alias FictitiousModule MyWpModule; =20 @protocol MySelTarget Index: objc.dg/foreach-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/foreach-1.m (revision 174696) +++ objc.dg/foreach-1.m (working copy) @@ -4,10 +4,9 @@ /* { dg-do run } */ /* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-= fnext-runtime" } { "" } } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */ /* { dg-options "-Wall" } */ =20 -#import "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 extern void abort (void); /* @@ -19,7 +18,7 @@ struct __objcFastEnumerationState unsigned long extra[5]; }; */ -@interface Object (NSFastEnumeration) +@interface TestsuiteObject (NSFastEnumeration) - (unsigned long)countByEnumeratingWithState: (struct __objcFastEnumeratio= nState *)state objects:(id *)stackbuf=20 count:(unsigned int)len; @@ -44,7 +43,7 @@ int main (void) abort (); =20 /* Test that if nothing is done, object is set to nil. */ - object =3D [Object new]; + object =3D [TestsuiteObject new]; =20 for (object in array) ; Index: objc.dg/comp-types-8.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/comp-types-8.m (revision 174696) +++ objc.dg/comp-types-8.m (working copy) @@ -1,9 +1,9 @@ /* { dg-do compile } */ /* Another gimplifier ICE... */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface MyView: Object { +@interface MyView: TestsuiteObject { int _frame; } - (void)_finalize; Index: objc.dg/call-super-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/call-super-2.m (revision 174696) +++ objc.dg/call-super-2.m (working copy) @@ -2,16 +2,24 @@ /* Contributed by Ziemowit Laski . */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include "../objc-obj-c++-shared/runtime.h" #include =20 +/* FIXME: This is temporary. At the moment, the compiler, when + compiling for the GNU runtime and doing method checks, only + recognizes objc_get_class(), and not objc_getClass(). So + temporarily force objc_get_class() to be used. */ +#ifndef __NEXT_RUNTIME__ +# define objc_getClass(C) objc_get_class(C) +#endif + @protocol Func + (int) class_func0; - (int) instance_func0; @end =20 -@interface Derived: Object +@interface Derived: TestsuiteObject + (int) class_func1; + (int) class_func2; + (int) class_func3; @@ -39,7 +47,7 @@ + (int) class_func1 { int i =3D (size_t)[self class_func0]; /* { dg-warning ".Derived. = may not respond to .\\+class_func0." } */ - return i + (size_t)[super class_func0]; /* { dg-warning ".Object. may= not respond to .\\+class_func0." } */ + return i + (size_t)[super class_func0]; /* { dg-warning ".TestsuiteOb= ject. may not respond to .\\+class_func0." } */ } + (int) class_func2 { @@ -50,7 +58,7 @@ } + (int) class_func3 { - return [(Object *)super class_func0]; + return [(TestsuiteObject *)super class_func0]; } + (int) class_func4 { @@ -59,20 +67,20 @@ + (int) class_func5 { int i =3D (size_t)[Derived class_func0]; /* { dg-warning ".Derived. = may not respond to .\\+class_func0." } */ - return i + (size_t)[Object class_func0]; /* { dg-warning ".Object. may= not respond to .\\+class_func0." } */ + return i + (size_t)[TestsuiteObject class_func0]; /* { dg-warning ".Te= stsuiteObject. may not respond to .\\+class_func0." } */ } + (int) class_func6 { - return (size_t)[objc_get_class("Object") class_func1]; /* { dg-warning= ".Object. may not respond to .\\+class_func1." } */ + return (size_t)[objc_getClass("TestsuiteObject") class_func1]; /* { dg= -warning ".TestsuiteObject. may not respond to .\\+class_func1." } */ } + (int) class_func7 { - return [objc_get_class("Derived") class_func1]; + return [objc_getClass("Derived") class_func1]; } - (int) instance_func1 { int i =3D (size_t)[self instance_func0]; /* { dg-warning ".Derived.= may not respond to .\\-instance_func0." } */ - return i + (size_t)[super instance_func0]; /* { dg-warning ".Object. ma= y not respond to .\\-instance_func0." } */ + return i + (size_t)[super instance_func0]; /* { dg-warning ".TestsuiteO= bject. may not respond to .\\-instance_func0." } */ } - (int) instance_func2 { @@ -80,7 +88,7 @@ } - (int) instance_func3 { - return [(Object *)super instance_func0]; + return [(TestsuiteObject *)super instance_func0]; } - (int) instance_func4 { @@ -89,15 +97,15 @@ - (int) instance_func5 { int i =3D (size_t)[Derived instance_func1]; /* { dg-warning ".Derived. = may not respond to .\\+instance_func1." } */ - return i + (size_t)[Object instance_func1]; /* { dg-warning ".Object. m= ay not respond to .\\+instance_func1." } */ + return i + (size_t)[TestsuiteObject instance_func1]; /* { dg-warning ".= TestsuiteObject. may not respond to .\\+instance_func1." } */ } - (int) instance_func6 { - return (size_t)[objc_get_class("Object") class_func1]; /* { dg-warning = ".Object. may not respond to .\\+class_func1." } */ + return (size_t)[objc_getClass("TestsuiteObject") class_func1]; /* { dg-= warning ".TestsuiteObject. may not respond to .\\+class_func1." } */ } - (int) instance_func7 { - return [objc_get_class("Derived") class_func1]; + return [objc_getClass("Derived") class_func1]; } @end =20 @@ -108,7 +116,7 @@ i +=3D [self class_func1]; i +=3D [self categ_class_func2]; i +=3D (size_t)[self categ_instance_func1]; /* { dg-warning ".Derived. = may not respond to .\\+categ_instance_func1." } */ - return i + (size_t)[super class_func0]; /* { dg-warning ".Object. may= not respond to .\\+class_func0." } */ + return i + (size_t)[super class_func0]; /* { dg-warning ".TestsuiteOb= ject. may not respond to .\\+class_func0." } */ } + (int) categ_class_func2 { @@ -121,11 +129,11 @@ { int i =3D (size_t)[self instance_func0]; /* { dg-warning ".Derived. = may not respond to .\\-instance_func0." } */ i +=3D [(Derived *)self categ_instance_func2]; - i +=3D (size_t)[(Object *)self categ_instance_func2]; /* { dg-wa= rning ".Object. may not respond to .\\-categ_instance_func2." } */ - /* { dg-warning ".\\-categ_instance_func2. not found in protocol" "" { = target *-*-* } 124 } */ + i +=3D (size_t)[(TestsuiteObject *)self categ_instance_func2]; /= * { dg-warning ".TestsuiteObject. may not respond to .\\-categ_instance_fun= c2." } */ + /* { dg-warning ".\\-categ_instance_func2. not found in protocol" "" { = target *-*-* } 132 } */ i +=3D (size_t)[(id )self categ_instance_func2]; /* { dg-warning= ".\\-categ_instance_func2. not found in protocol" } */ i +=3D [(id)self categ_instance_func2]; - return i + (size_t)[super instance_func0]; /* { dg-warning ".Object. = may not respond to .\\-instance_func0." } */ + return i + (size_t)[super instance_func0]; /* { dg-warning ".Testsuit= eObject. may not respond to .\\-instance_func0." } */ } - (int) categ_instance_func2 { Index: objc.dg/objc-fast-4.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/objc-fast-4.m (revision 174696) +++ objc.dg/objc-fast-4.m (working copy) @@ -3,10 +3,10 @@ /* { dg-options "-O0" } */ /* Radar 4015820 */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 void foo(void) { - Object *o; + TestsuiteObject *o; [o++ free]; } /* { dg-final { scan-assembler-not "L_objc_msgSend\\\$non_lazy_ptr" } } */ Index: objc.dg/method-6.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-6.m (revision 174696) +++ objc.dg/method-6.m (working copy) @@ -4,7 +4,7 @@ /* { dg-do compile } */ /* { dg-options "-Wstrict-selector-match" } */ =20 -#include "../objc-obj-c++-shared/Protocol1.h" +#include =20 @interface Base - (unsigned)port; Index: objc.dg/set-not-used-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/set-not-used-1.m (revision 174696) +++ objc.dg/set-not-used-1.m (working copy) @@ -2,10 +2,9 @@ /* { dg-do compile } */ /* { dg-options "-Wunused-but-set-variable" } */ =20 -#import "../objc-obj-c++-shared/Object1.h" -#include +#import "../objc-obj-c++-shared/TestsuiteObject.m" =20 -@interface obj : Object +@interface obj : TestsuiteObject { int value; } @@ -13,7 +12,7 @@ - (void) setValue: (int)number; @end =20 -@implementation obj : Object +@implementation obj : TestsuiteObject =20 - (int) value { return value; } - (void) setValue: (int)number { value =3D number; } Index: objc.dg/method-20b.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-20b.m (revision 174696) +++ objc.dg/method-20b.m (working copy) @@ -2,10 +2,9 @@ they should. */ /* { dg-do run } */ /* { dg-options "-O2" } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #include =20 @@ -19,7 +18,7 @@ char *strcpy_like_callee(const char *s) { typedef char io_string_t[512]; typedef char *(func_type)(const char *); =20 -@interface DeviceObject: Object +@interface DeviceObject: TestsuiteObject - (void) func:(func_type)func stucPathInIORegistry:(io_string_t)ioRegPath; @end @implementation DeviceObject Index: objc.dg/method-15.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-15.m (revision 174696) +++ objc.dg/method-15.m (working copy) @@ -4,7 +4,9 @@ =20 /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include +#include "../objc-obj-c++-shared/runtime.h" =20 @class NSString; =20 @@ -13,19 +15,19 @@ + (BOOL)usesUserKeyEquivalents; @end =20 -@interface NSMenuItem : Object { +@interface NSMenuItem : TestsuiteObject { @private id _menu; } @end =20 -@interface NSResponder : Object +@interface NSResponder : TestsuiteObject { id _nextResponder; } @end =20 -@interface Object(NSMenuValidation) +@interface TestsuiteObject(NSMenuValidation) - (BOOL)validateMenuItem:(id )menuItem; @end =20 Index: objc.dg/gnu-runtime-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/gnu-runtime-3.m (revision 174696) +++ objc.dg/gnu-runtime-3.m (working copy) @@ -3,12 +3,12 @@ /* { dg-do run } */ /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */ =20 -#include +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #include =20 int main(int argc, void **args) { - [Object new]; + [TestsuiteObject new]; return 0; } Index: objc.dg/exceptions-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/exceptions-2.m (revision 174696) +++ objc.dg/exceptions-2.m (working copy) @@ -2,15 +2,14 @@ /* { dg-do run } */ /* { dg-options "-fobjc-exceptions" } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */ =20 /* This test checks the syntax @catch (...) which catches any exceptions. Check that code using it runs correctly. */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 -@interface MyObject : Object +@interface MyObject : TestsuiteObject @end =20 @implementation MyObject @@ -45,7 +44,7 @@ int main (void) if (test ([MyObject new]) !=3D 5) abort (); =20 - if (test ([Object new]) !=3D 6) + if (test ([TestsuiteObject new]) !=3D 6) abort (); =20 return 0; Index: objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c (revision 1746= 96) +++ objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c (working copy) @@ -261,7 +261,7 @@ switchfiles (int fields) /* { dg-do run } */\n\ /* { dg-options \"-w -I%s -fgnu-runtime\" } */\n", srcdir); } - fprintf(outfile, "#include \n\ + fprintf(outfile, "#include \n\ #include \"struct-layout-1.h\"\n\ \n\ int fails; \n\ Index: objc.dg/encode-7.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/encode-7.m (revision 174696) +++ objc.dg/encode-7.m (working copy) @@ -1,7 +1,7 @@ /* { dg-do run } */ /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */ =20 -#include +#include #include =20 struct f Index: objc.dg/try-catch-7.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/try-catch-7.m (revision 174696) +++ objc.dg/try-catch-7.m (working copy) @@ -3,9 +3,9 @@ /* { dg-do compile } */ /* { dg-options "-fobjc-exceptions" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Derived: Object +@interface Derived: TestsuiteObject - (id) meth; @end =20 Index: objc.dg/foreach-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/foreach-2.m (revision 174696) +++ objc.dg/foreach-2.m (working copy) @@ -5,10 +5,9 @@ /* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-= fnext-runtime" } { "" } } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m ../objc-obj-c= ++-shared/nsconstantstring-class-impl.m" } */ +/* { dg-additional-sources "../objc-obj-c++-shared/nsconstantstring-class-= impl.m" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #ifndef __NEXT_RUNTIME__ #include #else @@ -32,7 +31,7 @@ struct __objcFastEnumerationState enumeration. You create the array with some objects; you can mutate the array, and you can fast-enumerate it. */ -@interface MyArray : Object +@interface MyArray : TestsuiteObject { unsigned int length; id *objects; @@ -45,7 +44,7 @@ struct __objcFastEnumerationState count:(unsigned long)len; @end =20 -@implementation MyArray : Object +@implementation MyArray : TestsuiteObject - (id) initWithLength: (unsigned int)l objects: (id *)o { @@ -90,7 +89,7 @@ struct __objcFastEnumerationState int main (void) { MyArray *array; - Object *object; + TestsuiteObject *object; int test_variable, counter, i; id *objects; =20 Index: objc.dg/call-super-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/call-super-3.m (revision 174696) +++ objc.dg/call-super-3.m (working copy) @@ -5,12 +5,12 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 extern void abort(void); #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface Base: Object +@interface Base: TestsuiteObject + (int) class_func1; - (int) instance_func1; @end @@ -54,4 +54,3 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/comp-types-10.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/comp-types-10.m (revision 174696) +++ objc.dg/comp-types-10.m (working copy) @@ -1,22 +1,22 @@ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @protocol Foo - (id)meth1; - (id)meth2:(int)arg; @end =20 -@interface Derived1: Object +@interface Derived1: TestsuiteObject @end =20 -@interface Derived2: Object +@interface Derived2: TestsuiteObject + (Derived1 *)new; @end =20 id func(void) { - Object *o =3D [Object new]; - return o; /* { dg-warning "class .Object. does not implement the .Foo. = protocol" } */ + TestsuiteObject *o =3D [TestsuiteObject new]; + return o; /* { dg-warning "class .TestsuiteObject. does not implement t= he .Foo. protocol" } */ } =20 @implementation Derived2 Index: objc.dg/selector-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/selector-2.m (revision 174696) +++ objc.dg/selector-2.m (working copy) @@ -2,7 +2,7 @@ /* { dg-options "-Wselector" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include =20 @interface Foo @end Index: objc.dg/method-7.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-7.m (revision 174696) +++ objc.dg/method-7.m (working copy) @@ -3,11 +3,11 @@ /* { dg-do compile } */ /* { dg-options "-Wstrict-selector-match" } */ =20 +#include +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -#include "../objc-obj-c++-shared/Object1.h" - @interface Class1 -- (void)setWindow:(Object *)wdw; +- (void)setWindow:(TestsuiteObject *)wdw; @end =20 @interface Class2 @@ -15,14 +15,14 @@ @end =20 id foo(void) { - Object *obj =3D [[Object alloc] init]; + TestsuiteObject *obj =3D [[TestsuiteObject alloc] init]; id obj2 =3D obj; - [obj setWindow:nil]; /* { dg-warning ".Object. may not respond to .\\-s= etWindow:." } */ + [obj setWindow:nil]; /* { dg-warning ".TestsuiteObject. may not respond= to .\\-setWindow:." } */ /* { dg-warning "Messages without a matching method signature" "" { targ= et *-*-* } 20 } */ /* { dg-warning "will be assumed to return .id. and accept" "" { target = *-*-* } 20 } */ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 20 } */ [obj2 setWindow:nil]; /* { dg-warning "multiple methods named .\\-setWin= dow:. found" } */ - /* { dg-message "using .\\-\\(void\\)setWindow:\\(Object \\*\\)wdw." "" = { target *-*-* } 10 } */ + /* { dg-message "using .\\-\\(void\\)setWindow:\\(TestsuiteObject \\*\\)= wdw." "" { target *-*-* } 10 } */ /* { dg-message "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)wind= ow." "" { target *-*-* } 14 } */ =20 return obj; Index: objc.dg/objc-gc-4.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/objc-gc-4.m (revision 174696) +++ objc.dg/objc-gc-4.m (working copy) @@ -6,11 +6,12 @@ /* { dg-options "-fobjc-gc" } */ /* { dg-prune-output "cc1obj: warning: '-fobjc-gc' is ignored for '-fgnu-r= untime'" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include =20 @class MyWindow; =20 -@interface MyDocument : Object { +@interface MyDocument : TestsuiteObject { MyWindow *_window; } @end @@ -29,7 +30,7 @@ @end =20 @interface MyTextFileDocument : MyFileDocument { - Object *_textStorage; + TestsuiteObject *_textStorage; struct __tfdFlags { unsigned int immutable:1; unsigned int lineEnding:2; Index: objc.dg/encode-7-next.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/encode-7-next.m (revision 174696) +++ objc.dg/encode-7-next.m (working copy) @@ -6,8 +6,8 @@ /* { dg-options "-Wno-deprecated-declarations" } */ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" +#include "../objc-obj-c++-shared/runtime.h" #include #include #include @@ -99,10 +99,10 @@ typedef struct { unsigned int parameterMask; } NSErrorUserInfoFormatter; =20 -typedef Object MyObj; -typedef Object *MyPtr; +typedef TestsuiteObject MyObj; +typedef TestsuiteObject *MyPtr; =20 -@interface Foo: Object { +@interface Foo: TestsuiteObject { NSATSGlyphStorageRun r; } - (NSError *)_errorWithOSStatus:(OSStatus)inOSStatus ref1:(const FSRef *)i= nRef1 ref2:(const struct FSRef *)inRef2 @@ -114,7 +114,7 @@ typedef struct { - (id)str1:(const char *)str1 str2:(char *)str2 str3:(char *const)str3 str= 4:(const char *const)str4; - (oneway void)foo1:(Foo *)foo1 foo2:(const Foo *)foo2 foo3:(Foo *const)fo= o3 foo4:(const Foo *const)foo4; - (in const char *)sel1:(const SEL)sel1 id1:(const id)id1; -- (inout id)obj1:(const MyPtr)obj1 obj2:(Object *const)obj2 obj3:(MyObj *c= onst)obj3; +- (inout id)obj1:(const MyPtr)obj1 obj2:(TestsuiteObject *const)obj2 obj3:= (MyObj *const)obj3; + (ComponentInstance)_defaultScriptingComponent; - (NSString *)_formatCocoaErrorString:(NSString *)formatString parameters:= (const char *)parameters=20 applicableFormatters:(NSErrorUserInfoFormatter **)formatters count:(int)= numFormatters; @@ -156,7 +156,7 @@ NSRange globalRange; - (in const char *)sel1:(const SEL)sel1 id1:(const id)id1 { return "Hello"; }=20=20 -- (inout id)obj1:(const MyPtr)obj1 obj2:(Object *const)obj2 obj3:(MyObj *c= onst)obj3 { +- (inout id)obj1:(const MyPtr)obj1 obj2:(TestsuiteObject *const)obj2 obj3:= (MyObj *const)obj3 { return self; } + (ComponentInstance)_defaultScriptingComponent { @@ -222,7 +222,7 @@ int main(void) { CHECK_IF (!strcmp (meth->method_types, "rn*16@0:4r:8r@12")); =20 meth =3D class_getInstanceMethod (fooClass, @selector(obj1:obj2:obj3:)); - CHECK_IF (!strcmp (meth->method_types, "N@20@0:4r@8@12^{Object=3D#}16")); + CHECK_IF (!strcmp (meth->method_types, "N@20@0:4r@8@12^{TestsuiteObject= =3D#}16")); =20 meth =3D class_getClassMethod (fooClass, @selector(_defaultScriptingComp= onent)); CHECK_IF (!strcmp (meth->method_types, "^{ComponentInstanceRecord=3D[1l]= }8@0:4")); Index: objc.dg/attributes/method-attribute-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/attributes/method-attribute-1.m (revision 174696) +++ objc.dg/attributes/method-attribute-1.m (working copy) @@ -1,9 +1,9 @@ /* { dg-do compile } */ =20 #include -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object { +@interface obj : TestsuiteObject { @public=20 int var;=20 }=20 Index: objc.dg/attributes/method-attribute-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/attributes/method-attribute-2.m (revision 174696) +++ objc.dg/attributes/method-attribute-2.m (working copy) @@ -1,9 +1,9 @@ /* { dg-do compile } */ =20 #include -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object { +@interface obj : TestsuiteObject { @public=20 int var;=20 }=20 Index: objc.dg/attributes/method-attribute-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/attributes/method-attribute-3.m (revision 174696) +++ objc.dg/attributes/method-attribute-3.m (working copy) @@ -1,8 +1,8 @@ /* { dg-do compile } */ =20 -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object { +@interface obj : TestsuiteObject { @public=20 int var; } Index: objc.dg/attributes/categ-attribute-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/attributes/categ-attribute-1.m (revision 174696) +++ objc.dg/attributes/categ-attribute-1.m (working copy) @@ -1,9 +1,9 @@ /* { dg-do compile } */ =20 #include -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object {=20 +@interface obj : TestsuiteObject {=20 @public=20 int var;=20 }=20 Index: objc.dg/attributes/categ-attribute-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/attributes/categ-attribute-2.m (revision 174696) +++ objc.dg/attributes/categ-attribute-2.m (working copy) @@ -1,9 +1,9 @@ /* { dg-do compile } */ =20 #include -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object {=20 +@interface obj : TestsuiteObject {=20 @public=20 int var;=20 }=20 Index: objc.dg/strings/strings-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/strings/strings-1.m (revision 174696) +++ objc.dg/strings/strings-1.m (working copy) @@ -1,8 +1,7 @@ /* Contributed by Nicola Pero , November = 2010. */ /* { dg-do compile } */ =20 -#include "../../objc-obj-c++-shared/Object1.h" -#include "../../objc-obj-c++-shared/next-mapping.h" +#include "../../objc-obj-c++-shared/runtime.h" #ifndef __NEXT_RUNTIME__ #include #endif @@ -30,4 +29,4 @@ id test_invalid7 =3D @"te" @"s" @@"t"; / id test_invalid8 =3D @"te" @@"s" @"t"; /* { dg-error "repeated= .@. before Objective-C string" } */ id test_invalid9 =3D @"te" @"s" @"t" @; /* { dg-error "stray .@= . in program" } */ id test_invalidA =3D @"te" @ st; /* { dg-error "stray .@= . in program" } */ - /* { dg-error "expected" = "" { target *-*-* } 32 } */ + /* { dg-error "expected" = "" { target *-*-* } 31 } */ Index: objc.dg/encode-8.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/encode-8.m (revision 174696) +++ objc.dg/encode-8.m (working copy) @@ -1,7 +1,7 @@ /* { dg-do run } */ /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */ =20 -#include +#include #include =20 union f Index: objc.dg/encode-7-next-64bit.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/encode-7-next-64bit.m (revision 174696) +++ objc.dg/encode-7-next-64bit.m (working copy) @@ -9,7 +9,7 @@ #include #include #include -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/runtime.h" =20 #define CHECK_IF(E) if (!(E)) abort () =20 Index: objc.dg/fix-and-continue-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/fix-and-continue-1.m (revision 174696) +++ objc.dg/fix-and-continue-1.m (working copy) @@ -6,14 +6,14 @@ /* { dg-options "-mfix-and-continue" } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 @class MyTarget, MySet; =20 int global_value =3D 0; =20 -@interface MyTargetBuildContext : Object +@interface MyTargetBuildContext : TestsuiteObject { MyTarget * _target; unsigned _cacheInvalDisableCount; @@ -31,7 +31,7 @@ int global_value =3D 0; + (MySet *)_headerFileExtensions; @end =20 -@interface MyCountedSet: Object { +@interface MyCountedSet: TestsuiteObject { @public int cardinality; } @@ -52,7 +52,7 @@ int global_value =3D 0; }=20=20 @end =20 -@implementation MyTargetBuildContext : Object +@implementation MyTargetBuildContext : TestsuiteObject - (id)initWithTarget:(MyTarget *)target { self =3D [super init]; @@ -90,4 +90,3 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/foreach-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/foreach-3.m (revision 174696) +++ objc.dg/foreach-3.m (working copy) @@ -7,8 +7,7 @@ works, but how do we tell the testsuite to test for it ? */ =20 -#import "../objc-obj-c++-shared/Object1.h" -#import "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #ifndef __NEXT_RUNTIME__ #include #endif @@ -30,7 +29,7 @@ struct __objcFastEnumerationState enumeration. You create the array with some objects; you can mutate the array, and you can fast-enumerate it. */ -@interface MyArray : Object +@interface MyArray : TestsuiteObject { unsigned int length; id *objects; @@ -43,7 +42,7 @@ struct __objcFastEnumerationState count:(unsigned long)len; @end =20 -@implementation MyArray : Object +@implementation MyArray : TestsuiteObject - (id) initWithLength: (unsigned int)l objects: (id *)o { @@ -90,7 +89,7 @@ struct __objcFastEnumerationState int main (void) { MyArray *array; - Object *object; + TestsuiteObject *object; int counter, i; id *objects; =20 Index: objc.dg/try-catch-10.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/try-catch-10.m (revision 174696) +++ objc.dg/try-catch-10.m (working copy) @@ -4,7 +4,7 @@ /* { dg-options "-fobjc-exceptions" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @protocol Proto1 - (int)meth1; @@ -14,11 +14,11 @@ - (int)meth2; @end =20 -@interface MyClass: Object { +@interface MyClass: TestsuiteObject { int a; } - (int)meth2; -- (Object *)parm1: (id)p1 parm2: (id)p2; +- (TestsuiteObject *)parm1: (id)p1 parm2: (id)p2; @end =20 MyClass *mc1, *mc2; @@ -27,7 +27,7 @@ MyClass *mc1, *mc2; - (int)meth2 { return a; } -- (Object *)parm1: (id)p1 parm2: (id)p2 { +- (TestsuiteObject *)parm1: (id)p1 parm2: (id)p2 { @try { mc2 =3D p2; /* { dg-warning "type .id . does not conform to = the .Proto2. protocol" } */ } Index: objc.dg/comp-types-11.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/comp-types-11.m (revision 174696) +++ objc.dg/comp-types-11.m (working copy) @@ -1,10 +1,10 @@ /* { dg-do compile } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Derived: Object +@interface Derived: TestsuiteObject @end =20 -extern Object* foo(void); +extern TestsuiteObject* foo(void); static Derived *test(void) { Derived *m =3D foo(); /* { dg-warning "initialization from distinct O= bjective\\-C type" } */ Index: objc.dg/method-17.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-17.m (revision 174696) +++ objc.dg/method-17.m (working copy) @@ -3,9 +3,9 @@ /* { dg-do compile } */ /* { dg-options "-Wreturn-type -Wextra" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Foo: Object +@interface Foo: TestsuiteObject - (id) meth1; - (void) meth2; @end @@ -15,7 +15,7 @@ extern int bar; @implementation Foo - (id) meth1 { if (bar) - return [Object new]; + return [TestsuiteObject new]; return; /* { dg-warning "'return' with no value, in function returning n= on-void" } */ }=20 - (void) meth2 { Index: objc.dg/bitfield-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/bitfield-1.m (revision 174696) +++ objc.dg/bitfield-1.m (working copy) @@ -4,14 +4,14 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 extern void abort(void); =20 #define CHECK_IF(expr) if(!(expr)) abort(); =20 -@interface Base: Object=20 +@interface Base: TestsuiteObject=20 { int full; int full2: 32; @@ -80,4 +80,3 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/try-catch-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/try-catch-1.m (revision 174696) +++ objc.dg/try-catch-1.m (working copy) @@ -3,14 +3,14 @@ /* { dg-options "-fobjc-exceptions" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" #include #include =20 -@interface Frob: Object +@interface Frob: TestsuiteObject @end =20 -@implementation Frob: Object +@implementation Frob: TestsuiteObject @end =20 static int exc_control =3D 0; Index: objc.dg/pr45878.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/pr45878.m (revision 174696) +++ objc.dg/pr45878.m (working copy) @@ -8,9 +8,19 @@ typedef unsigned char BOOL; { Class isa; } -- (BOOL)isEqual:anObject; @end =20 +@interface Object (Test) +- (BOOL)testIsEqual:anObject; +@end + +@implementation Object (Test) +- (BOOL)testIsEqual:anObject +{ + return self =3D=3D anObject; +} +@end + #ifdef __NEXT_RUNTIME__ @interface NSConstantString: Object { @@ -30,7 +40,7 @@ extern void *_NSConstantStringClassReference; =20 void function (void) { - if ([@"strings" isEqual: (id)0]) + if ([@"strings" testIsEqual: (id)0]) { ; } Index: objc.dg/fix-and-continue-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/fix-and-continue-2.m (revision 174696) +++ objc.dg/fix-and-continue-2.m (working copy) @@ -6,18 +6,18 @@ /* { dg-do assemble { target *-*-darwin* } } */ /* { dg-options "-mfix-and-continue" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Foo: Object -+ (Object *)indexableFileTypes; +@interface Foo: TestsuiteObject ++ (TestsuiteObject *)indexableFileTypes; @end =20 @implementation Foo -+ (Object *)indexableFileTypes ++ (TestsuiteObject *)indexableFileTypes { - static Object *fileTypes =3D 0; + static TestsuiteObject *fileTypes =3D 0; if(!fileTypes) { - fileTypes =3D [Object new]; + fileTypes =3D [TestsuiteObject new]; } return fileTypes; } Index: objc.dg/foreach-4.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/foreach-4.m (revision 174696) +++ objc.dg/foreach-4.m (working copy) @@ -5,10 +5,9 @@ /* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-= fnext-runtime" } { "" } } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m ../objc-obj-c= ++-shared/nsconstantstring-class-impl.m" } */ +/* { dg-additional-sources "../objc-obj-c++-shared/nsconstantstring-class-= impl.m" } */ =20 -#import "../objc-obj-c++-shared/Object1.h" -#import "../objc-obj-c++-shared/next-mapping.h" +#import "../objc-obj-c++-shared/TestsuiteObject.m" #ifndef __NEXT_RUNTIME__ #include #else @@ -32,7 +31,7 @@ struct __objcFastEnumerationState enumeration. You create the array with some objects; you can mutate the array, and you can fast-enumerate it. */ -@interface MyArray : Object +@interface MyArray : TestsuiteObject { unsigned int length; id *objects; @@ -45,7 +44,7 @@ struct __objcFastEnumerationState count:(unsigned long)len; @end =20 -@implementation MyArray : Object +@implementation MyArray : TestsuiteObject - (id) initWithLength: (unsigned int)l objects: (id *)o { Index: objc.dg/headers.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/headers.m (revision 174696) +++ objc.dg/headers.m (working copy) @@ -12,11 +12,11 @@ #include #ifdef __NEXT_RUNTIME__ #include +#include #else -#include +#include #endif =20 -#include #include =20 #ifndef __NEXT_RUNTIME__ Index: objc.dg/comp-types-12.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/comp-types-12.m (revision 174696) +++ objc.dg/comp-types-12.m (working copy) @@ -1,14 +1,14 @@ /* When assigning function pointers, allow for covariant return types and contravariant argument types. */ /* { dg-do compile } */ -#include +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @class Derived; =20 -Object *ExternFunc (Object *filePath, Object *key); -typedef id FuncSignature (Object *arg1, Derived *arg2); +TestsuiteObject *ExternFunc (TestsuiteObject *filePath, TestsuiteObject *k= ey); +typedef id FuncSignature (TestsuiteObject *arg1, Derived *arg2); =20 -@interface Derived: Object +@interface Derived: TestsuiteObject + (void)registerFunc:(FuncSignature *)function; @end =20 Index: objc.dg/method-9.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-9.m (revision 174696) +++ objc.dg/method-9.m (working copy) @@ -5,10 +5,10 @@ /* { dg-options "-Wstrict-selector-match" } */ =20 =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @protocol MyObject -- (id)initWithData:(Object *)data; +- (id)initWithData:(TestsuiteObject *)data; @end =20 @protocol SomeOther @@ -19,9 +19,9 @@ - (id)initWithData:(id)data; @end =20 -@interface NTGridDataObject: Object +@interface NTGridDataObject: TestsuiteObject { - Object *_data; + TestsuiteObject *_data; } + (NTGridDataObject*)dataObject:(id)data; @end @@ -34,7 +34,7 @@ { NTGridDataObject *result =3D [[NTGridDataObject alloc] initWithData:da= ta]; /* { dg-warning "multiple methods named .\\-initWithData:. found" "" {= target *-*-* } 35 } */ - /* { dg-message "using .\\-\\(id\\)initWithData:\\(Object \\*\\)data."= "" { target *-*-* } 11 } */ + /* { dg-message "using .\\-\\(id\\)initWithData:\\(TestsuiteObject \\*= \\)data." "" { target *-*-* } 11 } */ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(id \\)data." "" { target *-*-* } 19 } */ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(int\\)data." "= " { target *-*-* } 15 } */ =20 Index: objc.dg/type-size-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/type-size-2.m (revision 174696) +++ objc.dg/type-size-2.m (working copy) @@ -4,20 +4,10 @@ /* Contributed by Ziemowit Laski . */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/runtime.h" #include #include -#ifdef __NEXT_RUNTIME__ -#include -#define METHOD Method -#else -#include -#define METHOD Method_t -#define method_get_types(M) (M)->method_types -#endif =20 extern int sscanf(const char *str, const char *format, ...); extern void abort(void); @@ -36,21 +26,21 @@ enum Enum { one, two, three, four }; @end =20 Class cls; -METHOD meth ; +Method meth ; =20 unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7; =20 static void scan_initial(const char *pattern) { totsize =3D offs0 =3D offs1 =3D offs2 =3D offs3 =3D offs4 =3D offs5 =3D = offs6 =3D offs7 =3D (unsigned)-1; - sscanf(method_get_types(meth), pattern, &totsize, &offs0, &offs1, &offs2= , &offs3, + sscanf(method_getTypeEncoding(meth), pattern, &totsize, &offs0, &offs1, = &offs2, &offs3, &offs4, &offs5, &offs6, &offs7); CHECK_IF(!offs0 && offs1 =3D=3D sizeof(id) && offs2 =3D=3D offs1 + sizeo= f(SEL) && totsize >=3D offs2); } =20 int main(void) { - cls =3D objc_get_class("ArrayTest"); + cls =3D objc_getClass("ArrayTest"); =20 - meth =3D class_get_instance_method(cls, @selector(str:with:and:)); + meth =3D class_getInstanceMethod(cls, @selector(str:with:and:)); =20 /* Here we have the complication that 'enum Enum' could be encoded as 'i' on __NEXT_RUNTIME_, and (most likely) as 'I' on the GNU @@ -67,7 +57,7 @@ int main(void) { =20 CHECK_IF(offs3 =3D=3D offs2 + sizeof(signed char *) && offs4 =3D=3D offs= 3 + sizeof(unsigned char *)); CHECK_IF(totsize =3D=3D offs4 + sizeof(enum Enum *)); - meth =3D class_get_instance_method(cls, @selector(meth1:with:with:)); + meth =3D class_getInstanceMethod(cls, @selector(meth1:with:with:)); scan_initial("i%u@%u:%u^i%u[0i]%u[2i]%u"); CHECK_IF(offs3 =3D=3D offs2 + sizeof(int *) && offs4 =3D=3D offs3 + size= of(int *)); CHECK_IF(totsize =3D=3D offs4 + sizeof(int *));=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 Index: objc.dg/local-decl-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/local-decl-2.m (revision 174696) +++ objc.dg/local-decl-2.m (working copy) @@ -3,9 +3,9 @@ /* Author: Ziemowit Laski . */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Sprite: Object { +@interface Sprite: TestsuiteObject { int sprite, spree; } + (void)setFoo:(int)foo; Index: objc.dg/method-10.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-10.m (revision 174696) +++ objc.dg/method-10.m (working copy) @@ -5,14 +5,14 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 extern void abort(void); #define CHECK_IF(expr) if(!(expr)) abort() =20 static double d =3D 4.5920234e2; =20 -@interface Foo : Object +@interface Foo : TestsuiteObject -(void) brokenType: (int)x floatingPoint: (double)y; @end =20 @@ -32,4 +32,3 @@ int main(void) return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/encode-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/encode-2.m (revision 174696) +++ objc.dg/encode-2.m (working copy) @@ -17,22 +17,14 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" +#include "../objc-obj-c++-shared/runtime.h" =20 -#ifdef __NEXT_RUNTIME__ -#define METHOD Method -#else -#include -#define METHOD Method_t -#define method_get_types(M) (M)->method_types -#endif - extern int sscanf(const char *str, const char *format, ...); extern void abort(void); #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface Foo: Object +@interface Foo: TestsuiteObject typedef struct { float x, y; } XXPoint; typedef struct { float width, height; } XXSize; typedef struct _XXRect { XXPoint origin; XXSize size; } XXRect; @@ -74,31 +66,29 @@ unsigned offs1, offs2, offs3, offs4, offs5, offs6, =20 int main(void) { Foo *foo =3D [[Foo alloc] init]; - Class fooClass =3D objc_get_class("Foo"); - METHOD meth; + Class fooClass =3D objc_getClass("Foo"); + Method meth; const char *string; =20 - meth =3D class_get_instance_method(fooClass, @selector(setRect:withInt:)= ); + meth =3D class_getInstanceMethod(fooClass, @selector(setRect:withInt:)); offs2 =3D 9999; =20 - sscanf(method_get_types(meth), "@%u@%u:%u{_XXRect=3D{?=3Dff}{?=3Dff}}%ui= %u", &offs1, &offs2, &offs3, + sscanf(method_getTypeEncoding(meth), "@%u@%u:%u{_XXRect=3D{?=3Dff}{?=3Df= f}}%ui%u", &offs1, &offs2, &offs3, &offs4, &offs5); =20=20=20=20 CHECK_IF(!offs2); [foo setRect:my_rect withInt:123]; =20 - meth =3D class_get_instance_method(fooClass, @selector(char:float:double= :long:)); + meth =3D class_getInstanceMethod(fooClass, @selector(char:float:double:l= ong:)); offs2 =3D 9999; if (sizeof (long) =3D=3D 8) string =3D "v%u@%u:%uc%uf%ud%uq%u"; else string =3D "v%u@%u:%uc%uf%ud%ul%u"; - sscanf(method_get_types(meth), string, &offs1, &offs2, &offs3,=20=20 + sscanf(method_getTypeEncoding(meth), string, &offs1, &offs2, &offs3,=20= =20 &offs4, &offs5, &offs6, &offs7); CHECK_IF(!offs2); [foo char:'c' float:2.3 double:3.5 long:2345L]; =20 return 0; }=20=20 - -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/threedotthree-abi-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/threedotthree-abi-1.m (revision 174696) +++ objc.dg/threedotthree-abi-1.m (working copy) @@ -4,9 +4,9 @@ /* { dg-require-effective-target ilp32 } */ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Protocol1.h" #include #include +#include "../objc-obj-c++-shared/runtime.h" =20 extern void abort(); =20 @@ -44,25 +44,32 @@ extern void abort(); =20 Protocol *proto =3D @protocol(CommonProtocol); struct objc_method_description *meth; +struct objc_method_description meth_object; =20 int main() { - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _On:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_On:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4On@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _nO:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_nO:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4nO@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _Oo:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_Oo:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4Oo@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _oO:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_oO:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4oO@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _rn:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_rn:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4rn@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _oOn:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_oOn:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4oOn@8")) abort(); return 0; Index: objc.dg/foreach-5.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/foreach-5.m (revision 174696) +++ objc.dg/foreach-5.m (working copy) @@ -5,10 +5,9 @@ /* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-= fnext-runtime" } { "" } } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m ../objc-obj-c= ++-shared/nsconstantstring-class-impl.m" } */ +/* { dg-additional-sources "../objc-obj-c++-shared/nsconstantstring-class-= impl.m" } */ =20 -#import "../objc-obj-c++-shared/Object1.h" -#import "../objc-obj-c++-shared/next-mapping.h" +#import "../objc-obj-c++-shared/TestsuiteObject.m" #ifndef __NEXT_RUNTIME__ #include #else @@ -30,7 +29,7 @@ typedef struct enumeration. You create the array with some objects; you can mutate the array, and you can fast-enumerate it. */ -@interface MyArray : Object +@interface MyArray : TestsuiteObject { unsigned int length; id *objects; @@ -43,7 +42,7 @@ typedef struct count:(unsigned long)len; @end =20 -@implementation MyArray : Object +@implementation MyArray : TestsuiteObject - (id) initWithLength: (unsigned int)l objects: (id *)o { Index: objc.dg/special/unclaimed-category-1.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/special/unclaimed-category-1.h (revision 174696) +++ objc.dg/special/unclaimed-category-1.h (working copy) @@ -5,11 +5,7 @@ =20 @interface TestClass { -#ifdef __OBJC2__ Class isa; -#else - id isa; -#endif } - (int)D; @end Index: objc.dg/special/unclaimed-category-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/special/unclaimed-category-1.m (revision 174696) +++ objc.dg/special/unclaimed-category-1.m (working copy) @@ -3,10 +3,7 @@ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 #include -#ifndef __NEXT_RUNTIME__ -#include -#endif -#include "../../objc-obj-c++-shared/next-mapping.h" +#include "../../objc-obj-c++-shared/runtime.h" =20 extern void abort (void); =20 @@ -27,9 +24,7 @@ extern void abort (void); { return 4; } -#ifdef __NEXT_RUNTIME__=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + initialize { return self; } -#endif @end =20 =20 @@ -38,13 +33,13 @@ int main (void) TestClass *test; Class testClass; =20 - testClass =3D objc_get_class ("TestClass"); + testClass =3D objc_getClass ("TestClass"); if (testClass =3D=3D Nil) { abort (); } =20=20=20 - test =3D (TestClass *)(class_create_instance (testClass)); + test =3D (TestClass *)(class_createInstance (testClass, 0)); if (test =3D=3D nil) { abort (); Index: objc.dg/func-ptr-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/func-ptr-1.m (revision 174696) +++ objc.dg/func-ptr-1.m (working copy) @@ -2,7 +2,7 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 extern int strcmp(const char *, const char *); extern void abort(void); @@ -10,7 +10,7 @@ extern void abort(void); =20 typedef float (*floatfunc)(float, float); =20 -@interface MyObject : Object +@interface MyObject : TestsuiteObject { @public int (*ivar)(int, int, int); @@ -47,5 +47,3 @@ int main () return(0); } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" - Index: objc.dg/stret-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/stret-1.m (revision 174696) +++ objc.dg/stret-1.m (working copy) @@ -3,7 +3,7 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 extern void abort(void); #define CHECK_IF(expr) if(!(expr)) abort() @@ -16,12 +16,12 @@ struct bstruct { float a, b, c, d, e, f; } globb =3D { 1, 2, 3, 4, 5, 6 }; =20 -@interface foo : Object +@interface foo : TestsuiteObject - (struct astruct) stret; - (struct bstruct) stretb; @end =20 -@implementation foo : Object +@implementation foo : TestsuiteObject - (struct astruct) stret { return globa; } - (struct bstruct) stretb { return globb; } @end @@ -62,4 +62,3 @@ int main(void) return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/method-19.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-19.m (revision 174696) +++ objc.dg/method-19.m (working copy) @@ -3,7 +3,7 @@ =20 /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @class NotKnown; =20 Index: objc.dg/zero-link-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/zero-link-1.m (revision 174696) +++ objc.dg/zero-link-1.m (working copy) @@ -5,7 +5,7 @@ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { dg-options "-fzero-link" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include #include =20 extern void abort(void); Index: objc.dg/sync-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/sync-1.m (revision 174696) +++ objc.dg/sync-1.m (working copy) @@ -2,7 +2,7 @@ /* { dg-options "-fobjc-exceptions" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include =20 void foo(id sem) { Index: objc.dg/category-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/category-1.m (revision 174696) +++ objc.dg/category-1.m (working copy) @@ -4,24 +4,18 @@ /* { dg-do run } */ /* { dg-xfail-run-if "need OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" extern int strcmp(const char *s1, const char *s2); extern void abort(void); =20 -#ifdef __NEXT_RUNTIME__ -#define SUPERCLASS superclass -#else -#define SUPERCLASS superClass -#endif - #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface MyObject: Object +@interface MyObject: TestsuiteObject + (Class)whatever1; @end =20 @implementation MyObject -+ (Class)whatever1 { return [super SUPERCLASS]; } ++ (Class)whatever1 { return [super superclass]; } @end =20 @interface MyObject (ThisWontCompile) @@ -29,7 +23,7 @@ extern void abort(void); @end =20=20 @implementation MyObject (ThisWontCompile) -+(Class)whatever2 { return [super SUPERCLASS]; } ++(Class)whatever2 { return [super superclass]; } @end =20 int main (int argc, const char * argv[]) @@ -37,15 +31,9 @@ int main (int argc, const char * argv[]) Class w1 =3D [MyObject whatever1]; Class w2 =3D [MyObject whatever2]; =20 -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - CHECK_IF(!strcmp( object_getClassName( w1 ), "Object")); - CHECK_IF(!strcmp( object_getClassName( w2 ), "Object")); -#else - CHECK_IF(!strcmp(w1->name, "Object")); - CHECK_IF(!strcmp(w2->name, "Object")); -#endif + CHECK_IF(!strcmp( object_getClassName( w1 ), "TestsuiteObject")); + CHECK_IF(!strcmp( object_getClassName( w2 ), "TestsuiteObject")); =20 return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/layout-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/layout-1.m (revision 174696) +++ objc.dg/layout-1.m (working copy) @@ -3,13 +3,13 @@ /* { dg-do compile } */ /* { dg-options "-Wpadded -Wpacked" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Derived1: Object +@interface Derived1: TestsuiteObject { } @end =20 -@interface Derived2: Object +@interface Derived2: TestsuiteObject - (id) foo; @end =20 Index: objc.dg/bitfield-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/bitfield-3.m (revision 174696) +++ objc.dg/bitfield-3.m (working copy) @@ -4,7 +4,7 @@ /* { dg-options "-Wpadded" } */ /* { dg-do run } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 extern void abort(void); extern int strcmp(const char *str1, const char *str2); @@ -12,7 +12,7 @@ extern int strcmp(const char *str1, const char *st =20 enum Enum { one, two, three, four }; =20 -@interface Base: Object { +@interface Base: TestsuiteObject { unsigned a: 2; int b: 3; enum Enum c: 4; Index: objc.dg/property/property-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/property/property-1.m (revision 174696) +++ objc.dg/property/property-1.m (working copy) @@ -1,12 +1,11 @@ /* This program tests use of property provided setter/getter functions. */ /* { dg-options "-std=3Dc99" } */ /* { dg-do run } */ -/* { dg-additional-sources "../../objc-obj-c++-shared/Object1.m" } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.m" =20 -@interface Bar : Object +@interface Bar : TestsuiteObject { int iVar; } Index: objc.dg/encode-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/encode-3.m (revision 174696) +++ objc.dg/encode-3.m (working copy) @@ -6,12 +6,13 @@ #include #include =20 -#ifndef __NEXT_RUNTIME__ -# include +#include "../objc-obj-c++-shared/runtime.h" + +#ifdef __cplusplus +#define ProtoBool bool +#else +#define ProtoBool _Bool #endif -#include "../objc-obj-c++-shared/objc-test-suite-types.h" -#include "../objc-obj-c++-shared/next-mapping.h" -#include =20 extern int sscanf(const char *str, const char *format, ...); extern void abort(void); @@ -36,9 +37,7 @@ typedef struct _XXRect { XXPoint origin; XXSize si =20 Protocol *proto; struct objc_method_description *meth; -#ifdef NEXT_OBJC_USE_NEW_INTERFACE struct objc_method_description meth_object; -#endif unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7; =20 static void scan_initial(const char *pattern) { @@ -51,13 +50,9 @@ static void scan_initial(const char *pattern) { int main(void) { const char *string; proto =3D @protocol(Proto); -#ifdef NEXT_OBJC_USE_NEW_INTERFACE meth_object =3D protocol_getMethodDescription (proto, @selector(char:float:double:unsigned:short:long:), YES, YES); meth =3D &meth_object; -#else - meth =3D [proto descriptionForInstanceMethod: @selector(char:float:doubl= e:unsigned:short:long:)]; -#endif if (sizeof (long) =3D=3D 8) string =3D "v%u@%u:%uc%uf%ud%uI%us%uq%u"; else @@ -66,23 +61,15 @@ int main(void) { CHECK_IF(offs3 =3D=3D offs2 + sizeof(int) && offs4 =3D=3D offs3 + sizeof= (float)); CHECK_IF(offs5 =3D=3D offs4 + sizeof(double) && offs6 =3D=3D offs5 + siz= eof(unsigned)); CHECK_IF(offs7 =3D=3D offs6 + sizeof(int) && totsize =3D=3D offs7 + size= of(long)); -#ifdef NEXT_OBJC_USE_NEW_INTERFACE meth_object =3D protocol_getMethodDescription (proto, @selector(setRect:withBool:withInt:), YES, YES); meth =3D &meth_object; -#else - meth =3D [proto descriptionForInstanceMethod: @selector(setRect:withBool= :withInt:)]; -#endif scan_initial("^v%u@%u:%u{_XXRect=3D{?=3Dff(__XXAngle=3DII)}{?=3Ddd}^{_XX= Rect}}%uB%ui%u"); CHECK_IF(offs3 =3D=3D offs2 + sizeof(XXRect) && offs4 =3D=3D offs3 + siz= eof(int)); CHECK_IF(totsize =3D=3D offs4 + sizeof(int)); -#ifdef NEXT_OBJC_USE_NEW_INTERFACE meth_object =3D protocol_getMethodDescription (proto, @selector(getEnum:enum:bool:), YES, NO); meth =3D &meth_object;=20 -#else - meth =3D [proto descriptionForClassMethod: @selector(getEnum:enum:bool:)= ]; -#endif =20 /* Here we have the complication that 'enum Enum' could be encoded as 'i' on __NEXT_RUNTIME_, and (most likely) as 'I' on the GNU @@ -100,13 +87,9 @@ int main(void) { =20 CHECK_IF(offs3 =3D=3D offs2 + sizeof(XXPoint *) && offs4 =3D=3D offs3 + = sizeof(enum Enum)); CHECK_IF(totsize =3D=3D offs4 + sizeof(int)); /* 'ObjCBool' is really '= char' */ -#ifdef NEXT_OBJC_USE_NEW_INTERFACE meth_object =3D protocol_getMethodDescription (proto, @selector(getBool:), YES, NO); meth =3D &meth_object; -#else - meth =3D [proto descriptionForClassMethod: @selector(getBool:)];=20=20= =20=20=20=20=20=20=20 -#endif scan_initial("^^B%u@%u:%u^*%u"); CHECK_IF(totsize =3D=3D offs2 + sizeof(ObjCBool **)); return 0; Index: objc.dg/try-catch-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/try-catch-3.m (revision 174696) +++ objc.dg/try-catch-3.m (working copy) @@ -5,14 +5,14 @@ /* { dg-do compile } */ /* { dg-options "-fobjc-exceptions" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 const char *foo(void) { @try { return "foo"; } - @catch (Object* theException) { + @catch (TestsuiteObject* theException) { return [theException name]; } } Index: objc.dg/foreach-6.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/foreach-6.m (revision 174696) +++ objc.dg/foreach-6.m (working copy) @@ -1,8 +1,10 @@ /* Test basic Objective-C foreach syntax. This tests warnings and errors.= */ /* { dg-do compile } */ =20 -#import "../objc-obj-c++-shared/Object1.h" -#import "../objc-obj-c++-shared/next-mapping.h" +#import "../objc-obj-c++-shared/TestsuiteObject.h" +#import +#undef nil +#define nil ((id)0) =20 /* struct __objcFastEnumerationState @@ -13,7 +15,7 @@ struct __objcFastEnumerationState unsigned long extra[5]; }; */ -@interface Object (NSFastEnumeration) +@interface TestsuiteObject (NSFastEnumeration) - (unsigned long)countByEnumeratingWithState: (struct __objcFastEnumeratio= nState *)state objects:(id *)stackbuf=20 count:(unsigned int)len; @@ -46,7 +48,7 @@ int main (void) ; =20 for (12 in array) /* { dg-error "invalid iterating variable in fast enum= eration" } */ - ; /* { dg-error "iterating variable in fast enumeration = is not an object" "" { target *-*-* } 48 } */ + ; /* { dg-error "iterating variable in fast enumeration = is not an object" "" { target *-*-* } 50 } */ =20 for (object in 12) /* { dg-error "collection in fast enumeration is not = an object" } */ ; Index: objc.dg/method-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-3.m (revision 174696) +++ objc.dg/method-3.m (working copy) @@ -4,17 +4,17 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 extern void abort(void); #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface Int1: Object +@interface Int1: TestsuiteObject + (int) classMeth; - (int) instanceMeth; @end =20 -@interface Int2: Object +@interface Int2: TestsuiteObject + (int) classMeth;=20=20=20=20=20=20 - (int) instanceMeth; @end @@ -45,4 +45,3 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/typedef-alias-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/typedef-alias-1.m (revision 174696) +++ objc.dg/typedef-alias-1.m (working copy) @@ -1,15 +1,16 @@ /* Typedefs of ObjC types should work without any bogus warnings. */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include =20 -typedef Object MyObject; +typedef TestsuiteObject MyObject; =20 int main (int argc, const char * argv[]) { - Object* a =3D nil; + TestsuiteObject* a =3D nil; MyObject* b =3D a; - Object* c =3D b; + TestsuiteObject* c =3D b; =20 return 0; } Index: objc.dg/proto-lossage-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/proto-lossage-2.m (revision 174696) +++ objc.dg/proto-lossage-2.m (working copy) @@ -2,13 +2,14 @@ provide a suitable method. */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include =20 @protocol Zot -(void) zot; @end =20 -@interface Foo : Object +@interface Foo : TestsuiteObject @end =20 int foo() Index: objc.dg/func-ptr-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/func-ptr-2.m (revision 174696) +++ objc.dg/func-ptr-2.m (working copy) @@ -5,10 +5,9 @@ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 #include -/* provide an Object class for NeXT runtimes 10.5 and above */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 -@interface Func: Object +@interface Func: TestsuiteObject + (int) processNumber:(int)a and:(int)b usingFunction:(int(int,int))func; @end =20 @@ -38,4 +37,3 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/stret-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/stret-2.m (revision 174696) +++ objc.dg/stret-2.m (working copy) @@ -6,7 +6,7 @@ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { dg-require-effective-target ilp32 } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 struct astruct { float a, b; @@ -17,12 +17,12 @@ struct bstruct { float a, b, c, d, e, f; } globb =3D { 1, 2, 3, 4, 5, 6 }; =20 -@interface foo : Object +@interface foo : TestsuiteObject - (struct astruct) stret; - (struct bstruct) stretb; @end =20 -@implementation foo : Object +@implementation foo : TestsuiteObject - (struct astruct) stret { return glob; } - (struct bstruct) stretb { return globb; } @end @@ -46,4 +46,3 @@ struct astruct afunc(foo *foo_obj) { =20 /* { dg-final { scan-assembler-not "objc_msgSend\[^_S\]" } } */ /* { dg-final { scan-assembler-not "objc_msgSendSuper\[^_\]" } } */ - Index: objc.dg/fsf-package-0.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/fsf-package-0.m (revision 174696) +++ objc.dg/fsf-package-0.m (working copy) @@ -1,9 +1,8 @@ /* { dg-do compile } */ =20 -#import "../objc-obj-c++-shared/Object1.h" -#include +#import "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object +@interface obj : TestsuiteObject { @public int v1; @@ -18,7 +17,7 @@ - (void) setValue: (int)number; @end =20 -@implementation obj : Object +@implementation obj : TestsuiteObject =20 - (int) value { return v1; } - (void) setValue: (int)number { v1 =3D number; } @@ -33,5 +32,5 @@ void foo (void) a->v2 =3D 1; a->v3 =3D [a value] - a->v2; /* { dg-warning ".v3. is @protected" } */ a->v4 =3D a->v3 - 1; /* { dg-warning ".v4. is @private" } */ - /* { dg-warning ".v3. is @protected" "" { target *-*-* } 35 } */ + /* { dg-warning ".v3. is @protected" "" { target *-*-* } 34 } */ } Index: objc.dg/lookup-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/lookup-1.m (revision 174696) +++ objc.dg/lookup-1.m (working copy) @@ -1,9 +1,8 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */ =20 #include -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 typedef struct MyWidget { int a; @@ -15,13 +14,13 @@ MyWidget gWidget =3D { 17 }; - (MyWidget *)widget; @end =20 -@interface Foo: Object +@interface Foo: TestsuiteObject @end =20 @interface Bar: Foo @end =20 -@interface Container: Object +@interface Container: TestsuiteObject + (MyWidget *)elementForView:(Foo *)view; @end =20 @@ -38,7 +37,8 @@ MyWidget gWidget =3D { 17 }; + (MyWidget *)elementForView:(Foo *)view { MyWidget *widget =3D (MyWidget *) nil; - if ([view conformsTo:@protocol(MyProto)]) { + if (class_conformsToProtocol (object_getClass (view), + @protocol(MyProto))) { widget =3D [(Foo *)view widget]; } return widget; Index: objc.dg/torture/tls/thr-init-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/torture/tls/thr-init-3.m (revision 174696) +++ objc.dg/torture/tls/thr-init-3.m (working copy) @@ -2,12 +2,11 @@ /* { dg-require-effective-target tls_runtime } */ /* { dg-add-options tls } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.m" } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" extern void _exit(int); =20 -@interface tsObj: Object { +@interface tsObj: TestsuiteObject { int ai ; } =20 Index: objc.dg/torture/trivial.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/torture/trivial.m (revision 174696) +++ objc.dg/torture/trivial.m (working copy) @@ -1,11 +1,10 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../../objc-obj-c++-shared/Object1.m" } */ =20 -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.m" =20 int main(void) { - [Object class]; + [TestsuiteObject class]; return 0; } Index: objc.dg/torture/strings/const-str-7.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/torture/strings/const-str-7.m (revision 174696) +++ objc.dg/torture/strings/const-str-7.m (working copy) @@ -3,27 +3,28 @@ /* { dg-do run } */ /* { dg-options "-fconstant-string-class=3DFoo " } */ /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=3DFoo" { = target *-*-darwin* } } */ -/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.m" } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" #include #include #include =20 -@interface Foo: Object { +@interface Foo: TestsuiteObject { char *cString; unsigned int len; } - (char *)customString; @end =20 +#ifdef __NEXT_RUNTIME__ #ifdef NEXT_OBJC_USE_NEW_INTERFACE Class _FooClassReference; #else struct objc_class _FooClassReference; #endif +#endif =20 -@implementation Foo : Object +@implementation Foo : TestsuiteObject - (char *)customString { return cString; } Index: objc.dg/torture/strings/const-str-8.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/torture/strings/const-str-8.m (revision 174696) +++ objc.dg/torture/strings/const-str-8.m (working copy) @@ -3,24 +3,25 @@ /* { dg-do run } */ /* { dg-options "-fconstant-string-class=3DFoo" } */ /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=3DFoo" { = target *-*-darwin* } } */ -/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.m" } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" #include =20 -@interface Foo: Object { +@interface Foo: TestsuiteObject { char *cString; unsigned int len; } @end =20 +#ifdef __NEXT_RUNTIME__ #ifdef NEXT_OBJC_USE_NEW_INTERFACE Class _FooClassReference; #else struct objc_class _FooClassReference; #endif +#endif =20 -@implementation Foo : Object +@implementation Foo : TestsuiteObject - (char *)customString { return cString; } Index: objc.dg/torture/strings/const-str-9.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/torture/strings/const-str-9.m (revision 174696) +++ objc.dg/torture/strings/const-str-9.m (working copy) @@ -5,7 +5,8 @@ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include +#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW= _INTERFACE. */ =20 @interface NSConstantString: Object { char *cString; Index: objc.dg/torture/strings/const-str-10.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/torture/strings/const-str-10.m (revision 174696) +++ objc.dg/torture/strings/const-str-10.m (working copy) @@ -6,7 +6,8 @@ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include +#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW= _INTERFACE. */ =20 @interface NSString: Object @end Index: objc.dg/torture/strings/const-str-11.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/torture/strings/const-str-11.m (revision 174696) +++ objc.dg/torture/strings/const-str-11.m (working copy) @@ -7,7 +7,8 @@ /* { dg-options "-fconstant-string-class=3DXStr" } */ /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=3DXStr" {= target *-*-darwin* } } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include +#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW= _INTERFACE. */ =20 @interface XString: Object { @protected Index: objc.dg/torture/forward-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/torture/forward-1.m (revision 174696) +++ objc.dg/torture/forward-1.m (working copy) @@ -1,24 +1,18 @@ /* { dg-do run } */ -/* See if -forward::/-performv:: is able to work. */ +/* See if -forward:: is able to work. */ /* { dg-xfail-run-if "PR36610" { ! { { i?86-*-* x86_64-*-* } && ilp32 } } = { "-fgnu-runtime" } { "" } } */ /* { dg-skip-if "Needs OBJC2 Implementation" { *-*-darwin* && { lp64 } } {= "-fnext-runtime" } { "" } } */ -/* There is no implementation of forward: in the NeXT m64 libobjc/Object - neither have we implemented this in our extensions - so we have to skip= it - for now. */ =20 #include #include =20 -#ifndef __NEXT_RUNTIME__ -# include -#endif -#include +#include "../../objc-obj-c++-shared/TestsuiteObject.m" =20 #define VALUETOUSE 1234567890 =20 id forwarder, receiver; =20 -@interface Forwarder: Object +@interface Forwarder: TestsuiteObject { id receiver; } @@ -27,7 +21,7 @@ id forwarder, receiver; =20 @end =20 -@interface Receiver:Object +@interface Receiver:TestsuiteObject { int foo; } @@ -44,6 +38,7 @@ id forwarder, receiver; =20 -display { + printf ("Executing display\n"); /* Check to see if we are really the reciever. */ if (self !=3D receiver) abort (); @@ -62,18 +57,24 @@ id forwarder, receiver; receiver =3D theReceiver; return self; } -#ifdef __NEXT_RUNTIME__ -- forward: (SEL)theSel: (marg_list)theArgFrame -#else --(retval_t) forward: (SEL)theSel: (arglist_t)theArgFrame -#endif +-(void *) forward: (SEL)theSel: (void *)theArgFrame { /* If we have a reciever try to perform on that object */ if (receiver) - return [receiver performv: theSel: theArgFrame]; + { + /* Simple forward that works for methods with no + arguments. */ + typedef id (*method_with_no_args) (id receiver, SEL _cmd); + Method method =3D class_getInstanceMethod (object_getClass (receiver), + theSel); + method_with_no_args imp =3D (method_with_no_args)(method_getImplementation + (method)); + return (*imp)(receiver, theSel); + } =20 /* Normally you'd emit an error here. */ printf ("Unrecognized selector\n"); + return NULL; } @end int main() Index: objc.dg/sync-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/sync-2.m (revision 174696) +++ objc.dg/sync-2.m (working copy) @@ -1,13 +1,13 @@ /* Make sure that @synchronized parses and a very basic test runs. */ /* { dg-options "-fobjc-exceptions -fgnu-runtime" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 int main (void) { - Object *a =3D [Object new]; - Object *b =3D [Object new]; - Object *c =3D [Object new]; + TestsuiteObject *a =3D [TestsuiteObject new]; + TestsuiteObject *b =3D [TestsuiteObject new]; + TestsuiteObject *c =3D [TestsuiteObject new]; =20 /* This single-threaded test just checks that @synchronized() uses a recursive mutex, and that the runtime at least doesn't crash Index: objc.dg/layout-2.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/layout-2.m (revision 174696) +++ objc.dg/layout-2.m (working copy) @@ -4,10 +4,10 @@ /* { dg-do compile } */ /* { dg-options "-Wpadded" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 /* Implement a class, so that the metadata generation happens. */ -@interface MyClass : Object +@interface MyClass : TestsuiteObject @end =20 @implementation MyClass Index: objc.dg/encode-4.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/encode-4.m (revision 174696) +++ objc.dg/encode-4.m (working copy) @@ -4,13 +4,8 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" -#ifdef __NEXT_RUNTIME__ -#include -#else -#include -#endif +#include "../objc-obj-c++-shared/TestsuiteObject.m" +#include "../objc-obj-c++-shared/runtime.h" =20 extern void abort(void); extern int strcmp(const char *s1, const char *s2); @@ -31,7 +26,7 @@ struct Nested { struct Innermost innermost; }; =20 -@interface Int1: Object { +@interface Int1: TestsuiteObject { signed char a, b; Int2 *int2; struct Nested nested; @@ -50,28 +45,28 @@ struct Nested { @implementation Int2 @end =20 -#ifdef NEXT_OBJC_USE_NEW_INTERFACE -Ivar *ivar; -#else +#if defined(__NEXT_RUNTIME__) && !defined(NEXT_OBJC_USE_NEW_INTERFACE) struct objc_ivar *ivar; +#else +Ivar *ivar; #endif =20 static void check_ivar(const char *name, const char *type) { -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - CHECK_IF(!strcmp(ivar_getName(*ivar), name)); - CHECK_IF(!strcmp(ivar_getTypeEncoding(*ivar), type)); -#else +#if defined(__NEXT_RUNTIME__) && !defined(NEXT_OBJC_USE_NEW_INTERFACE) CHECK_IF(!strcmp(ivar->ivar_name, name)); CHECK_IF(!strcmp(ivar->ivar_type, type)); +#else + CHECK_IF(!strcmp(ivar_getName(*ivar), name)); + CHECK_IF(!strcmp(ivar_getTypeEncoding(*ivar), type)); #endif ivar++; } =20 int main(void) { -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - ivar =3D class_copyIvarList ((Class)objc_get_class("Int1"), NULL); +#if defined(__NEXT_RUNTIME__) && !defined(NEXT_OBJC_USE_NEW_INTERFACE) + ivar =3D ((Class)objc_getClass("Int1"))->ivars->ivar_list; #else - ivar =3D ((Class)objc_get_class("Int1"))->ivars->ivar_list; + ivar =3D class_copyIvarList ((Class)objc_getClass("Int1"), NULL); #endif check_ivar("a", "c"); check_ivar("b", "c"); @@ -79,10 +74,10 @@ int main(void) { check_ivar("nested",=20 "{Nested=3D\"a\"f\"b\"f\"next\"@\"Int1\"\"innermost\"{Innermost=3D\"a\= "C\"b\"C\"encl\"^{Nested}}}"); =20=20=20=20=20 -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - ivar =3D class_copyIvarList ((Class)objc_get_class("Int2"), NULL); +#if defined(__NEXT_RUNTIME__) && !defined(NEXT_OBJC_USE_NEW_INTERFACE) + ivar =3D ((Class)objc_getClass("Int2"))->ivars->ivar_list; #else - ivar =3D ((Class)objc_get_class("Int2"))->ivars->ivar_list; + ivar =3D class_copyIvarList ((Class)objc_getClass("Int2"), NULL); #endif check_ivar("innermost", "^{Innermost=3DCC^{Nested}}"); check_ivar("base", "@\"Int1\""); @@ -90,4 +85,3 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/class-protocol-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/class-protocol-1.m (revision 174696) +++ objc.dg/class-protocol-1.m (working copy) @@ -3,7 +3,7 @@ /* { dg-do compile } */ =20 #include -#include +#include "../objc-obj-c++-shared/runtime.h" =20 @protocol MyProto1 +(void)doItClass1; Index: objc.dg/foreach-7.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/foreach-7.m (revision 174696) +++ objc.dg/foreach-7.m (working copy) @@ -1,9 +1,10 @@ /* Test basic Objective-C foreach syntax. This tests warnings and errors.= */ /* { dg-do compile } */ =20 -#import "../objc-obj-c++-shared/Object1.h" -#import "../objc-obj-c++-shared/next-mapping.h" - +#import "../objc-obj-c++-shared/TestsuiteObject.h" +#import +#undef nil +#define nil ((id)0) /* struct __objcFastEnumerationState { @@ -13,7 +14,7 @@ struct __objcFastEnumerationState unsigned long extra[5]; }; */ -@interface Object (NSFastEnumeration) +@interface TestsuiteObject (NSFastEnumeration) - (unsigned long)countByEnumeratingWithState: (struct __objcFastEnumeratio= nState *)state objects:(id *)stackbuf=20 count:(unsigned int)len; @@ -36,10 +37,10 @@ int main (void) id object =3D nil; =20 for (typedef int my_typedef in array) /* { dg-error "declaration of non-= variable" } */ - ; /* { dg-error "iterating variable = in fast enumeration is not an object" "" { target *-*-* } 38 } */ + ; /* { dg-error "iterating variable = in fast enumeration is not an object" "" { target *-*-* } 39 } */ =20 for (function () in nil) /* { dg-error "invalid iterating variable in fa= st enumeration" } */ - ; /* { dg-error "iterating variable in fast enume= ration is not an object" "" { target *-*-* } 41 } */ + ; /* { dg-error "iterating variable in fast enume= ration is not an object" "" { target *-*-* } 42 } */ =20 for (object_function () in nil) /* { dg-error "invalid iterating variabl= e in fast enumeration" } */ ; Index: objc.dg/method-4.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-4.m (revision 174696) +++ objc.dg/method-4.m (working copy) @@ -5,16 +5,16 @@ /* { dg-do compile { target { *-*-darwin* && { ! lp64 } } } } */ /* { dg-skip-if "" { *-*-darwin* } { "-fgnu-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -typedef Object ObjectTypedef1; +typedef TestsuiteObject ObjectTypedef1; typedef ObjectTypedef1 ObjectTypedef2; @compatibility_alias ObjectAlias1 ObjectTypedef2; @compatibility_alias ObjectAlias2 ObjectAlias1; typedef ObjectAlias2 ObjectTypedef3; =20 void foo(void) { - id obj =3D [Object new]; + id obj =3D [TestsuiteObject new]; obj =3D [ObjectTypedef1 new]; obj =3D [ObjectTypedef2 new]; obj =3D [ObjectTypedef3 new]; Index: objc.dg/sizeof-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/sizeof-1.m (revision 174696) +++ objc.dg/sizeof-1.m (working copy) @@ -3,13 +3,13 @@ /* { dg-options "" } */ /* { dg-do run } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 extern void abort(void); #define CHECK_IF(expr) if(!(expr)) abort(); =20 -@interface Foo: Object { +@interface Foo: TestsuiteObject { int a, b; float c, d; } @@ -18,17 +18,16 @@ extern void abort(void); @implementation Foo @end =20 -typedef Object MyObject; +typedef TestsuiteObject MyObject; typedef struct Foo Foo_type; =20 -@compatibility_alias AliasObject Object; +@compatibility_alias AliasObject TestsuiteObject; =20 int main(void) { - CHECK_IF(sizeof(Foo) > sizeof(Object) && sizeof(Object) > 0); + CHECK_IF(sizeof(Foo) > sizeof(TestsuiteObject) && sizeof(TestsuiteObject= ) > 0); CHECK_IF(sizeof(Foo) =3D=3D sizeof(Foo_type)); - CHECK_IF(sizeof(Object) =3D=3D sizeof(MyObject)); - CHECK_IF(sizeof(Object) =3D=3D sizeof(AliasObject)); + CHECK_IF(sizeof(TestsuiteObject) =3D=3D sizeof(MyObject)); + CHECK_IF(sizeof(TestsuiteObject) =3D=3D sizeof(AliasObject)); return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/proto-lossage-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/proto-lossage-3.m (revision 174696) +++ objc.dg/proto-lossage-3.m (working copy) @@ -3,10 +3,13 @@ Problem report and original fix by richard@brainstorm.co.uk. */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Protocol1.h" -#include "../objc-obj-c++-shared/Object1.h" #include +#include "../objc-obj-c++-shared/runtime.h" =20 +@interface MyClass +- name; +@end + @protocol NoInstanceMethods + testMethod; @end @@ -18,9 +21,9 @@ int main() { -[@protocol(NoInstanceMethods) descriptionForInstanceMethod: @selector(name= )]; -[@protocol(NoInstanceMethods) descriptionForClassMethod: @selector(name)]; -[@protocol(NoClassMethods) descriptionForInstanceMethod: @selector(name)]; -[@protocol(NoClassMethods) descriptionForClassMethod: @selector(name)]; +protocol_getMethodDescription (@protocol(NoInstanceMethods), @selector(nam= e), YES, YES); +protocol_getMethodDescription (@protocol(NoInstanceMethods), @selector(nam= e), YES, NO); +protocol_getMethodDescription (@protocol(NoClassMethods), @selector(name),= YES, YES); +protocol_getMethodDescription (@protocol(NoClassMethods), @selector(name),= YES, NO); return 0; } Index: objc.dg/proto-qual-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/proto-qual-1.m (revision 174696) +++ objc.dg/proto-qual-1.m (working copy) @@ -4,11 +4,8 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 +#include "../objc-obj-c++-shared/runtime.h" #include -#ifndef __NEXT_RUNTIME__ -#include -#endif -#include "../objc-obj-c++-shared/next-mapping.h" =20 /* The encoded parameter sizes will be rounded up to match pointer alignme= nt. */ #define ROUND(s,a) (a * ((s + a - 1) / a)) @@ -34,9 +31,7 @@ extern void abort(void); =20 Protocol *proto; struct objc_method_description *meth; -#ifdef NEXT_OBJC_USE_NEW_INTERFACE struct objc_method_description meth_object; -#endif unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7; =20 static void scan_initial(const char *pattern) { @@ -48,22 +43,18 @@ static void scan_initial(const char *pattern) { =20 int main(void) { proto =3D @protocol(Retain); -#ifdef NEXT_OBJC_USE_NEW_INTERFACE + meth_object =3D protocol_getMethodDescription (proto, @selector(address:with:), YES, YES); meth =3D &meth_object; -#else - meth =3D [proto descriptionForInstanceMethod: @selector(address:with:)]; -#endif + scan_initial("O@%u@%u:%uNR@%uo^^S%u"); CHECK_IF(offs3 =3D=3D offs2 + aligned_sizeof(id) && totsize =3D=3D offs3= + aligned_sizeof(unsigned)); -#ifdef NEXT_OBJC_USE_NEW_INTERFACE + meth_object =3D protocol_getMethodDescription (proto, @selector(retainArgument:with:), YES, NO); meth =3D &meth_object; -#else - meth =3D [proto descriptionForClassMethod: @selector(retainArgument:with= :)]; -#endif + scan_initial("Vv%u@%u:%uOo@%un^*%u"); CHECK_IF(offs3 =3D=3D offs2 + aligned_sizeof(id) && totsize =3D=3D offs3= + aligned_sizeof(char **)); return 0; Index: objc.dg/method-13.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/method-13.m (revision 174696) +++ objc.dg/method-13.m (working copy) @@ -6,13 +6,8 @@ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 #include +#include "../objc-obj-c++-shared/runtime.h" =20 -#ifdef __NEXT_RUNTIME__ -#define OBJC_GETCLASS objc_getClass -#else -#define OBJC_GETCLASS objc_get_class -#endif - extern void abort(void); extern int strcmp(const char *, const char *); #define CHECK_IF(expr) if(!(expr)) abort() @@ -48,16 +43,14 @@ extern int strcmp(const char *, const char *); @end =20 @implementation Root -#ifdef __NEXT_RUNTIME__ + initialize { return self; } -#endif - (const char *) method1 { return "Root::-method1"; } + (const char *) method2 { return "Root::+method2"; } @end =20 int main(void) { - Class obj =3D OBJC_GETCLASS("Derived"); + Class obj =3D objc_getClass("Derived"); =20 /* None of the following should elicit compiler-time warnings. */ =20 Index: objc.dg/gnu-runtime-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/gnu-runtime-1.m (revision 174696) +++ objc.dg/gnu-runtime-1.m (working copy) @@ -4,9 +4,9 @@ /* { dg-do compile } */ /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */ =20 -#include +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface FooBar: Object +@interface FooBar: TestsuiteObject - (void)boo; @end =20 Index: objc.dg/zero-link-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/zero-link-3.m (revision 174696) +++ objc.dg/zero-link-3.m (working copy) @@ -5,8 +5,7 @@ /* { dg-options "-fzero-link" } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" -//#import +#include =20 extern void abort(void); #define CHECK_IF(expr) if(!(expr)) abort(); @@ -25,4 +24,3 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/pr23214.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/pr23214.m (revision 174696) +++ objc.dg/pr23214.m (working copy) @@ -6,16 +6,13 @@ =20 #include =20=20 -#ifdef __OBJC2__ -/* The ObjC V2 "Object" does not provide -class. */ @interface Object (TS_CAT) -- class; +- test; @end =20 @implementation Object (TS_CAT) -- class { return isa; } +- test { return self; } @end -#endif =20 @protocol A @end @@ -28,8 +25,8 @@ =20 int main () { - [@protocol(A) class]; - [@protocol(B) class]; + [@protocol(A) test]; + [@protocol(B) test]; =20 return 0; } Index: objc.dg/bitfield-5.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/bitfield-5.m (revision 174696) +++ objc.dg/bitfield-5.m (working copy) @@ -7,7 +7,7 @@ /* { dg-options "-Wpadded" } */ /* { dg-do run } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #include =20 @@ -15,7 +15,7 @@ =20 enum Enum { zero, one, two, three, four }; =20 -@interface Base: Object { +@interface Base: TestsuiteObject { @public unsigned a: 2; int b: 3; Index: objc.dg/va-meth-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/va-meth-1.m (revision 174696) +++ objc.dg/va-meth-1.m (working copy) @@ -2,14 +2,14 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 #include #include =20 /* Test methods with "C-style" trailing arguments, with or without ellipsi= s. */ =20 -@interface MathClass: Object +@interface MathClass: TestsuiteObject /* sum positive numbers; -1 ends the list */ + (int) sum: (int)firstNumber, int secondNumber, ...; + (int) prod: (int) firstNumber, int secondNumber, int thirdNumber; @@ -70,4 +70,3 @@ int main (void) return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/encode-5.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/encode-5.m (revision 174696) +++ objc.dg/encode-5.m (working copy) @@ -9,21 +9,13 @@ =20 /* Contributed by Alexander Malmberg */ =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" +#include "../objc-obj-c++-shared/runtime.h" #include #include #define CHECK_IF(expr) if(!(expr)) abort() =20 -#ifdef __NEXT_RUNTIME__ -#define METHOD Method -#else -#include -#define METHOD Method_t -#define method_get_types(M) (M)->method_types -#endif - -@interface Test : Object +@interface Test : TestsuiteObject { float j; } -(void) test2: (int [5])a with: (int [])b; -(id) test3: (Test **)b; /* { dg-message "previous declaration of .\\-\\(i= d\\)test3:\\(Test \\*\\*\\)b." } */ @@ -47,8 +39,8 @@ int offs1, offs2, offs3, offs4, offs5, offs6; =20 int main(int argc, char **argv) { - Class testClass =3D objc_get_class("Test"); - METHOD meth; + Class testClass =3D objc_getClass("Test"); + Method meth; =20 cc[0] =3D [Test new]; CHECK_IF (bb[3] =3D=3D 3); @@ -58,16 +50,16 @@ int main(int argc, char **argv) [*c test2: bb with: bb + 5]; CHECK_IF (bb[3] =3D=3D 5); =20 - meth =3D class_get_instance_method(testClass, @selector(test2:with:)); + meth =3D class_getInstanceMethod(testClass, @selector(test2:with:)); offs1 =3D offs2 =3D offs3 =3D offs4 =3D offs5 =3D offs6 =3D -1; - sscanf(method_get_types(meth), "v%d@%d:%d[%di]%d^i%d", &offs1, &offs2, &= offs3, + sscanf(method_getTypeEncoding(meth), "v%d@%d:%d[%di]%d^i%d", &offs1, &of= fs2, &offs3, &offs4, &offs5, &offs6); CHECK_IF (!offs2 && offs4 =3D=3D 5 && offs3 > 0); CHECK_IF (offs5 =3D=3D 2 * offs3 && offs6 =3D=3D 3 * offs3 && offs1 =3D= =3D 4 * offs3); =20=20=20 - meth =3D class_get_instance_method(testClass, @selector(test3:)); + meth =3D class_getInstanceMethod(testClass, @selector(test3:)); offs1 =3D offs2 =3D offs3 =3D offs4 =3D offs5 =3D offs6 =3D -1; - sscanf(method_get_types(meth), "v%d@%d:%d[%d[%d{Test=3D#f}]]%d", &offs1,= &offs2, &offs3, + sscanf(method_getTypeEncoding(meth), "v%d@%d:%d[%d[%d{Test=3D#f}]]%d", &= offs1, &offs2, &offs3, &offs4, &offs5, &offs6); CHECK_IF (!offs2 && offs4 =3D=3D 3 && offs5 =3D=3D 4 && offs3 > 0); CHECK_IF (offs6 =3D=3D 2 * offs3 && offs1 =3D=3D 3 * offs3); Index: objc.dg/super-class-3.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/super-class-3.m (revision 174696) +++ objc.dg/super-class-3.m (working copy) @@ -4,12 +4,12 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 #include #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface _Child: Object +@interface _Child: TestsuiteObject + (int) flashCache; @end =20 @@ -21,10 +21,10 @@ + (int) flushCache2; @end =20 -int _Object =3D 23; /* Should not conflict with @interface Object. */ +int _TestsuiteObject =3D 23; /* Should not conflict with @interface Tests= uiteObject. */ =20 @implementation _Child -+ (int) flashCache { return 12 + _Object; } ++ (int) flashCache { return 12 + _TestsuiteObject; } @end =20 @implementation Child @@ -43,4 +43,3 @@ int main(void) { return 0;=20 } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: objc.dg/call-super-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/call-super-1.m (revision 174696) +++ objc.dg/call-super-1.m (working copy) @@ -5,7 +5,7 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 extern void abort(void); =20 @@ -23,7 +23,7 @@ Point MakePoint ( float x , float y ) { return p;=20 }=20 =20 -@interface Base: Object=20 +@interface Base: TestsuiteObject=20 - ( void ) translateOriginToPoint : ( Point ) translation ;=20 @end =20 @@ -75,4 +75,4 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: objc.dg/pr18255.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/pr18255.m (revision 174696) +++ objc.dg/pr18255.m (working copy) @@ -2,6 +2,7 @@ /* { dg-do run } */ /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */ =20 +#include #include #include =20 @@ -17,8 +18,16 @@ =20 int main (int argc, char **argv) { - if ([@protocol(b) descriptionForInstanceMethod: @selector(aMethod)] =3D= =3D NULL) + struct objc_method_description m; + m =3D protocol_getMethodDescription (@protocol(b), @selector(aMethod), Y= ES, YES); + + if (m.name !=3D NULL) abort (); =20 + m =3D protocol_getMethodDescription (@protocol(a), @selector(aMethod), Y= ES, YES); + + if (m.name =3D=3D NULL) + abort (); + return 0; } Index: objc.dg/isa-field-1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/isa-field-1.m (revision 174696) +++ objc.dg/isa-field-1.m (working copy) @@ -1,17 +1,18 @@ /* Ensure there are no bizarre difficulties with accessing the 'isa' field= of objects. */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include "../objc-obj-c++-shared/runtime.h" =20 -@interface Object (Test) +@interface TestsuiteObject (Test) - (Class) test1: (id)object; @end =20 -@interface Derived: Object +@interface Derived: TestsuiteObject - (Class) test2: (id)object; @end =20 -@implementation Object (Test) +@implementation TestsuiteObject (Test) =20 Class test1(id object) { #ifdef __NEXT_RUNTIME__ Index: objc.dg/defs.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc.dg/defs.m (revision 174696) +++ objc.dg/defs.m (working copy) @@ -5,14 +5,14 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" //#include =20 extern void abort(void); =20 #define CHECK_IF(expr) if(!(expr)) abort(); =20 -@interface Base: Object { +@interface Base: TestsuiteObject { @public int a; float b; @@ -67,4 +67,4 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/method-19.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-19.mm (revision 174696) +++ obj-c++.dg/method-19.mm (working copy) @@ -4,13 +4,9 @@ /* Author: Ziemowit Laski . */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/next-mapping.h" #include +#include "../objc-obj-c++-shared/runtime.h" =20 -#ifndef __NEXT_RUNTIME__ -#include -#endif - #include #include =20 @@ -47,16 +43,14 @@ @end =20 @implementation Root -#ifdef __NEXT_RUNTIME__ + initialize { return self; } -#endif - (const char *) method1 { return "Root::-method1"; } + (const char *) method2 { return "Root::+method2"; } @end =20 int main(void) { - Class obj =3D objc_get_class("Derived"); + Class obj =3D objc_getClass("Derived"); =20 /* None of the following should elicit compiler-time warnings. */ =20 @@ -75,4 +69,4 @@ int main(void) =20 return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/template-4.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/template-4.mm (revision 174696) +++ obj-c++.dg/template-4.mm (working copy) @@ -3,7 +3,7 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.mm ../objc-obj-= c++-shared/nsconstantstring-class-impl.mm" } */ +/* { dg-additional-sources "../objc-obj-c++-shared/nsconstantstring-class-= impl.mm" } */ =20 #include #include @@ -15,8 +15,8 @@ #include "../objc-obj-c++-shared/nsconstantstring-class.h" #endif =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" +#include "../objc-obj-c++-shared/runtime.h" =20 #define CHECK_IF(expr) if(!(expr)) abort() =20 @@ -42,7 +42,7 @@ int abc(TYPE *xyz, Array *array) { return [xyz count] + [array count]; } =20 -@interface Array: Object { +@interface Array: TestsuiteObject { id *arr; int count; } @@ -72,7 +72,7 @@ int abc(TYPE *xyz, Array *array) { @end =20 int main(void) { - CHECK_IF(!strcmp ([@"Object" cString], getDesc())); + CHECK_IF(!strcmp ([@"TestsuiteObject" cString], getDesc= ())); CHECK_IF(!strcmp ([@"Array" cString], getDesc())); =20 Array* a1 =3D [Array arrayWithObjects:@"One", @"Two", @"Three", nil]; Index: obj-c++.dg/defs.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/defs.mm (revision 174696) +++ obj-c++.dg/defs.mm (working copy) @@ -3,13 +3,13 @@ /* { dg-options "" } */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #include =20 extern "C" void abort(void); =20 -@interface A : Object +@interface A : TestsuiteObject { @public int a; @@ -40,4 +40,4 @@ int main() =20=20=20 return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/bitfield-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/bitfield-2.mm (revision 174696) +++ obj-c++.dg/bitfield-2.mm (working copy) @@ -4,12 +4,12 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 #define CHECK_IF(expr) if(!(expr)) abort(); =20 -@interface Base: Object=20 +@interface Base: TestsuiteObject=20 { int full; int full2: 32; @@ -77,4 +77,4 @@ int main(void) { =20 return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/except-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/except-1.mm (revision 174696) +++ obj-c++.dg/except-1.mm (working copy) @@ -9,10 +9,10 @@ =20 #include #include -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 // ObjectiveC class header -@interface ObjCclass : Object { +@interface ObjCclass : TestsuiteObject { } -(void)method1; -(void)method2; @@ -64,4 +64,3 @@ void CPPclass::function1() abort (); } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: obj-c++.dg/ivar-list-semi.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/ivar-list-semi.mm (revision 174696) +++ obj-c++.dg/ivar-list-semi.mm (working copy) @@ -1,9 +1,9 @@ /* Allow for an optional semicolon following the ivar block. */ /* Contributed by: Ziemowit Laski . */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Tink : Object { +@interface Tink : TestsuiteObject { @private unsigned long mCode[4]; }; Index: obj-c++.dg/cxx-scope-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/cxx-scope-2.mm (revision 174696) +++ obj-c++.dg/cxx-scope-2.mm (working copy) @@ -3,11 +3,11 @@ =20 /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" #include #include =20 -@interface iostream: Object +@interface iostream: TestsuiteObject @end =20 int main(void) { Index: obj-c++.dg/selector-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/selector-2.mm (revision 174696) +++ obj-c++.dg/selector-2.mm (working copy) @@ -2,7 +2,7 @@ /* { dg-options "-Wselector" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include =20 @interface Foo @end Index: obj-c++.dg/exceptions-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/exceptions-2.mm (revision 174696) +++ obj-c++.dg/exceptions-2.mm (working copy) @@ -9,10 +9,10 @@ /* This test checks the syntax @catch (...) which catches any exceptions. Check that code using it runs correctly. */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 -@interface MyObject : Object +@interface MyObject : TestsuiteObject @end =20 @implementation MyObject @@ -47,7 +47,7 @@ int main (void) if (test ([MyObject new]) !=3D 5) abort (); =20 - if (test ([Object new]) !=3D 6) + if (test ([TestsuiteObject new]) !=3D 6) abort (); =20 return 0; Index: obj-c++.dg/comp-types-13.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/comp-types-13.mm (revision 174696) +++ obj-c++.dg/comp-types-13.mm (working copy) @@ -1,14 +1,14 @@ /* When assigning function pointers, allow for covariant return types and contravariant argument types. */ /* { dg-do compile } */ -#include +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @class Derived; =20 -Object *ExternFunc (Object *filePath, Object *key); -typedef id FuncSignature (Object *arg1, Derived *arg2); +TestsuiteObject *ExternFunc (TestsuiteObject *filePath, TestsuiteObject *k= ey); +typedef id FuncSignature (TestsuiteObject *arg1, Derived *arg2); =20 -@interface Derived: Object +@interface Derived: TestsuiteObject + (void)registerFunc:(FuncSignature *)function; @end =20 Index: obj-c++.dg/basic.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/basic.mm (revision 174696) +++ obj-c++.dg/basic.mm (working copy) @@ -2,27 +2,10 @@ // { dg-do run } /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -//#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 -#include - -#ifdef __OBJC2__ -@interface Object (ADDITIONS) -+ initialize; -- init; -+ alloc; -+ new; -@end -@implementation Object (ADDITIONS) -+ initialize { return self; } -- init { return self; } -+ alloc { return class_createInstance (self, 0); } -+ new { return [[self alloc] init]; } -@end -#endif - -@interface Greeter : Object +@interface Greeter : TestsuiteObject - (void) greet: (const char *)msg; @end =20 @@ -38,4 +21,4 @@ main () Greeter *obj =3D [Greeter new]; [obj greet: "Hello from Objective-C++"]; } -//#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/isa-field-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/isa-field-1.mm (revision 174696) +++ obj-c++.dg/isa-field-1.mm (working copy) @@ -1,28 +1,34 @@ -/* Ensure there are no bizarre difficulties with accessing the 'isa' field= of - objects. This field is named differently between GNU and NeXT runtimes = so - accessed via the CLASSPTRFIELD() macro defined in next-mapping.h */ +/* Ensure there are no bizarre difficulties with accessing the 'isa' field= of objects. */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include "../objc-obj-c++-shared/runtime.h" =20 -@interface Object (Test) +@interface TestsuiteObject (Test) - (Class) test1: (id)object; @end =20 -@interface Derived: Object +@interface Derived: TestsuiteObject - (Class) test2: (id)object; @end =20 -@implementation Object (Test) +@implementation TestsuiteObject (Test) =20 Class test1(id object) { - Class cls =3D CLASSPTRFIELD(object); - return cls; +#ifdef __NEXT_RUNTIME__ + Class cls =3D object->isa; +#else + Class cls =3D object->class_pointer; +#endif + return cls; } - (Class) test1: (id)object { - Class cls =3D CLASSPTRFIELD(object); - return cls; +#ifdef __NEXT_RUNTIME__ + Class cls =3D object->isa; +#else + Class cls =3D object->class_pointer; +#endif + return cls; } =20 @end @@ -30,18 +36,29 @@ Class test1(id object) { @implementation Derived =20 Class test2(id object) { - Class cls =3D CLASSPTRFIELD(object); - return cls; +#ifdef __NEXT_RUNTIME__ + Class cls =3D object->isa; +#else + Class cls =3D object->class_pointer; +#endif + return cls; } - (Class) test2: (id)object { - Class cls =3D CLASSPTRFIELD(object); - return cls; +#ifdef __NEXT_RUNTIME__ + Class cls =3D object->isa; +#else + Class cls =3D object->class_pointer; +#endif + return cls; } =20 @end =20 Class test3(id object) { - Class cls =3D CLASSPTRFIELD(object); - return cls; +#ifdef __NEXT_RUNTIME__ + Class cls =3D object->isa; +#else + Class cls =3D object->class_pointer; +#endif + return cls; } -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: obj-c++.dg/try-catch-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/try-catch-1.mm (revision 174696) +++ obj-c++.dg/try-catch-1.mm (working copy) @@ -4,14 +4,14 @@ /* { dg-options "-fobjc-exceptions" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" #include #include =20 -@interface Frob: Object +@interface Frob: TestsuiteObject @end =20 -@implementation Frob: Object +@implementation Frob: TestsuiteObject @end =20 static int exc_control =3D 0; Index: obj-c++.dg/local-decl-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/local-decl-1.mm (revision 174696) +++ obj-c++.dg/local-decl-1.mm (working copy) @@ -5,9 +5,9 @@ =20 /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Sprite: Object { +@interface Sprite: TestsuiteObject { int sprite, spree; } + (void)setFoo:(int)foo; Index: obj-c++.dg/encode-4.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/encode-4.mm (revision 174696) +++ obj-c++.dg/encode-4.mm (working copy) @@ -16,23 +16,15 @@ /* Contributed by Ziemowit Laski . */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" +#include "../objc-obj-c++-shared/runtime.h" =20 -#ifdef __NEXT_RUNTIME__ -#define METHOD Method -#else -#include -#define METHOD Method_t -#define method_get_types(M) (M)->method_types -#endif - #include #include =20 #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface Foo: Object +@interface Foo: TestsuiteObject typedef struct { float x, y; } XXPoint; typedef struct { float width, height; } XXSize; typedef struct _XXRect { XXPoint origin; XXSize size; } XXRect; @@ -74,28 +66,28 @@ unsigned offs1, offs2, offs3, offs4, offs5, offs6, =20 int main(void) { Foo *foo =3D [[Foo alloc] init]; - Class fooClass =3D objc_get_class("Foo"); - METHOD meth; + Class fooClass =3D objc_getClass("Foo"); + Method meth; const char *string; =20 - meth =3D class_get_instance_method(fooClass, @selector(setRect:withInt:)= ); + meth =3D class_getInstanceMethod(fooClass, @selector(setRect:withInt:)); offs2 =3D 9999; - sscanf(method_get_types(meth), "@%u@%u:%u{_XXRect=3D{?=3Dff}{?=3Dff}}%ui= %u", &offs1, &offs2, &offs3, + sscanf(method_getTypeEncoding(meth), "@%u@%u:%u{_XXRect=3D{?=3Dff}{?=3Df= f}}%ui%u", &offs1, &offs2, &offs3, &offs4, &offs5); CHECK_IF(!offs2); [foo setRect:my_rect withInt:123]; =20 - meth =3D class_get_instance_method(fooClass, @selector(char:float:double= :long:)); + meth =3D class_getInstanceMethod(fooClass, @selector(char:float:double:l= ong:)); offs2 =3D 9999; if (sizeof (long) =3D=3D 8) string =3D "v%u@%u:%uc%uf%ud%uq%u"; else string =3D "v%u@%u:%uc%uf%ud%ul%u"; - sscanf(method_get_types(meth), string, &offs1, &offs2, &offs3,=20=20 + sscanf(method_getTypeEncoding(meth), string, &offs1, &offs2, &offs3,=20= =20 &offs4, &offs5, &offs6, &offs7); CHECK_IF(!offs2); [foo char:'c' float:2.3 double:3.5 long:2345L]; =20 return 0; }=20=20 -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/method-23.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-23.mm (revision 174696) +++ obj-c++.dg/method-23.mm (working copy) @@ -2,10 +2,9 @@ they should. */ /* { dg-do run } */ /* { dg-options "-O2" } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.mm" } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #include =20 @@ -19,7 +18,7 @@ char *strcpy_like_callee(const char *s) { typedef char io_string_t[512]; typedef char *(func_type)(const char *); =20 -@interface DeviceObject: Object +@interface DeviceObject: TestsuiteObject - (void) func:(func_type)func stucPathInIORegistry:(io_string_t)ioRegPath; @end @implementation DeviceObject Index: obj-c++.dg/try-catch-9.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/try-catch-9.mm (revision 174696) +++ obj-c++.dg/try-catch-9.mm (working copy) @@ -8,7 +8,7 @@ /* { dg-prune-output ".*internal compiler error.*" } */ /* { dg-options "-fobjc-exceptions -O2" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #include =20 @@ -35,13 +35,13 @@ void foo (int arg1, float *arg2) local6 =3D 18.0; pi =3D &gi2; pf =3D &gf2; - obj2 =3D obj1 =3D [Object new]; + obj2 =3D obj1 =3D [TestsuiteObject new]; arg1 =3D 17; arg2 =3D &gf2; =20=20=20=20=20 - @throw [Object new]; + @throw [TestsuiteObject new]; } - @catch (Object *obj) { + @catch (TestsuiteObject *obj) { if (local1 !=3D 123 || local2 !=3D 345 || local3 !=3D 5.0 || local4 !=3D 6.0 || local5 !=3D 17 || local6 !=3D 18.0) { printf("Abort 1\n"); @@ -66,4 +66,4 @@ int main(void) { foo(15, &gf1); return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/method-17.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-17.mm (revision 174696) +++ obj-c++.dg/method-17.mm (working copy) @@ -4,14 +4,14 @@ take place). */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 #define CHECK_IF(expr) if(!(expr)) abort() =20 static double d =3D 4.5920234e2; =20 -@interface Foo : Object +@interface Foo : TestsuiteObject -(void) brokenType: (int)x floatingPoint: (double)y; @end =20 @@ -30,4 +30,4 @@ int main(void) [foo brokenType: (int)d floatingPoint: d]; return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/no-extra-load.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/no-extra-load.mm (revision 174696) +++ obj-c++.dg/no-extra-load.mm (working copy) @@ -2,10 +2,10 @@ =20 // { dg-do compile } =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" #include =20 -@interface Greeter : Object +@interface Greeter : TestsuiteObject - (void) greet: (const char *)msg; @end =20 Index: obj-c++.dg/property/property-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/property/property-1.mm (revision 174696) +++ obj-c++.dg/property/property-1.mm (working copy) @@ -1,11 +1,10 @@ /* This program tests use of property provided setter/getter functions. */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../../objc-obj-c++-shared/Object1.mm" } */ =20 -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.m" =20 -@interface Bar : Object +@interface Bar : TestsuiteObject { int iVar; } Index: obj-c++.dg/selector-5.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/selector-5.mm (revision 174696) +++ obj-c++.dg/selector-5.mm (working copy) @@ -1,7 +1,7 @@ /* { dg-options "" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include =20 int main() { Index: obj-c++.dg/proto-lossage-3.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/proto-lossage-3.mm (revision 174696) +++ obj-c++.dg/proto-lossage-3.mm (working copy) @@ -3,10 +3,12 @@ Problem report and original fix by richard@brainstorm.co.uk. */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.mm" } */ +#include +#include "../objc-obj-c++-shared/runtime.h" =20 -#include "../objc-obj-c++-shared/next-mapping.h" -#include "../objc-obj-c++-shared/Protocol1.h" +@interface MyClass +- name; +@end =20 @protocol NoInstanceMethods + testMethod; @@ -19,16 +21,9 @@ int main() { -#ifdef __OBJC2__ -protocol_getMethodDescription(@protocol(NoInstanceMethods), @selector(name= ), NO, YES); -protocol_getMethodDescription(@protocol(NoInstanceMethods), @selector(name= ), NO, NO); -protocol_getMethodDescription(@protocol(NoClassMethods), @selector(name), = NO, YES); -protocol_getMethodDescription(@protocol(NoClassMethods), @selector(name), = NO, NO); -#else -[@protocol(NoInstanceMethods) descriptionForInstanceMethod: @selector(name= )]; -[@protocol(NoInstanceMethods) descriptionForClassMethod: @selector(name)]; -[@protocol(NoClassMethods) descriptionForInstanceMethod: @selector(name)]; -[@protocol(NoClassMethods) descriptionForClassMethod: @selector(name)]; -#endif +protocol_getMethodDescription (@protocol(NoInstanceMethods), @selector(nam= e), YES, YES); +protocol_getMethodDescription (@protocol(NoInstanceMethods), @selector(nam= e), YES, NO); +protocol_getMethodDescription (@protocol(NoClassMethods), @selector(name),= YES, YES); +protocol_getMethodDescription (@protocol(NoClassMethods), @selector(name),= YES, NO); return 0; } Index: obj-c++.dg/method-12.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-12.mm (revision 174696) +++ obj-c++.dg/method-12.mm (working copy) @@ -3,7 +3,7 @@ /* { dg-options "-Wstrict-selector-match" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Protocol1.h" +#include =20 @interface Base - (unsigned)port; Index: obj-c++.dg/encode-7.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/encode-7.mm (revision 174696) +++ obj-c++.dg/encode-7.mm (working copy) @@ -9,21 +9,13 @@ =20 /* Contributed by Alexander Malmberg */ =20 -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" +#include "../objc-obj-c++-shared/runtime.h" #include #include #define CHECK_IF(expr) if(!(expr)) abort() =20 -#ifdef __NEXT_RUNTIME__ -#define METHOD Method -#else -#include -#define METHOD Method_t -#define method_get_types(M) (M)->method_types -#endif - -@interface Test : Object +@interface Test : TestsuiteObject { float j; } -(void) test2: (int [5])a with: (int [])b; -(id) test3: (Test **)b; /* { dg-message "previous declaration of .\\-\\(i= d\\)test3:\\(Test \\*\\*\\)b." } */ @@ -47,8 +39,8 @@ int offs1, offs2, offs3, offs4, offs5, offs6; =20 int main(int argc, char **argv) { - Class testClass =3D objc_get_class("Test"); - METHOD meth; + Class testClass =3D objc_getClass("Test"); + Method meth; =20 cc[0] =3D [Test new]; CHECK_IF (bb[3] =3D=3D 3); @@ -58,16 +50,16 @@ int main(int argc, char **argv) [*c test2: bb with: bb + 5]; CHECK_IF (bb[3] =3D=3D 5); =20 - meth =3D class_get_instance_method(testClass, @selector(test2:with:)); + meth =3D class_getInstanceMethod(testClass, @selector(test2:with:)); offs1 =3D offs2 =3D offs3 =3D offs4 =3D offs5 =3D offs6 =3D -1; - sscanf(method_get_types(meth), "v%d@%d:%d[%di]%d^i%d", &offs1, &offs2, &= offs3, + sscanf(method_getTypeEncoding(meth), "v%d@%d:%d[%di]%d^i%d", &offs1, &of= fs2, &offs3, &offs4, &offs5, &offs6); CHECK_IF (!offs2 && offs4 =3D=3D 5 && offs3 > 0); CHECK_IF (offs5 =3D=3D 2 * offs3 && offs6 =3D=3D 3 * offs3 && offs1 =3D= =3D 4 * offs3); =20=20=20 - meth =3D class_get_instance_method(testClass, @selector(test3:)); + meth =3D class_getInstanceMethod(testClass, @selector(test3:)); offs1 =3D offs2 =3D offs3 =3D offs4 =3D offs5 =3D offs6 =3D -1; - sscanf(method_get_types(meth), "v%d@%d:%d[%d[%d{Test=3D#f}]]%d", &offs1,= &offs2, &offs3, + sscanf(method_getTypeEncoding(meth), "v%d@%d:%d[%d[%d{Test=3D#f}]]%d", &= offs1, &offs2, &offs3, &offs4, &offs5, &offs6); CHECK_IF (!offs2 && offs4 =3D=3D 3 && offs5 =3D=3D 4 && offs3 > 0); CHECK_IF (offs6 =3D=3D 2 * offs3 && offs1 =3D=3D 3 * offs3); Index: obj-c++.dg/gnu-runtime-3.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/gnu-runtime-3.mm (revision 174696) +++ obj-c++.dg/gnu-runtime-3.mm (working copy) @@ -4,10 +4,10 @@ /* { dg-do run } */ /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */ =20 -#include +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 -@interface FooBar: Object +@interface FooBar: TestsuiteObject - (void)boo; @end =20 Index: obj-c++.dg/try-catch-11.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/try-catch-11.mm (revision 174696) +++ obj-c++.dg/try-catch-11.mm (working copy) @@ -4,7 +4,7 @@ /* { dg-options "-fobjc-exceptions" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @protocol Proto1 - (int)meth1; @@ -14,11 +14,11 @@ - (int)meth2; @end =20 -@interface MyClass: Object { +@interface MyClass: TestsuiteObject { int a; } - (int)meth2; -- (Object *)parm1: (id)p1 parm2: (id)p2; +- (TestsuiteObject *)parm1: (id)p1 parm2: (id)p2; @end =20 MyClass *mc1, *mc2; @@ -27,7 +27,7 @@ MyClass *mc1, *mc2; - (int)meth2 { return a; } -- (Object *)parm1: (id)p1 parm2: (id)p2 { +- (TestsuiteObject *)parm1: (id)p1 parm2: (id)p2 { @try { mc2 =3D p2; /* { dg-warning "type .id . does not conform to = the .Proto2. protocol" } */ } Index: obj-c++.dg/comp-types-11.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/comp-types-11.mm (revision 174696) +++ obj-c++.dg/comp-types-11.mm (working copy) @@ -1,22 +1,22 @@ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @protocol Foo - (id)meth1; - (id)meth2:(int)arg; @end =20 -@interface Derived1: Object +@interface Derived1: TestsuiteObject @end =20 -@interface Derived2: Object +@interface Derived2: TestsuiteObject + (Derived1 *)new; @end =20 id func(void) { - Object *o =3D [Object new]; - return o; /* { dg-warning "class .Object. does not implement the .Foo. = protocol" } */ + TestsuiteObject *o =3D [TestsuiteObject new]; + return o; /* { dg-warning "class .TestsuiteObject. does not implement t= he .Foo. protocol" } */ } =20 @implementation Derived2 Index: obj-c++.dg/method-6.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-6.mm (revision 174696) +++ obj-c++.dg/method-6.mm (working copy) @@ -3,7 +3,7 @@ =20 /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @class NotKnown; =20 Index: obj-c++.dg/fsf-package-0.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/fsf-package-0.m (revision 174696) +++ obj-c++.dg/fsf-package-0.m (working copy) @@ -1,9 +1,8 @@ /* { dg-do compile } */ =20 -#import "../objc-obj-c++-shared/Object1.h" -#include +#import "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object +@interface obj : TestsuiteObject { @public int v1; Index: obj-c++.dg/torture/tls/thr-init-3.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/torture/tls/thr-init-3.mm (revision 174696) +++ obj-c++.dg/torture/tls/thr-init-3.mm (working copy) @@ -2,14 +2,13 @@ /* { dg-require-effective-target tls } */ /* { dg-add-options tls } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.mm" } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" extern "C" { extern void abort (); } =20 -@interface tsObj: Object { +@interface tsObj: TestsuiteObject { int ai ; } =20 Index: obj-c++.dg/torture/trivial.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/torture/trivial.mm (revision 174696) +++ obj-c++.dg/torture/trivial.mm (working copy) @@ -1,12 +1,11 @@ // { dg-do run } =20 // { dg-xfail-run-if "OBJC2 runtime" { *-*-darwin* && { lp64 && { ! objc2 = } } } { "-fnext-runtime" } { "-fgnu-runtime" } } -// { dg-additional-sources "../../objc-obj-c++-shared/Object1.mm" } =20 -#import "../../objc-obj-c++-shared/Object1.h" +#import "../../objc-obj-c++-shared/TestsuiteObject.m" =20 int main(void) { - [Object class]; + [TestsuiteObject class]; return 0; } Index: obj-c++.dg/torture/strings/string1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/torture/strings/string1.mm (revision 174696) +++ obj-c++.dg/torture/strings/string1.mm (working copy) @@ -3,11 +3,8 @@ /* { dg-do run } */ /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.mm ../../= ../objc-obj-c++-shared/nsconstantstring-class-impl.mm" } */ +/* { dg-additional-sources "../../../objc-obj-c++-shared/nsconstantstring-= class-impl.mm" } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" -#include "../../../objc-obj-c++-shared/next-mapping.h" - #include #include =20 Index: obj-c++.dg/torture/strings/const-str-10.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/torture/strings/const-str-10.mm (revision 174696) +++ obj-c++.dg/torture/strings/const-str-10.mm (working copy) @@ -6,7 +6,8 @@ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include +#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW= _INTERFACE. */ =20 @interface NSString: Object @end Index: obj-c++.dg/torture/strings/const-str-11.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/torture/strings/const-str-11.mm (revision 174696) +++ obj-c++.dg/torture/strings/const-str-11.mm (working copy) @@ -7,7 +7,8 @@ /* { dg-options "-fconstant-string-class=3DXStr" } */ /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=3DXStr" {= target *-*-darwin* } } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include +#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW= _INTERFACE. */ =20 @interface XString: Object { @protected Index: obj-c++.dg/torture/strings/const-str-7.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/torture/strings/const-str-7.mm (revision 174696) +++ obj-c++.dg/torture/strings/const-str-7.mm (working copy) @@ -5,28 +5,29 @@ /* { dg-do run } */ /* { dg-options "-fconstant-string-class=3DFoo" } */ /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=3DFoo" { = target *-*-darwin* } } */ -/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.mm" } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" #include #include #include #include =20 -@interface Foo: Object { +@interface Foo: TestsuiteObject { char *cString; unsigned int len; } - (char *)customString; @end =20 +#ifdef __NEXT_RUNTIME__ #ifdef NEXT_OBJC_USE_NEW_INTERFACE Class _FooClassReference; #else struct objc_class _FooClassReference; #endif +#endif =20 -@implementation Foo : Object +@implementation Foo : TestsuiteObject - (char *)customString { return cString; } Index: obj-c++.dg/torture/strings/const-str-8.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/torture/strings/const-str-8.mm (revision 174696) +++ obj-c++.dg/torture/strings/const-str-8.mm (working copy) @@ -4,24 +4,25 @@ /* { dg-do run { target *-*-darwin* } } */ /* { dg-options "-fconstant-string-class=3DFoo" } */ /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=3DFoo" { = target *-*-darwin* } } */ -/* { dg-additional-sources "../../../objc-obj-c++-shared/Object1.mm" } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include "../../../objc-obj-c++-shared/TestsuiteObject.m" #include =20 -@interface Foo: Object { +@interface Foo: TestsuiteObject { char *cString; unsigned int len; } @end =20 +#ifdef __NEXT_RUNTIME__ #ifdef NEXT_OBJC_USE_NEW_INTERFACE Class _FooClassReference; #else struct objc_class _FooClassReference; #endif +#endif =20 -@implementation Foo : Object +@implementation Foo : TestsuiteObject - (char *)customString { return cString; } Index: obj-c++.dg/torture/strings/const-str-9.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/torture/strings/const-str-9.mm (revision 174696) +++ obj-c++.dg/torture/strings/const-str-9.mm (working copy) @@ -5,7 +5,8 @@ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ =20 -#include "../../../objc-obj-c++-shared/Object1.h" +#include +#include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW= _INTERFACE. */ =20 @interface NSConstantString: Object { char *cString; Index: obj-c++.dg/method-21.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-21.mm (revision 174696) +++ obj-c++.dg/method-21.mm (working copy) @@ -2,9 +2,9 @@ /* { dg-do compile } */ /* { dg-options "-Wreturn-type -Wextra" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Foo: Object +@interface Foo: TestsuiteObject - (id) meth1; - (void) meth2; @end @@ -14,7 +14,7 @@ extern int bar; @implementation Foo - (id) meth1 { if (bar) - return [Object new]; + return [TestsuiteObject new]; return; /* { dg-error "return.statement with no value" } */ } - (void) meth2 { Index: obj-c++.dg/super-class-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/super-class-2.mm (revision 174696) +++ obj-c++.dg/super-class-2.mm (working copy) @@ -4,11 +4,11 @@ =20 /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @class MyWpModule; =20 -@compatibility_alias MyObject Object; +@compatibility_alias MyObject TestsuiteObject; @compatibility_alias FictitiousModule MyWpModule; =20 @protocol MySelTarget Index: obj-c++.dg/try-catch-7.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/try-catch-7.mm (revision 174696) +++ obj-c++.dg/try-catch-7.mm (working copy) @@ -1,17 +1,17 @@ /* { dg-do compile } */ /* { dg-options "-fobjc-exceptions" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 int main (int argc, const char * argv[]) { - Object * pool =3D [Object new]; + TestsuiteObject * pool =3D [TestsuiteObject new]; int a; =20 if ( 1 ) { @try { a =3D 1; } - @catch (Object *e) { + @catch (TestsuiteObject *e) { a =3D 2; } @finally { Index: obj-c++.dg/method-15.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-15.mm (revision 174696) +++ obj-c++.dg/method-15.mm (working copy) @@ -3,10 +3,10 @@ /* { dg-options "-Wstrict-selector-match" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 @protocol MyObject -- (id)initWithData:(Object *)data; +- (id)initWithData:(TestsuiteObject *)data; @end =20 @protocol SomeOther @@ -17,9 +17,9 @@ - (id)initWithData:(id)data; @end =20 -@interface NTGridDataObject: Object +@interface NTGridDataObject: TestsuiteObject { - Object *_data; + TestsuiteObject *_data; } + (NTGridDataObject*)dataObject:(id)data; @end @@ -32,7 +32,7 @@ { NTGridDataObject *result =3D [[NTGridDataObject alloc] initWithData:da= ta]; /* { dg-warning "multiple methods named .\\-initWithData:. found" "" = { target *-*-* } 33 } */ - /* { dg-message "using .\\-\\(id\\)initWithData:\\(Object \\*\\)data.= " "" { target *-*-* } 9 } */ + /* { dg-message "using .\\-\\(id\\)initWithData:\\(TestsuiteObject \\= *\\)data." "" { target *-*-* } 9 } */ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(id \\)data." "" { target *-*-* } 17 } */ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(int\\)data." = "" { target *-*-* } 13 } */ =20 Index: obj-c++.dg/layout-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/layout-1.mm (revision 174696) +++ obj-c++.dg/layout-1.mm (working copy) @@ -3,13 +3,13 @@ /* { dg-do compile } */ /* { dg-options "-Wpadded -Wpacked -Wabi" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Derived1: Object +@interface Derived1: TestsuiteObject { } @end =20 -@interface Derived2: Object +@interface Derived2: TestsuiteObject - (id) foo; @end =20 Index: obj-c++.dg/attributes/method-attribute-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/attributes/method-attribute-1.mm (revision 174696) +++ obj-c++.dg/attributes/method-attribute-1.mm (working copy) @@ -1,9 +1,9 @@ /* { dg-do compile } */ =20 #include -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object { +@interface obj : TestsuiteObject { @public=20 int var;=20 }=20 Index: obj-c++.dg/attributes/method-attribute-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/attributes/method-attribute-2.mm (revision 174696) +++ obj-c++.dg/attributes/method-attribute-2.mm (working copy) @@ -1,9 +1,9 @@ /* { dg-do compile } */ =20 #include -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object { +@interface obj : TestsuiteObject { @public=20 int var;=20 }=20 Index: obj-c++.dg/attributes/method-attribute-3.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/attributes/method-attribute-3.mm (revision 174696) +++ obj-c++.dg/attributes/method-attribute-3.mm (working copy) @@ -1,8 +1,8 @@ /* { dg-do compile } */ =20 -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object { +@interface obj : TestsuiteObject { @public=20 int var; } Index: obj-c++.dg/attributes/categ-attribute-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/attributes/categ-attribute-1.mm (revision 174696) +++ obj-c++.dg/attributes/categ-attribute-1.mm (working copy) @@ -1,9 +1,9 @@ /* { dg-do compile } */ =20 #include -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object {=20 +@interface obj : TestsuiteObject {=20 @public=20 int var;=20 }=20 Index: obj-c++.dg/attributes/categ-attribute-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/attributes/categ-attribute-2.mm (revision 174696) +++ obj-c++.dg/attributes/categ-attribute-2.mm (working copy) @@ -1,9 +1,9 @@ /* { dg-do compile } */ =20 #include -#include "../../objc-obj-c++-shared/Object1.h" +#include "../../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface obj : Object {=20 +@interface obj : TestsuiteObject {=20 @public=20 int var;=20 }=20 Index: obj-c++.dg/strings/strings-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/strings/strings-1.mm (revision 174696) +++ obj-c++.dg/strings/strings-1.mm (working copy) @@ -1,8 +1,7 @@ /* Contributed by Nicola Pero , November = 2010. */ /* { dg-do compile } */ =20 -#include "../../objc-obj-c++-shared/Object1.h" -#include "../../objc-obj-c++-shared/next-mapping.h" +#include "../../objc-obj-c++-shared/runtime.h" #ifndef __NEXT_RUNTIME__ #include #endif @@ -30,4 +29,4 @@ id test_invalid7 =3D @"te" @"s" @@"t"; / id test_invalid8 =3D @"te" @@"s" @"t"; /* { dg-error "repeated= .@. before Objective-C string" } */ id test_invalid9 =3D @"te" @"s" @"t" @; /* { dg-error "stray .@= . in program" } */ id test_invalidA =3D @"te" @ st; /* { dg-error "stray .@= . in program" } */ - /* { dg-error "expected" = "" { target *-*-* } 32 } */ + /* { dg-error "expected" = "" { target *-*-* } 31 } */ Index: obj-c++.dg/strings/const-str-12.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/strings/const-str-12.mm (revision 174696) +++ obj-c++.dg/strings/const-str-12.mm (working copy) @@ -5,7 +5,8 @@ /* { dg-options "-fconstant-string-class=3DFoo" } */ /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=3DFoo" { = target *-*-darwin* } } */ =20 -#include "../../objc-obj-c++-shared/Object1.h" +#include +#include "../../objc-obj-c++-shared/objc-test-suite-types.h" =20 @interface Foo: Object { char *cString; @@ -18,11 +19,7 @@ + (Foo *) getString: (int) which; @end =20 -#ifdef NEXT_OBJC_USE_NEW_INTERFACE -Class _FooClassReference; -#else -struct objc_class _FooClassReference; -#endif +TNS_STRING_REF_T _FooClassReference; /* Only used by NeXT. */ =20 @implementation Bar + (Foo *) getString: (int) which { Index: obj-c++.dg/cxx-ivars-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/cxx-ivars-1.mm (revision 174696) +++ obj-c++.dg/cxx-ivars-1.mm (working copy) @@ -3,7 +3,7 @@ // { dg-options "-fno-objc-call-cxx-cdtors" } // { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } }=20 =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #define CHECK_IF(expr) if(!(expr)) abort() =20 @@ -17,7 +17,7 @@ struct cxx_struct { } }; =20 -@interface Manip : Object { +@interface Manip : TestsuiteObject { int c; cxx_struct s; // { dg-warning "user-defined destructor" } // { dg-warning "constructors and destructors will not b= e invoked" "" { target *-*-* } 22 } @@ -40,4 +40,4 @@ int main (void) [obj manipulate_ivars]; [obj free]; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/threedotthree-abi-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/threedotthree-abi-1.mm (revision 174696) +++ obj-c++.dg/threedotthree-abi-1.mm (working copy) @@ -6,14 +6,10 @@ =20 #include #include -#include "../objc-obj-c++-shared/Protocol1.h" -#ifndef __NEXT_RUNTIME__ -#include -#endif +#include "../objc-obj-c++-shared/runtime.h" =20 extern "C" void abort(); =20 - @protocol CommonProtocol =20 -(oneway void)methodCall_On:(in bycopy id)someValue_On; @@ -48,25 +44,32 @@ extern "C" void abort(); =20 Protocol *proto =3D @protocol(CommonProtocol); struct objc_method_description *meth; +struct objc_method_description meth_object; =20 int main() { - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _On:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_On:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4On@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _nO:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_nO:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4nO@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _Oo:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_Oo:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4Oo@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _oO:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_oO:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4oO@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _rn:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_rn:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4rn@8")) abort(); - meth =3D [proto descriptionForInstanceMethod: @selector(methodCall= _oOn:)]; + meth_object =3D protocol_getMethodDescription (proto, @selector(me= thodCall_oOn:), YES, YES); + meth =3D &meth_object; if (strcmp (meth->types, "Vv12@0:4oOn@8")) abort(); return 0; Index: obj-c++.dg/try-catch-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/try-catch-2.mm (revision 174696) +++ obj-c++.dg/try-catch-2.mm (working copy) @@ -4,10 +4,10 @@ =20 /* { dg-do run } */ /* { dg-xfail-run-if "PR23616" { *-*-* } { "-fgnu-runtime" } { "-fnext-run= time" } } */ -/* { dg-xfail-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } = } } { "-fnext-runtime" "-fgnu-runtime" } { "" } }=20 +/* { dg-xfail-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } = } } { "-fnext-runtime" "-fgnu-runtime" } { "" } } */ /* { dg-options "-fobjc-exceptions" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #include =20 @@ -18,10 +18,10 @@ =20 #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface Frob: Object +@interface Frob: TestsuiteObject @end =20 -@implementation Frob: Object +@implementation Frob: TestsuiteObject @end =20 static Frob* _connection =3D nil; @@ -29,7 +29,7 @@ static Frob* _connection =3D nil; //-------------------------------------------------------------------- =20 =20 -void test (Object* sendPort) +void test (TestsuiteObject* sendPort) { int cleanupPorts =3D 1; Frob* receivePort =3D nil; @@ -56,7 +56,7 @@ static Frob* _connection =3D nil; printf ("cleanupPorts =3D %d\n", cleanupPorts); printf ("---\n");=09=09 =20=09=09 - @throw [Object new]; + @throw [TestsuiteObject new]; } @catch(Frob *obj) { printf ("Exception caught by incorrect handler!\n"); @@ -75,7 +75,7 @@ static Frob* _connection =3D nil; } =20 int main (void) { - test((Object *)-1); + test((TestsuiteObject *)-1); return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/method-10.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-10.mm (revision 174696) +++ obj-c++.dg/method-10.mm (working copy) @@ -3,17 +3,17 @@ /* { dg-options "" } */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface Int1: Object +@interface Int1: TestsuiteObject + (int) classMeth; - (int) instanceMeth; @end =20 -@interface Int2: Object +@interface Int2: TestsuiteObject + (int) classMeth;=20=20=20=20=20=20 - (int) instanceMeth; @end @@ -43,4 +43,4 @@ int main(void) { CHECK_IF([(Int1Alias *)int2typedef instanceMeth] =3D=3D 1697); return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/encode-5.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/encode-5.mm (revision 174696) +++ obj-c++.dg/encode-5.mm (working copy) @@ -2,26 +2,19 @@ /* Contributed by Ziemowit Laski . */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" -#include "../objc-obj-c++-shared/Protocol1.h" + +#include +#include + +#include "../objc-obj-c++-shared/runtime.h" +#include + #ifdef __cplusplus #define ProtoBool bool #else #define ProtoBool _Bool #endif =20 -#ifdef __NEXT_RUNTIME__ -#define METHOD Method -#else -#include -#define METHOD Method_t -#define method_get_types(M) (M)->method_types -#endif - -#include -#include - #define CHECK_IF(expr) if(!(expr)) abort() =20 enum Enum { @@ -43,7 +36,7 @@ typedef struct _XXRect { XXPoint origin; XXSize si =20 Protocol *proto =3D @protocol(Proto); struct objc_method_description *meth; - +struct objc_method_description meth_object; unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7; =20 static void scan_initial(const char *pattern) { @@ -56,7 +49,9 @@ static void scan_initial(const char *pattern) { int main(void) { const char *string; =20 - meth =3D [proto descriptionForInstanceMethod: @selector(char:float:doubl= e:unsigned:short:long:)]; + meth_object =3D protocol_getMethodDescription (proto, + @selector(char:float:double:unsigned:short:long:), YES, YES); + meth =3D &meth_object; if (sizeof (long) =3D=3D 8) string =3D "v%u@%u:%uc%uf%ud%uI%us%uq%u"; else @@ -65,11 +60,16 @@ int main(void) { CHECK_IF(offs3 =3D=3D offs2 + sizeof(int) && offs4 =3D=3D offs3 + sizeof= (float)); CHECK_IF(offs5 =3D=3D offs4 + sizeof(double) && offs6 =3D=3D offs5 + siz= eof(unsigned)); CHECK_IF(offs7 =3D=3D offs6 + sizeof(int) && totsize =3D=3D offs7 + size= of(long)); - meth =3D [proto descriptionForInstanceMethod: @selector(setRect:withBool= :withInt:)]; + meth_object =3D protocol_getMethodDescription (proto, + @selector(setRect:withBool:withInt:), YES, YES); + meth =3D &meth_object; scan_initial("^v%u@%u:%u{_XXRect=3D{?=3Dff(__XXAngle=3DII)}{?=3Ddd}^{_XX= Rect}}%uB%ui%u"); CHECK_IF(offs3 =3D=3D offs2 + sizeof(XXRect) && offs4 =3D=3D offs3 + siz= eof(int)); CHECK_IF(totsize =3D=3D offs4 + sizeof(int)); - meth =3D [proto descriptionForClassMethod: @selector(getEnum:enum:bool:)= ]; + meth_object =3D protocol_getMethodDescription (proto, + @selector(getEnum:enum:bool:), YES, NO); + meth =3D &meth_object;=20 + /* Here we have the complication that 'enum Enum' could be encoded as 'i' on __NEXT_RUNTIME_, and (most likely) as 'I' on the GNU runtime. So we get the @encode(enum Enum), then put it into the @@ -80,16 +80,17 @@ int main(void) { char pattern[1024]; =20 sprintf (pattern, "^%s%%u@%%u:%%u^{?=3Dff(__XXAngle=3DII)}%%u%s%%uc%%u= ", - @encode(enum Enum), @encode(enum Enum)); + @encode(enum Enum), @encode(enum Enum)); scan_initial(pattern); } =20 - CHECK_IF(offs3 =3D=3D offs2 + sizeof(XXPoint *) && offs4 =3D=3D offs3 + = sizeof(enum Enum)); CHECK_IF(totsize =3D=3D offs4 + sizeof(int)); /* 'ObjCBool' is really '= char' */ - meth =3D [proto descriptionForClassMethod: @selector(getBool:)];=20=20= =20=20=20=20=20=20=20 + meth_object =3D protocol_getMethodDescription (proto, + @selector(getBool:), YES, NO); + meth =3D &meth_object; scan_initial("^^B%u@%u:%u^*%u"); CHECK_IF(totsize =3D=3D offs2 + sizeof(ObjCBool **)); return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/va-meth-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/va-meth-1.mm (revision 174696) +++ obj-c++.dg/va-meth-1.mm (working copy) @@ -2,13 +2,13 @@ =20 /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #include =20 /* Test methods with "C-style" trailing arguments, with or without ellipsi= s. */ =20 -@interface MathClass: Object +@interface MathClass: TestsuiteObject /* sum positive numbers; -1 ends the list */ + (int) sum: (int) firstNumber, int secondNumber, ...; + (int) prod: (int) firstNumber, int secondNumber, int thirdNumber; @@ -72,4 +72,4 @@ int main (void) =20=20=20 return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/objc-gc-3.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/objc-gc-3.mm (revision 174696) +++ obj-c++.dg/objc-gc-3.mm (working copy) @@ -6,11 +6,12 @@ /* { dg-options "-fobjc-gc" } */ /* { dg-prune-output "cc1objplus: warning: '-fobjc-gc' is ignored for '-fg= nu-runtime'" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include "../objc-obj-c++-shared/runtime.h" =20 @class MyWindow; =20 -@interface MyDocument : Object { +@interface MyDocument : TestsuiteObject { MyWindow *_window; } @end @@ -29,7 +30,7 @@ @end =20 @interface MyTextFileDocument : MyFileDocument { - Object *_textStorage; + TestsuiteObject *_textStorage; struct __tfdFlags { unsigned int immutable:1; unsigned int lineEnding:2; Index: obj-c++.dg/fix-and-continue-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/fix-and-continue-2.mm (revision 174696) +++ obj-c++.dg/fix-and-continue-2.mm (working copy) @@ -6,18 +6,18 @@ /* { dg-do assemble { target *-*-darwin* } } */ /* { dg-options "-mfix-and-continue" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Foo: Object -+ (Object *)indexableFileTypes; +@interface Foo: TestsuiteObject ++ (TestsuiteObject *)indexableFileTypes; @end =20 @implementation Foo -+ (Object *)indexableFileTypes ++ (TestsuiteObject *)indexableFileTypes { - static Object *fileTypes =3D 0; + static TestsuiteObject *fileTypes =3D 0; if(!fileTypes) { - fileTypes =3D [Object new]; + fileTypes =3D [TestsuiteObject new]; } return fileTypes; } Index: obj-c++.dg/lookup-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/lookup-2.mm (revision 174696) +++ obj-c++.dg/lookup-2.mm (working copy) @@ -1,6 +1,6 @@ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 class MyWidget { @@ -15,13 +15,13 @@ MyWidget gWidget; - (MyWidget *)widget; @end =20 -@interface Foo: Object +@interface Foo: TestsuiteObject @end =20 @interface Bar: Foo @end =20 -@interface Container: Object +@interface Container: TestsuiteObject + (MyWidget *)elementForView:(Foo *)view; @end =20 @@ -38,7 +38,8 @@ MyWidget gWidget; + (MyWidget *)elementForView:(Foo *)view { MyWidget *widget =3D 0; - if ([view conformsTo:@protocol(MyProto)]) { + if (class_conformsToProtocol (object_getClass (view), + @protocol(MyProto))) { widget =3D [(Foo *)view widget]; } return widget; @@ -55,4 +56,3 @@ int main(void) { return 0; } =20 -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: obj-c++.dg/gnu-runtime-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/gnu-runtime-1.mm (revision 174696) +++ obj-c++.dg/gnu-runtime-1.mm (working copy) @@ -4,9 +4,9 @@ /* { dg-do compile } */ /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */ =20 -#include +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface FooBar: Object +@interface FooBar: TestsuiteObject - (void)boo; @end =20 Index: obj-c++.dg/template-3.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/template-3.mm (revision 174696) +++ obj-c++.dg/template-3.mm (working copy) @@ -4,12 +4,12 @@ =20 /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface ObjCClass : Object +@interface ObjCClass : TestsuiteObject { @public int info; @@ -78,4 +78,4 @@ int main(void) { =20=20=20 return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/bitfield-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/bitfield-1.mm (revision 174696) +++ obj-c++.dg/bitfield-1.mm (working copy) @@ -9,7 +9,7 @@ =20 /* Leave blank lines here to keep warnings on the same lines. */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #include =20 @@ -17,7 +17,7 @@ =20 enum Enum { zero, one, two, three, four }; =20 -@interface Base: Object { +@interface Base: TestsuiteObject { @public unsigned a: 2; int b: 3; Index: obj-c++.dg/selector-6.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/selector-6.mm (revision 174696) +++ obj-c++.dg/selector-6.mm (working copy) @@ -1,7 +1,7 @@ /* { dg-options "" } */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include =20 int main() { Index: obj-c++.dg/set-not-used-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/set-not-used-1.mm (revision 174696) +++ obj-c++.dg/set-not-used-1.mm (working copy) @@ -2,10 +2,9 @@ /* { dg-do compile } */ /* { dg-options "-Wunused-but-set-variable" } */ =20 -#import "../objc-obj-c++-shared/Object1.h" -#include +#import "../objc-obj-c++-shared/TestsuiteObject.m" =20 -@interface obj : Object +@interface obj : TestsuiteObject { int value; } @@ -13,7 +12,7 @@ - (void) setValue: (int)number; @end =20 -@implementation obj : Object +@implementation obj : TestsuiteObject =20 - (int) value { return value; } - (void) setValue: (int)number { value =3D number; } Index: obj-c++.dg/method-13.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-13.mm (revision 174696) +++ obj-c++.dg/method-13.mm (working copy) @@ -1,11 +1,11 @@ /* Check if finding multiple signatures for a method is handled gracefully= . Author: Ziemowit Laski */ /* { dg-options "-Wstrict-selector-match" } */ /* { dg-do compile } */ +#include +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -#include "../objc-obj-c++-shared/Object1.h" - @interface Class1 -- (void)setWindow:(Object *)wdw; +- (void)setWindow:(TestsuiteObject *)wdw; @end =20 @interface Class2 @@ -13,14 +13,14 @@ @end =20 id foo(void) { - Object *obj =3D [[Object alloc] init]; + TestsuiteObject *obj =3D [[TestsuiteObject alloc] init]; id obj2 =3D obj; - [obj setWindow:nil]; /* { dg-warning ".Object. may not respond to .\\-s= etWindow:." } */ + [obj setWindow:nil]; /* { dg-warning ".TestsuiteObject. may not respond= to .\\-setWindow:." } */ /* { dg-warning "Messages without a matching method signature" "" {= target *-*-* } 18 } */ /* { dg-warning "will be assumed to return .id. and accept" "" { ta= rget *-*-* } 18 } */ /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 18 } */ [obj2 setWindow:nil]; /* { dg-warning "multiple methods named .\\-setWin= dow:. found" } */ - /* { dg-message "using .\\-\\(void\\)setWindow:\\(Object \\*\\)wdw.= " "" { target *-*-* } 8 } */ + /* { dg-message "using .\\-\\(void\\)setWindow:\\(TestsuiteObject \= \*\\)wdw." "" { target *-*-* } 8 } */ /* { dg-message "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\= )window." "" { target *-*-* } 12 } */ =20 return obj; Index: obj-c++.dg/proto-qual-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/proto-qual-1.mm (revision 174696) +++ obj-c++.dg/proto-qual-1.mm (working copy) @@ -6,10 +6,7 @@ =20 #include #include -#ifndef __NEXT_RUNTIME__ -#include -#endif -#include "../objc-obj-c++-shared/next-mapping.h" +#include "../objc-obj-c++-shared/runtime.h" #include =20 /* The encoded parameter sizes will be rounded up to match pointer alignme= nt. */ @@ -34,9 +31,7 @@ =20 Protocol *proto; struct objc_method_description *meth; -#ifdef NEXT_OBJC_USE_NEW_INTERFACE struct objc_method_description meth_object; -#endif unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7; =20 static void scan_initial(const char *pattern) { @@ -48,22 +43,18 @@ static void scan_initial(const char *pattern) { =20 int main(void) { proto =3D @protocol(Retain); -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - meth_object =3D protocol_getMethodDescription (proto, @selector(address:= with:), - YES, YES); + + meth_object =3D protocol_getMethodDescription (proto, + @selector(address:with:), YES, YES); meth =3D &meth_object; -#else - meth =3D [proto descriptionForInstanceMethod: @selector(address:with:)]; -#endif + scan_initial("O@%u@%u:%uNR@%uo^^S%u"); CHECK_IF(offs3 =3D=3D offs2 + aligned_sizeof(id) && totsize =3D=3D offs3= + aligned_sizeof(unsigned)); -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - meth_object =3D protocol_getMethodDescription (proto, @selector(retainA= rgument:with:), - YES, NO); + + meth_object =3D protocol_getMethodDescription (proto, + @selector(retainArgument:with:), YES, NO); meth =3D &meth_object; -#else - meth =3D [proto descriptionForClassMethod: @selector(retainArgument:with= :)]; -#endif + scan_initial("Vv%u@%u:%uOo@%un^*%u"); CHECK_IF(offs3 =3D=3D offs2 + aligned_sizeof(id) && totsize =3D=3D offs3= + aligned_sizeof(char **)); return 0; Index: obj-c++.dg/class-protocol-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/class-protocol-1.mm (revision 174696) +++ obj-c++.dg/class-protocol-1.mm (working copy) @@ -3,7 +3,7 @@ /* { dg-do compile } */ =20 #include -#include +#include "../objc-obj-c++-shared/runtime.h" =20 @protocol MyProto1 +(void)doItClass1; Index: obj-c++.dg/qual-types-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/qual-types-1.mm (revision 174696) +++ obj-c++.dg/qual-types-1.mm (working copy) @@ -4,7 +4,7 @@ =20 /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 #define CHECK_IF(expr) if(!(expr)) abort() @@ -19,7 +19,7 @@ - init;=20 @end =20 -@interface Foo: Object +@interface Foo: TestsuiteObject { @public int val; } - init; @end @@ -37,7 +37,7 @@ template struct Holder Holder(void) { obj =3D [[T alloc] init]; } ~Holder(void) { [obj free]; --counter; } id getObjId(void) { return obj; } - Object *getObj(void) { return obj; } + TestsuiteObject *getObj(void) { return obj; } }; =20 typedef Holder > FooHolder; @@ -66,4 +66,4 @@ int main (void) { CHECK_IF(FooHolder::counter =3D=3D 0); return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/cxx-scope-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/cxx-scope-1.mm (revision 174696) +++ obj-c++.dg/cxx-scope-1.mm (working copy) @@ -3,7 +3,7 @@ =20 /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 @class Derived; @@ -18,7 +18,7 @@ Derived *CxxClass::get_instance(int offs) { return inst[offs]; } =20 -@interface Derived: Object { +@interface Derived: TestsuiteObject { int value; } -(id)initWithValue:(int)val; @@ -51,4 +51,4 @@ int main(void) { =20 return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/sync-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/sync-2.mm (revision 174696) +++ obj-c++.dg/sync-2.mm (working copy) @@ -1,13 +1,13 @@ /* Make sure that @synchronized parses and a very basic test runs. */ /* { dg-options "-fobjc-exceptions -fgnu-runtime" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 int main (void) { - Object *a =3D [Object new]; - Object *b =3D [Object new]; - Object *c =3D [Object new]; + TestsuiteObject *a =3D [TestsuiteObject new]; + TestsuiteObject *b =3D [TestsuiteObject new]; + TestsuiteObject *c =3D [TestsuiteObject new]; =20 /* This single-threaded test just checks that @synchronized() uses a recursive mutex, and that the runtime at least doesn't crash Index: obj-c++.dg/comp-types-12.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/comp-types-12.mm (revision 174696) +++ obj-c++.dg/comp-types-12.mm (working copy) @@ -1,10 +1,10 @@ /* { dg-do compile } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Derived: Object +@interface Derived: TestsuiteObject @end =20 -extern Object* foo(void); +extern TestsuiteObject* foo(void); static Derived *test(void) { Derived *m =3D foo(); /* { dg-warning "initialization from distinct O= bjective\\-C type" } */ Index: obj-c++.dg/bitfield-4.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/bitfield-4.mm (revision 174696) +++ obj-c++.dg/bitfield-4.mm (working copy) @@ -4,7 +4,7 @@ /* { dg-do run } */ /* { dg-options "-Wpadded" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" =20 #include #include @@ -13,7 +13,7 @@ =20 enum Enum { one, two, three, four }; =20 -@interface Base: Object { +@interface Base: TestsuiteObject { unsigned a: 2; int b: 3; enum Enum c: 4; Index: obj-c++.dg/method-22.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-22.mm (revision 174696) +++ obj-c++.dg/method-22.mm (working copy) @@ -1,15 +1,14 @@ /* Ensure that overload resolution does not produce warnings as side-effects. */ /* { dg-do run } */ -/* { dg-additional-sources "../objc-obj-c++-shared/Object1.mm" } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 #define CHECK_IF(E) if(!(E)) abort () =20 -@interface MyCursor: Object +@interface MyCursor: TestsuiteObject + (MyCursor *)crosshairCursor; @end =20 Index: obj-c++.dg/try-catch-8.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/try-catch-8.mm (revision 174696) +++ obj-c++.dg/try-catch-8.mm (working copy) @@ -3,9 +3,9 @@ /* { dg-do compile } */ /* { dg-options "-fobjc-exceptions" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface Derived: Object +@interface Derived: TestsuiteObject - (id) meth; @end =20 Index: obj-c++.dg/template-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/template-1.mm (revision 174696) +++ obj-c++.dg/template-1.mm (working copy) @@ -3,12 +3,12 @@ =20 /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include =20 #define CHECK_IF(expr) if(!(expr)) abort() =20 -@interface Base: Object +@interface Base: TestsuiteObject - (int) meth; @end =20 @@ -47,4 +47,4 @@ int main (void) { CHECK_IF(count =3D=3D 0); return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/method-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-2.mm (revision 174696) +++ obj-c++.dg/method-2.mm (working copy) @@ -4,7 +4,8 @@ =20 /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include "../objc-obj-c++-shared/runtime.h" =20 @class NSString; =20 @@ -13,19 +14,19 @@ + (BOOL)usesUserKeyEquivalents; @end =20 -@interface NSMenuItem : Object { +@interface NSMenuItem : TestsuiteObject { @private id _menu; } @end =20 -@interface NSResponder : Object +@interface NSResponder : TestsuiteObject { id _nextResponder; } @end =20 -@interface Object(NSMenuValidation) +@interface TestsuiteObject(NSMenuValidation) - (BOOL)validateMenuItem:(id )menuItem; @end =20 Index: obj-c++.dg/cxx-ivars-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/cxx-ivars-2.mm (revision 174696) +++ obj-c++.dg/cxx-ivars-2.mm (working copy) @@ -6,7 +6,7 @@ // { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } // { dg-options "-fobjc-call-cxx-cdtors" } =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.m" #include #define CHECK_IF(expr) if(!(expr)) abort() =20 @@ -31,7 +31,7 @@ struct boo: bar { } }; =20 -@interface Baz: Object { +@interface Baz: TestsuiteObject { @public bar aa; } @@ -76,4 +76,4 @@ int main (void) [foo free]; CHECK_IF(!ctor1_called && !ctor2_called && dtor1_called); } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/typedef-alias-1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/typedef-alias-1.mm (revision 174696) +++ obj-c++.dg/typedef-alias-1.mm (working copy) @@ -1,15 +1,16 @@ /* Typedefs of ObjC types should work without any bogus warnings. */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include =20 -typedef Object MyObject; +typedef TestsuiteObject MyObject; =20 int main (int argc, const char * argv[]) { - Object* a =3D nil; + TestsuiteObject* a =3D nil; MyObject* b =3D a; - Object* c =3D b; + TestsuiteObject* c =3D b; =20 return 0; } Index: obj-c++.dg/proto-lossage-2.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/proto-lossage-2.mm (revision 174696) +++ obj-c++.dg/proto-lossage-2.mm (working copy) @@ -2,13 +2,14 @@ provide a suitable method. */ /* { dg-do compile } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" +#include =20 @protocol Zot -(void) zot; @end =20 -@interface Foo : Object +@interface Foo : TestsuiteObject @end =20 int foo() Index: obj-c++.dg/try-catch-3.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/try-catch-3.mm (revision 174696) +++ obj-c++.dg/try-catch-3.mm (working copy) @@ -5,14 +5,14 @@ /* { dg-do compile } */ /* { dg-options "-fobjc-exceptions" } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 const char *foo(void) { @try { return "foo"; } - @catch (Object* theException) { + @catch (TestsuiteObject* theException) { return [theException name]; } } Index: obj-c++.dg/method-11.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/method-11.mm (revision 174696) +++ obj-c++.dg/method-11.mm (working copy) @@ -5,16 +5,16 @@ /* { dg-do compile } */ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -typedef Object ObjectTypedef1; +typedef TestsuiteObject ObjectTypedef1; typedef ObjectTypedef1 ObjectTypedef2; @compatibility_alias ObjectAlias1 ObjectTypedef2; @compatibility_alias ObjectAlias2 ObjectAlias1; typedef ObjectAlias2 ObjectTypedef3; =20 void foo(void) { - id obj =3D [Object new]; + id obj =3D [TestsuiteObject new]; obj =3D [ObjectTypedef1 new]; obj =3D [ObjectTypedef2 new]; obj =3D [ObjectTypedef3 new]; @@ -23,7 +23,7 @@ void foo(void) { } =20 /* { dg-final { scan-assembler "_OBJC_ClassRefs_0" { target { *-*-darwin*= && { ! lp64 } } } } } */ -/* { dg-final { scan-assembler "_OBJC_ClassRef_Object" { target { *-*-dar= win* && { lp64 } } } } } */ +/* { dg-final { scan-assembler "_OBJC_ClassRef_TestsuiteObject" { target = { *-*-darwin* && { lp64 } } } } } */ /* { dg-final { scan-assembler-not "_OBJC_ClassRefs_1" { target { *-*-darw= in* && { ! lp64 } } } } } */ /* { dg-final { scan-assembler-not "_OBJC_ClassRef_ObjectTypedef" { target= { *-*-darwin* && { lp64 } } } } } */ /* { dg-final { scan-assembler-not "_OBJC_ClassRef_ObjectAlias" { target {= *-*-darwin* && { lp64 } } } } } */ Index: obj-c++.dg/encode-6.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/encode-6.mm (revision 174696) +++ obj-c++.dg/encode-6.mm (working copy) @@ -3,11 +3,8 @@ /* { dg-options "" } */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc= 2 } } } { "-fnext-runtime" } { "" } } */ -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" -#ifndef __NEXT_RUNTIME__ -#include -#endif +#include "../objc-obj-c++-shared/TestsuiteObject.m" +#include "../objc-obj-c++-shared/runtime.h" =20 #include #include @@ -28,7 +25,7 @@ struct Nested { struct Innermost innermost; }; =20 -@interface Int1: Object { +@interface Int1: TestsuiteObject { signed char a, b; Int2 *int2; struct Nested nested; @@ -47,28 +44,28 @@ struct Nested { @implementation Int2 @end =20 -#ifdef NEXT_OBJC_USE_NEW_INTERFACE -Ivar *ivar; -#else +#if defined(__NEXT_RUNTIME__) && !defined(NEXT_OBJC_USE_NEW_INTERFACE) struct objc_ivar *ivar; +#else +Ivar *ivar; #endif =20 static void check_ivar(const char *name, const char *type) { -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - CHECK_IF(!strcmp(ivar_getName(*ivar), name)); - CHECK_IF(!strcmp(ivar_getTypeEncoding(*ivar), type)); -#else +#if defined(__NEXT_RUNTIME__) && !defined(NEXT_OBJC_USE_NEW_INTERFACE) CHECK_IF(!strcmp(ivar->ivar_name, name)); CHECK_IF(!strcmp(ivar->ivar_type, type)); +#else + CHECK_IF(!strcmp(ivar_getName(*ivar), name)); + CHECK_IF(!strcmp(ivar_getTypeEncoding(*ivar), type)); #endif ivar++; } =20 int main(void) { -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - ivar =3D class_copyIvarList ((Class)objc_get_class("Int1"), NULL); +#if defined(__NEXT_RUNTIME__) && !defined(NEXT_OBJC_USE_NEW_INTERFACE) + ivar =3D ((Class)objc_getClass("Int1"))->ivars->ivar_list; #else - ivar =3D ((Class)objc_get_class("Int1"))->ivars->ivar_list; + ivar =3D class_copyIvarList ((Class)objc_getClass("Int1"), NULL); #endif check_ivar("a", "c"); check_ivar("b", "c"); @@ -76,14 +73,14 @@ int main(void) { check_ivar("nested",=20 "{Nested=3D\"a\"f\"b\"f\"next\"@\"Int1\"\"innermost\"{Innermost=3D\"a\= "C\"b\"C\"encl\"^{Nested}}}"); =20=20=20=20=20 -#ifdef NEXT_OBJC_USE_NEW_INTERFACE - ivar =3D class_copyIvarList ((Class)objc_get_class("Int2"), NULL); +#if defined(__NEXT_RUNTIME__) && !defined(NEXT_OBJC_USE_NEW_INTERFACE) + ivar =3D ((Class)objc_getClass("Int2"))->ivars->ivar_list; #else - ivar =3D ((Class)objc_get_class("Int2"))->ivars->ivar_list; + ivar =3D class_copyIvarList ((Class)objc_getClass("Int2"), NULL); #endif check_ivar("innermost", "^{Innermost=3DCC^{Nested}}"); check_ivar("base", "@\"Int1\""); =20=20=20 return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" + Index: obj-c++.dg/comp-types-9.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- obj-c++.dg/comp-types-9.mm (revision 174696) +++ obj-c++.dg/comp-types-9.mm (working copy) @@ -2,9 +2,9 @@ =20 /* Another gimplifier ICE... */ =20 -#include "../objc-obj-c++-shared/Object1.h" +#include "../objc-obj-c++-shared/TestsuiteObject.h" =20 -@interface MyView: Object { +@interface MyView: TestsuiteObject { int _frame; } - (void)_finalize; Index: objc-obj-c++-shared/Object1.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/Object1.m (revision 174696) +++ objc-obj-c++-shared/Object1.m (working copy) @@ -1,4 +0,0 @@ -/* This will generate compatibility code for the test-suite provided as a - category on Object. -*/ -#include "Object1-implementation.h" Index: objc-obj-c++-shared/next-mapping.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/next-mapping.h (revision 174696) +++ objc-obj-c++-shared/next-mapping.h (working copy) @@ -1,109 +0,0 @@ -/* Compatibility header between runtimes and APIs. - Copyright (C) 2010, 2011 Free Software Foundation, Inc. - - Original Authors: Ziemowit Laski - David Ayers -=09=09=20=20=20=20=20 - re-work for ObjC2 by Iain Sandoe - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING3. If not see -. */ - -#ifndef _OBJC_NEXT_MAPPING_H_ -#define _OBJC_NEXT_MAPPING_H_ - -/* This file provides a two-way mapping of API names for the original=20 - GNU & NeXT APIs.=20 -=20=20=20 - It is being expanded to provide mapping (where possible) between betwee= n the - older API and API-2. -*/ - -#include "objc-test-suite-types.h" - -#ifndef __NEXT_RUNTIME__ - -# define CLASSFIELD class_pointer -# define CLASSPTRFIELD(x) (x)->class_pointer -# define SUPERCLASS superClass -# define OBJC_GETCLASS objc_get_class - -# ifdef __objc_api_INCLUDE_GNU -# define class_createInstance(C, S) class_create_instance(C) -# endif -# define method_get_types(M) (M)->method_types - -#else /* NeXT */ - -/* Include next-abi.h to set NEXT_OBJC_USE_NEW_INTERFACE etc.*/ -# include "next-abi.h" - -# ifdef NEXT_OBJC_USE_NEW_INTERFACE - /* API=3D2. */ -# include -# else - /* API=3D0. */ -# include -# endif - -# define CLASSPTRFIELD(x) (x)->isa -# define SUPERCLASS superclass -# define OBJC_GETCLASS objc_getClass - -# define objc_get_class(C) objc_getClass(C) -# define objc_get_meta_class(C) objc_getMetaClass(C) -# define class_get_class_method(C, S) class_getClassMethod(C, S) -# define class_get_instance_method(C, S) class_getInstanceMethod(C, S) -# define sel_get_name(S) sel_getName(S) -# define class_create_instance(C) class_createInstance(C, 0) -# define class_get_class_name(C) object_getClassName(C) -# define objc_lookup_class(N) objc_lookUpClass(N) - -# ifdef NEXT_OBJC_USE_NEW_INTERFACE - -# define object_class_name(O) (object_getClassName(O))=20 -# define object_get_class(O) (object_getClass((id)O)) -# define object_get_super_class(O) class_get_super_class(object_get_class= (O)) -# define object_is_class(O) class_is_meta_class(object_get_class(O)) -# define object_is_meta_class(O) (object_is_class(O) && class_is_meta_cla= ss(O) \ - && class_is_meta_class(object_get_class(O))) - -# define method_get_imp(M) (method_getImplementation((Method)M)) -# define method_get_types(M) (method_getTypeEncoding((Method)M)) - -# define class_get_super_class(C) (class_getSuperclass((Class)C)) -# define class_is_meta_class(C) (class_isMetaClass((Class)C) ? YES: NO) -# define class_is_class(C) (class_is_meta_class(C) =3D=3D NO) - -# else /* OLD API */ - -# define object_class_name(O) (O->name)=20 -# define object_get_super_class(O) class_get_super_class(*(struct objc_cl= ass **)O) -# define object_get_class(O) (*(struct objc_class **)O) -# define object_is_class(O) class_is_meta_class(*(struct objc_class **)O) -# define object_is_meta_class(O) (class_is_meta_class(O) && class_is_meta= _class(*(struct objc_class **)O)) - -# define method_get_imp(M) (((Method)M)->method_imp) -# define method_get_types(M) (((Method)M)->method_types) - -# define class_get_super_class(C) (((struct objc_class *)C)->super_class) -# define class_is_meta_class(C) (CLS_GETINFO((struct objc_class *)C, CLS_= META)? YES: NO) -# define class_is_class(C) (CLS_GETINFO((struct objc_class *)C, CLS_CLASS= )? YES: NO) - -# endif /* NEXT_OBJC_USE_NEW_INTERFACE */ - -# endif /*__NEXT_RUNTIME__ */ -#endif /* _OBJC_NEXT_MAPPING_H_ */ \ No newline at end of file Index: objc-obj-c++-shared/Object1.mm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/Object1.mm (revision 174696) +++ objc-obj-c++-shared/Object1.mm (working copy) @@ -1,4 +0,0 @@ -/* This will generate compatibility code for the test-suite provided as a - category on Object. -*/ -#import "Object1-implementation.h" Index: objc-obj-c++-shared/Object1-implementation.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/Object1-implementation.h (revision 174696) +++ objc-obj-c++-shared/Object1-implementation.h (working copy) @@ -1,169 +0,0 @@ -/* Compatibility code between APIs and ABIs for the objc test suite. - Copyright (C) 2010, 2011 Free Software Foundation, Inc. - Contributed by Iain Sandoe=20 - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING3. If not see -. */ - -/*=20 - * Implementation of a compatibility layer for the ObjC* test-suite. - * - * Four cases: - * GNU=20 - * Uses the 'old' Object with API and ABI =3D 0. - * Compatibility methods are added. - * NeXT pre-Darwin9 - * Uses the 'old' Object with API and ABI =3D 0. - * NeXT Darwin >=3D 9 with no implementation of ABI 2 - * Uses API 2 and ABI 0 for m32, uses the 'old' Object' - * Uses API 2 for m64 but only compile tests can be expected to work. - * NeXT Darwin >=3D 9 with __OBJC2__ - * Uses API 2 and ABI 0 for m32, uses the 'old' Object' - * Uses API 2 and ABI 2 - the libobjc implementation of Object is very - * basic, and we add a category to expand this for test-suite use. - */ - -#ifndef _OBJC_OBJECT1_IMPLEMENTATION_H_ -#define _OBJC_OBJECT1_IMPLEMENTATION_H_ - -#include "Object1.h" - -#ifndef __NEXT_RUNTIME__ - -/* Save us from repeating this. */ -@implementation Object (TEST_SUITE_ADDITIONS) -+ initialize=20 -{ - return self; -} -@end - -#else - -/* For NeXT pre-Darwin 9 or m32 we need do nothing. */ - -# if NEXT_OBJC_ABI_VERSION >=3D 2=20 - -/* Pick up the API=3D2 header. */ -# include - -# ifndef __OBJC2__ - -/* On a Darwin system >=3D 9 when there is no __OBJC2__ compiler, the test= cases - will not link. So we provide a dummy Object for this purpose. */ - -@implementation Object - -+ (Class) class=20 -{ - return self; -} - -- (BOOL)isEqual: (id)anObject -{ - return self =3D=3D anObject; -} - -@end -# endif /* __OBJC2__ */ - -/* In any case, since the library does not provide a complete (enough)=20 - implementation we need to provide the additions. */ - -@implementation Object (TEST_SUITE_ADDITIONS) - -+ initialize=20 -{ - return self; -} - -- init=20 -{ - return self; -} - -- (Class) class=20 -{ - return isa; -} - -+ (Class) superclass -{ - return class_getSuperclass(object_getClass(self)); -} - -+ new=20 -{ - return [[self alloc] init]; -} - -+ free=20 -{ - return nil; -} - -- free=20 -{ - return object_dispose(self); -} - -+ alloc=20 -{ - return class_createInstance (self, 0); -} - -- (Class) superclass { - return class_getSuperclass([self class]); -} - -- (const char *) name { - return class_getName([self class]); -} - --(BOOL)conformsTo:(Protocol *)protocol { - Class cls; - for (cls =3D [self class]; cls; cls =3D [cls superclass])=20 - { - if (class_conformsToProtocol(cls, protocol))=20 - return YES; - } - return NO; -} - -#ifdef __cplusplus -extern "C" { -#endif -extern int printf (const char *, ...); -extern void abort (void); -#ifdef __cplusplus -} -#endif - -/* This is a helper to catch cases where we need to add more functionality - to our test-suite category - more informative than fail with 'does not= =20 - respond to forward:' */ -- forward: (SEL)sel : (marg_list)args -{ - const char * onam =3D object_getClassName (self); - const char * snam =3D sel_getName (sel); - printf ("%s: tried to forward: %s\n", onam, snam); - abort (); -} -@end - -# endif /* NEXT_OBJC_ABI_VERSION >=3D 2 */ -# endif /* __NEXT_RUNTIME__ */ -#endif /* _OBJC_OBJECT1_IMPLEMENTATION_H_ */ Index: objc-obj-c++-shared/TestsuiteObject.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/TestsuiteObject.h (revision 0) +++ objc-obj-c++-shared/TestsuiteObject.h (revision 0) @@ -0,0 +1,47 @@ +/* Very simple root class for writing testcases. + Copyright (C) 2011 Free Software Foundation, Inc. + Contributed by Nicola Pero + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef _TESTSUITE_OBJECT_H_ +#define _TESTSUITE_OBJECT_H_ + +/* We use this root class instead of Object to keep the tests + independent of the runtime being used. Keep it simple. */ + +@interface TestsuiteObject +{ + Class isa; +} +/* Required by the NeXT runtime. Does nothing. */ ++ (id) initialize; + +/* Creating instances. */ ++ (id) new; ++ (id) alloc; +- (id) init; +- (void) free; + +/* Auxiliary methods. */ ++ (Class) class; ++ (Class) superclass; ++ (const char *)name; +- (const char *)name; +@end + +#endif /* _TESTSUITE_OBJECT_H_ */ Index: objc-obj-c++-shared/Protocol1.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/Protocol1.h (revision 174696) +++ objc-obj-c++-shared/Protocol1.h (working copy) @@ -1,52 +0,0 @@ -/*=20 - * Temporary work-around to avoid the need for method attributes in - * the NeXT Runtime Protocol header. - */ -#ifndef _OBJC_PROTOCOL1_H_ -#define _OBJC_PROTOCOL1_H_ - -# ifndef __NEXT_RUNTIME__ -# include -# else -# include "next-abi.h" -# ifndef NEXT_OBJC_USE_NEW_INTERFACE -/* We are on a NeXT version without method __attributes__ */ -# import -# else -/* We make our own interface without the deprecation messages=20 - * This is essentially without the OBJC2 - * flags. - *=20 - */ -# ifndef _OBJC_PROTOCOL_H_ -# define _OBJC_PROTOCOL_H_ -# import "Object1.h" - -@interface Protocol : Object -{ -@private - char *protocol_name ; - struct objc_protocol_list *protocol_list ; - struct objc_method_description_list *instance_methods ; - struct objc_method_description_list *class_methods ; -} - -/* Obtaining attributes intrinsic to the protocol */ -#if (NEXT_OBJC_ABI_VERSION=3D=3D0) -- (const char *)name ; /* Not avail in v2, deprecated in prior */ -/* Testing protocol conformance */ -- (BOOL) conformsTo: (Protocol *)aProtocolObject ; /* Not avail in v2 */ -#endif - -/* Looking up information specific to a protocol */ -/* Deprecated, but available */ - -- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSe= l ; -- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel ; - -@end - -# endif /* __NEXT_RUNTIME__ */ -# endif /* _OBJC_PROTOCOL_H_ */ -# endif /* NEXT_OBJC_ABI_VERSION */ -#endif /* _OBJC_PROTOCOL1_H_ */ Index: objc-obj-c++-shared/runtime.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/runtime.h (revision 0) +++ objc-obj-c++-shared/runtime.h (revision 0) @@ -0,0 +1,114 @@ +/* Wrapper around + Copyright (C) 2011 Free Software Foundation, Inc. + Contributed by Nicola Pero + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef _TESTSUITE_RUNTIME_H_ +#define _TESTSUITE_RUNTIME_H_ + +/* Include this file where you'd normally include . + + Older versions of the NeXT runtime do not have and + you need to include instead. This file takes + care of figuring out if that's the case. */ + +#ifndef __NEXT_RUNTIME__ + +/* + GNU Objective-C runtime (libobjc). +*/ +# include + +#else + +/* + NeXT Objective-C runtime. +*/ + +/* Include next-abi.h to determine which version of the runtime we are + dealing with. TODO: If this is the only place including it, maybe + it could be copied here ? */ +# include "next-abi.h" + +# ifdef NEXT_OBJC_USE_NEW_INTERFACE + +/* New NeXT runtime, with an API that should be basically identical to + the GNU Objective-C one. */ +# include + +# else + +/* Old NeXT runtime, with an API similar, but not identical to the new + one. To start with, different headers need to be included. */ +# include +# include + +/* Not all functions are available in the old NeXT runtime. A few + that we need are not, and here we provide an implementation on top + of the old NeXT API. */ + +# define class_isMetaClass(C) (CLS_GETINFO((struct objc_class *)C, CLS_ME= TA)? YES: NO) +# define class_getName(C) object_getClassName(C) +# define class_getSuperclass(C) (((struct objc_class *)C)->super_class) +# define method_getImplementation(M) (((Method)M)->method_imp) +# define method_getTypeEncoding(M) (((Method)M)->method_types) +# define object_getClass(O) (*(struct objc_class **)O) + +#include +BOOL class_conformsToProtocol (Class class_, Protocol *protocol) +{ + struct objc_protocol_list *p; + int i; + for (p =3D class_->protocols; p; p =3D p->next) + for (i =3D 0; i < p->count; i++) + if ([p->list[i] conformsTo: protocol]) + return YES; + return NO; +} + +#define protocol_getName(P) [P name] +#define protocol_isEqual(P,Q) [P isEqual: Q] + +struct objc_method_description protocol_getMethodDescription (Protocol *pr= otocol,=20 + SEL selector, + BOOL requiredMethod, + BOOL instanceMethod) +{ + struct objc_method_description *tmp; + struct objc_method_description result; + + if (instanceMethod) + { + tmp =3D [protocol descriptionForInstanceMethod: selector]; + result =3D *tmp; + } + else + { + tmp =3D [protocol descriptionForClassMethod: selector]; + result =3D *tmp;=20=20=20=20=20=20 + } + + return result; +} + +# endif /* NEXT_OBJC_USE_NEW_INTERFACE */ + +# endif /* __NEXT_RUNTIME__ */ + +#endif /* _TESTSUITE_RUNTIME_H_ */ + Index: objc-obj-c++-shared/objc-test-suite-types.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/objc-test-suite-types.h (revision 174696) +++ objc-obj-c++-shared/objc-test-suite-types.h (working copy) @@ -21,17 +21,8 @@ along with GCC; see the file COPYING3. If not see #ifndef _OBJC_TEST_SUITE_TYPES_H_ #define _OBJC_TEST_SUITE_TYPES_H_ =20 -#ifdef __cplusplus -#define ProtoBool bool -#else -#define ProtoBool _Bool -#endif - #ifndef __NEXT_RUNTIME__ =20 -#define METHOD Method_t -#define IVAR_T struct objc_ivar - /* dummy const string class ref. */ typedef void * TNS_STRING_REF_T; =20 @@ -52,16 +43,12 @@ typedef void * TNS_STRING_REF_T; #define NULL 0 #endif =20 -#define METHOD Method - /* Where there are equivalent interfaces between APIs we substitute a macro or typedef. */ #ifdef NEXT_OBJC_USE_NEW_INTERFACE typedef void * PMETH; -#define IVAR_T Ivar=20 #else typedef struct objc_method * PMETH; -#define IVAR_T struct objc_ivar=20 #endif =20 #ifdef __OBJC2__ @@ -77,4 +64,4 @@ typedef struct objc_class TNS_STRING_REF_T; #endif =20 #endif /*__NEXT_RUNTIME__ */ -#endif /* _OBJC_TEST_SUITE_TYPES_H_ */ \ No newline at end of file +#endif /* _OBJC_TEST_SUITE_TYPES_H_ */ Index: objc-obj-c++-shared/TestsuiteObject.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/TestsuiteObject.m (revision 0) +++ objc-obj-c++-shared/TestsuiteObject.m (revision 0) @@ -0,0 +1,64 @@ +/* Very simple root class for writing testcases. + Copyright (C) 2011 Free Software Foundation, Inc. + Contributed by Nicola Pero + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* This is the implementation, but in all simple testcases we + recommend simply including it in the testcase. */ + +#include "TestsuiteObject.h" +#include "runtime.h" + +@implementation TestsuiteObject ++ (id) initialize +{ + return self; +} ++ (id) new +{ + return [[self alloc] init]; +} ++ (id) alloc +{ + return class_createInstance (self, 0); +} +- (id) init +{ + return self; +} +- (void) free +{ + object_dispose (self); +} ++ (Class) class +{ + return self; +} ++ (Class) superclass +{ + return class_getSuperclass (self); +} ++ (const char *)name +{ + return class_getName (self); +} +- (const char *)name +{ + return class_getName (isa); +} +@end Index: objc-obj-c++-shared/Object1.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- objc-obj-c++-shared/Object1.h (revision 174696) +++ objc-obj-c++-shared/Object1.h (working copy) @@ -1,175 +0,0 @@ -/* Compatibility code between APIs and ABIs for the objc test suite. - Copyright (C) 2010, 2011 Free Software Foundation, Inc. - Contributed by Iain Sandoe=20 - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING3. If not see -. */ - -/*=20 - * Compatibility header. - * - * Four cases: - * GNU=20 - * Uses the 'old' Object with API and ABI =3D 0. - * Compatibility methods are added. - * NeXT pre-Darwin9 - * Uses the 'old' Object with API and ABI =3D 0. - * NeXT Darwin >=3D 9 with no implementation of ABI 2 - * Uses API 2 and ABI 0 for m32, uses the 'old' Object' - * Uses API 2 for m64 but only compile tests can be expected to work. - * NeXT Darwin >=3D 9 with __OBJC2__ - * Uses API 2 and ABI 0 for m32, uses the 'old' Object' - * Uses API 2 and ABI 2 - the libobjc implementation of Object is very - * basic, and we add a category to expand this for test-suite use. - */ -#ifndef _OBJC_OBJECT1_H_ -#define _OBJC_OBJECT1_H_ - -#ifndef __NEXT_RUNTIME__=20 -/* Case 1 =3D GNU. */ -# include -/* NeXT requires a +initialize (or forward:) method, and it makes testcase= s more - readable if the conditional code can be reduced, so we add one to the G= NU tests=20 - too. This saves us from having to introduce it every time. */ -@interface Object (TEST_SUITE_ADDITIONS) -+ initialize; -@end - -#else /* NeXT */ - -# include "next-abi.h" -# if !defined(NEXT_OBJC_ABI_VERSION) || (NEXT_OBJC_ABI_VERSION < 2) -/* Cases 2, Case 3/m32 and 4/m32 are handled as default. */ -# include -# else -# include - -/* This is a cut-down Object with only the methods currently required - by the testsuite declared. The implementation is provided in=20 - Object1-implementation.h -*/ - -/* The m64 libobjc implementation of Object provides only the 'class' and - isEqual: methods.=20=20 -=20=20=20 - We add the others required as a test-suite category.=20 -=20=20=20 - Please leave the unimplemented methods as comments - so that they can - be inserted as required by future tests. */ - -@interface Object -{ - Class isa; -} -+ (Class) class; -- (BOOL)isEqual: (id)anObject; -@end - -/* Dummy definition. */ -typedef void * marg_list; - -@interface Object (TEST_SUITE_ADDITIONS) - -+ initialize; -- init; - -+ new; -+ free; -- free; -+ alloc; -//- copy; -//+ allocFromZone:(void *)zone; -//- copyFromZone:(void *)zone; -//- (void *)zone; - -- (Class) class; -+ (Class) superclass; -//+ (const char *) name; -//- superclass; -- (const char *) name; - -//- self; -//- (unsigned int) hash; - -/* Testing inheritance relationships */ - -//- (BOOL) isKindOf: aClassObject; -//- (BOOL) isMemberOf: aClassObject; -//- (BOOL) isKindOfClassNamed: (const char *)aClassName; -//- (BOOL) isMemberOfClassNamed: (const char *)aClassName; - -/* Testing class functionality */ - -//+ (BOOL) instancesRespondTo:(SEL)aSelector; -//- (BOOL) respondsTo:(SEL)aSelector; - -/* Testing protocol conformance */ - -- (BOOL) conformsTo: (Protocol *)aProtocolObject; -//+ (BOOL) conformsTo: (Protocol *)aProtocolObject; - -/* Obtaining method descriptors from protocols */ - -//- (struct objc_method_description *) descriptionForMethod:(SEL)aSel; -//+ (struct objc_method_description *) descriptionForInstanceMethod:(SEL)a= Sel; - -/* Obtaining method handles */ - -//- (IMP) methodFor:(SEL)aSelector; -//+ (IMP) instanceMethodFor:(SEL)aSelector; - -/* Sending messages determined at run time */ - -//- perform:(SEL)aSelector; -//- perform:(SEL)aSelector with:anObject; -//- perform:(SEL)aSelector with:object1 with:object2; - -/* Posing */ - -//+ poseAs: aClassObject; - -/* Enforcing intentions */ -=20 -//- subclassResponsibility:(SEL)aSelector; -//- notImplemented:(SEL)aSelector; - -/* Error handling */ - -//- doesNotRecognize:(SEL)aSelector; -//- error:(const char *)aString, ...; - -/* Debugging */ - -//- (void) printForDebugger:(void *)stream; - -/* Archiving */ - -//- awake; -//- write:(void *)stream; -//- read:(void *)stream; -//+ (int) version; -//+ setVersion: (int) aVersion; - -/* Forwarding */ - -- forward: (SEL)sel : (marg_list)args; -//- performv: (SEL)sel : (marg_list)args; - -@end - -# endif /* NeXT case 3 & 4 m64 */ -# endif /* NEXT */ -#endif /* _OBJC_OBJECT1_H_ */ --Apple-Mail-18-518678609 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-length: 2 --Apple-Mail-18-518678609--