public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/gcs-13)] aarch64: Add eh_return compile tests Date: Wed, 14 Feb 2024 15:35:21 +0000 (GMT) [thread overview] Message-ID: <20240214153521.9B27A385EC49@sourceware.org> (raw) https://gcc.gnu.org/g:ec9422d3e066caf3f4a7128750d38117d5ce435d commit ec9422d3e066caf3f4a7128750d38117d5ce435d Author: Szabolcs Nagy <szabolcs.nagy@arm.com> Date: Fri Jun 2 14:17:02 2023 +0100 aarch64: Add eh_return compile tests gcc/testsuite/ChangeLog: * gcc.target/aarch64/eh_return-2.c: New test. * gcc.target/aarch64/eh_return-3.c: New test. (cherry picked from commit cad7e1e3e0dea1922f89290bbbc27b4c44f53bf5) Diff: --- gcc/testsuite/gcc.target/aarch64/eh_return-2.c | 9 +++++++++ gcc/testsuite/gcc.target/aarch64/eh_return-3.c | 28 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/gcc/testsuite/gcc.target/aarch64/eh_return-2.c b/gcc/testsuite/gcc.target/aarch64/eh_return-2.c new file mode 100644 index 000000000000..4a9d124e8915 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/eh_return-2.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-final { scan-assembler "add\tsp, sp, x5" } } */ +/* { dg-final { scan-assembler "br\tx6" } } */ + +void +foo (unsigned long off, void *handler) +{ + __builtin_eh_return (off, handler); +} diff --git a/gcc/testsuite/gcc.target/aarch64/eh_return-3.c b/gcc/testsuite/gcc.target/aarch64/eh_return-3.c new file mode 100644 index 000000000000..a17baa86501e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/eh_return-3.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mbranch-protection=pac-ret+leaf -fno-schedule-insns -fno-schedule-insns2" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +**foo: +** hint 25 // paciasp +** ... +** cbz w2, .* +** mov x4, 0 +** ... +** cbz x4, .* +** add sp, sp, x5 +** br x6 +** hint 29 // autiasp +** ret +** mov x5, x0 +** mov x4, 1 +** mov x6, x1 +** b .* +*/ +void +foo (unsigned long off, void *handler, int c) +{ + if (c) + return; + __builtin_eh_return (off, handler); +}
reply other threads:[~2024-02-14 15:35 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240214153521.9B27A385EC49@sourceware.org \ --to=nsz@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).