From: Eric Botcazou <ebotcazou@adacore.com>
To: gcc-patches@gcc.gnu.org
Subject: [patch v2] Get rid of stack trampolines for nested functions (4/4)
Date: Sun, 04 Sep 2016 21:31:00 -0000 [thread overview]
Message-ID: <3129144.GZRd3iTdUb@arcturus.home> (raw)
In-Reply-To: <1518726.5fkcUnkpqM@arcturus.home>
[-- Attachment #1: Type: text/plain, Size: 302 bytes --]
This is the couple of testcases for the gnat.dg testsuite. They test for the
presence of the GNU-stack executable marker in the assembly file on Linux.
2016-07-04 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/trampoline3.adb: New test.
* gnat.dg/trampoline4.adb: Likewise.
--
Eric Botcazou
[-- Attachment #2: p4.diff --]
[-- Type: text/x-patch, Size: 1355 bytes --]
Index: testsuite/gnat.dg/trampoline3.adb
===================================================================
--- testsuite/gnat.dg/trampoline3.adb (revision 0)
+++ testsuite/gnat.dg/trampoline3.adb (working copy)
@@ -0,0 +1,22 @@
+-- { dg-do compile { target *-*-linux* } }
+-- { dg-options "-gnatws" }
+
+procedure Trampoline3 is
+
+ A : Integer;
+
+ type FuncPtr is access function (I : Integer) return Integer;
+
+ function F (I : Integer) return Integer is
+ begin
+ return A + I;
+ end F;
+
+ P : FuncPtr := F'Access;
+ I : Integer;
+
+begin
+ I := P(0);
+end;
+
+-- { dg-final { scan-assembler-not "GNU-stack.*x" } }
Index: testsuite/gnat.dg/trampoline4.adb
===================================================================
--- testsuite/gnat.dg/trampoline4.adb (revision 0)
+++ testsuite/gnat.dg/trampoline4.adb (working copy)
@@ -0,0 +1,23 @@
+-- { dg-do compile { target *-*-linux* } }
+-- { dg-options "-ftrampolines -gnatws" }
+-- { dg-skip-if "native descriptors" { hppa*-*-* ia64-*-* powerpc64-*-* } }
+
+procedure Trampoline4 is
+
+ A : Integer;
+
+ type FuncPtr is access function (I : Integer) return Integer;
+
+ function F (I : Integer) return Integer is
+ begin
+ return A + I;
+ end F;
+
+ P : FuncPtr := F'Access;
+ I : Integer;
+
+begin
+ I := P(0);
+end;
+
+-- { dg-final { scan-assembler "GNU-stack.*x" } }
next prev parent reply other threads:[~2016-09-04 20:15 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-04 20:10 [patch v2] Get rid of stack trampolines for nested functions (0/4) Eric Botcazou
2016-09-04 20:12 ` [patch v2] Get rid of stack trampolines for nested functions (1/4) Eric Botcazou
2016-09-12 19:41 ` Jeff Law
2016-09-12 19:45 ` Jeff Law
2016-12-05 20:52 ` Ian Lance Taylor
2016-12-05 21:29 ` Lynn A. Boger
2016-12-05 22:41 ` Ian Lance Taylor
2016-12-05 22:12 ` Eric Botcazou
2016-12-06 17:52 ` Eric Botcazou
2016-12-06 20:18 ` Ian Lance Taylor
2016-12-06 21:59 ` Lynn A. Boger
2016-12-06 22:26 ` Eric Botcazou
2016-12-07 13:38 ` Lynn A. Boger
2016-12-07 13:56 ` Eric Botcazou
2016-12-07 7:23 ` Eric Botcazou
2017-03-23 16:48 ` Andreas Schwab
2017-03-28 17:01 ` Eric Botcazou
2017-03-29 10:05 ` Andreas Schwab
2017-03-29 14:05 ` Eric Botcazou
2017-03-29 14:15 ` Andreas Schwab
2016-09-04 20:14 ` [patch v2] Get rid of stack trampolines for nested functions (2/4) Eric Botcazou
2016-09-04 20:15 ` [patch v2] Get rid of stack trampolines for nested functions (3/4) Eric Botcazou
2016-09-05 10:52 ` Segher Boessenkool
2016-09-12 19:56 ` Jeff Law
2016-09-04 21:31 ` Eric Botcazou [this message]
2016-10-16 20:29 ` [patch v2] Get rid of stack trampolines for nested functions (0/4) Eric Botcazou
2016-10-17 10:40 ` Andreas Schwab
2016-10-17 11:14 ` Eric Botcazou
2016-10-17 22:35 ` Eric Botcazou
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=3129144.GZRd3iTdUb@arcturus.home \
--to=ebotcazou@adacore.com \
--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).