aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-12-13 11:40:01 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2025-01-10 11:45:35 +0100
commit86175a64f167e3b1701132fa1684d76230054c36 (patch)
treeb471841fb5e54297bf75a660253e22e1ed88ef7a /gcc
parent91dec10f8b7502bdd333d75ab7a9e23a58c3f32d (diff)
downloadgcc-86175a64f167e3b1701132fa1684d76230054c36.zip
gcc-86175a64f167e3b1701132fa1684d76230054c36.tar.gz
gcc-86175a64f167e3b1701132fa1684d76230054c36.tar.bz2
nvptx: Add '__builtin_frame_address(0)' test case
Documenting the status quo. gcc/testsuite/ * gcc.target/nvptx/__builtin_frame_address_0-1.c: New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.target/nvptx/__builtin_frame_address_0-1.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/nvptx/__builtin_frame_address_0-1.c b/gcc/testsuite/gcc.target/nvptx/__builtin_frame_address_0-1.c
new file mode 100644
index 0000000..3581776
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/__builtin_frame_address_0-1.c
@@ -0,0 +1,36 @@
+/* Document what we do for '__builtin_frame_address(0)'. */
+
+/* { dg-do compile }
+ TODO We can't 'assemble' this -- it's invalid PTX code. */
+/* { dg-options -O3 } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { check-function-bodies {** } {} } } */
+
+void sink(void *);
+
+void f(void)
+{
+ void *p;
+ p = __builtin_frame_address(0);
+ sink(p);
+}
+/*
+** f:
+** \.visible \.func f
+** {
+** {
+** \.param\.u64 %out_arg1;
+** st\.param\.u64 \[%out_arg1\], %frame;
+** call sink, \(%out_arg1\);
+** }
+** ret;
+*/
+
+/* The concept of a '%frame' pointer doesn't apply like this for
+ '-mno-soft-stack': PTX "native" stacks (TODO), and for '-msoft-stack' in
+ this form also constitutes invalid PTX code (TODO).
+
+ { dg-final { scan-assembler-not {%frame} { xfail *-*-* } } } */
+
+/* As this is an internal-use built-in function, we don't bother with
+ emitting proper error diagnostics. */