public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH] objc: update documetation and add test-case of constructor/destructor attr.
Date: Wed, 10 Aug 2016 09:11:00 -0000	[thread overview]
Message-ID: <69d63b26-fc95-fd2d-57fb-c757ac506462@suse.cz> (raw)

[-- 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


             reply	other threads:[~2016-08-10  9:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10  9:11 Martin Liška [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69d63b26-fc95-fd2d-57fb-c757ac506462@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).