diff mbox series

[pushed] testsuite, Objective-c++ : Add a dummy retain/release to testuite object.

Message ID 3F7B744F-483F-4F80-BA03-26DFA954023F@sandoe.co.uk
State New
Headers show
Series [pushed] testsuite, Objective-c++ : Add a dummy retain/release to testuite object. | expand

Commit Message

Iain Sandoe Oct. 11, 2020, 4:13 p.m. UTC
Hi

On newer systems, the throw/catch process sends retain and release
messages to thrown objects.  While these are not needed in the testsuite
cases, they cause the tests to fail because the selector is not handled.
Add dummy methods to the testsuite object.

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

gcc/testsuite/ChangeLog:

	* objc-obj-c++-shared/TestsuiteObject.h: Add dummy retain and
	release method declarations.
	* objc-obj-c++-shared/TestsuiteObject.m: Add dummy retain and
	release implementations.
---
 gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h |  5 +++++
 gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m | 11 +++++++++++
 2 files changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h b/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h
index 0f139bc84b4..a1a964da8f5 100644
--- a/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h
+++ b/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h
@@ -45,6 +45,11 @@  __attribute__((objc_root_class))
 + (Class) superclass;
 + (const char *)name;
 - (const char *)name;
+
+/* For try-catch impl that retains and releases thrown objects.  */
+- (id) retain;
+- (void) release;
+
 @end
 
 #endif /* _TESTSUITE_OBJECT_H_ */
diff --git a/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m b/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m
index 703827f8e61..96717e362d5 100644
--- a/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m
+++ b/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m
@@ -66,4 +66,15 @@  along with GCC; see the file COPYING3.  If not see
 {
   return object_getClassName (self);
 }
+
+- (id) retain
+{
+  return self;
+}
+
+- (void) release
+{
+  return;
+}
+
 @end