public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5888] aarch64: Add eh_return compile tests
@ 2023-11-27 15:55 Szabolcs Nagy
  0 siblings, 0 replies; only message in thread
From: Szabolcs Nagy @ 2023-11-27 15:55 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:cad7e1e3e0dea1922f89290bbbc27b4c44f53bf5

commit r14-5888-gcad7e1e3e0dea1922f89290bbbc27b4c44f53bf5
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.

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 00000000000..4a9d124e891
--- /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 00000000000..a17baa86501
--- /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);
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-27 15:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-27 15:55 [gcc r14-5888] aarch64: Add eh_return compile tests Szabolcs Nagy

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).