public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] objc: update documetation and add test-case of constructor/destructor attr.
@ 2016-08-10  9:11 Martin Liška
  2016-08-11  2:53 ` Sandra Loosemore
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Martin Liška @ 2016-08-10  9:11 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

Hi.

Following patch clarifies usage of ctor and dtor attributes for Objective C.
Patch survives (on x86_64-linux-gnu):

make -k check-objc RUNTESTFLAGS="execute.exp"

Ready for trunk?
Thanks,
Martin

[-- Attachment #2: 0001-objc-update-documetation-and-add-test-case-of-constr.patch --]
[-- Type: text/x-patch, Size: 1622 bytes --]

From 0fcb15e50905a95d8e824aed45d961b5ddc46479 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 10 Aug 2016 11:01:49 +0200
Subject: [PATCH] objc: update documetation and add test-case of
 constructor/destructor attr.

gcc/ChangeLog:

2016-08-10  Martin Liska  <mliska@suse.cz>

	* doc/extend.texi: Remove limitation of Objective C for
	__attribute__((constructor)) and __attribute__((destructor)).

gcc/testsuite/ChangeLog:

2016-08-10  Martin Liska  <mliska@suse.cz>

	* objc/execute/construct1.m: New test.
---
 gcc/doc/extend.texi                     |  2 --
 gcc/testsuite/objc/execute/construct1.m | 11 +++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/objc/execute/construct1.m

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 5697f3a..cce17aa 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2485,8 +2485,6 @@ same priority.  The priorities for constructor and destructor
 functions are the same as those specified for namespace-scope C++
 objects (@pxref{C++ Attributes}).
 
-These attributes are not currently implemented for Objective-C@.
-
 @item deprecated
 @itemx deprecated (@var{msg})
 @cindex @code{deprecated} function attribute
diff --git a/gcc/testsuite/objc/execute/construct1.m b/gcc/testsuite/objc/execute/construct1.m
new file mode 100644
index 0000000..3de036d
--- /dev/null
+++ b/gcc/testsuite/objc/execute/construct1.m
@@ -0,0 +1,11 @@
+int i;
+
+void hello (void) __attribute__ ((constructor));
+void hello (void) { i = 1; }
+
+int main (void) {
+  if (i != 1)
+    return 1;
+
+  return 0;
+}
-- 
2.9.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-28 19:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-10  9:11 [PATCH] objc: update documetation and add test-case of constructor/destructor attr Martin Liška
2016-08-11  2:53 ` Sandra Loosemore
2016-09-27 12:50   ` Iain Sandoe
2016-09-27 11:27 ` Martin Liška
2016-09-28 19:12 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).