]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx: Add 'sorry, unimplemented: target cannot support alloca' test cases [PR65181]
authorThomas Schwinge <tschwinge@baylibre.com>
Wed, 11 Dec 2024 14:22:06 +0000 (15:22 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Wed, 8 Jan 2025 21:33:10 +0000 (22:33 +0100)
Documenting the status quo.

PR target/65181
gcc/testsuite/
* gcc.target/nvptx/alloca-1.c: New.
* gcc.target/nvptx/vla-1.c: Likewise.

gcc/testsuite/gcc.target/nvptx/alloca-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/nvptx/vla-1.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/nvptx/alloca-1.c b/gcc/testsuite/gcc.target/nvptx/alloca-1.c
new file mode 100644 (file)
index 0000000..0aa6f10
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options -mno-soft-stack } */
+
+void sink(void *);
+
+void f(void)
+{
+  sink(__builtin_alloca(123));
+  /* { dg-message {sorry, unimplemented: target cannot support alloca} {} { target *-*-* } .-1 } */
+}
diff --git a/gcc/testsuite/gcc.target/nvptx/vla-1.c b/gcc/testsuite/gcc.target/nvptx/vla-1.c
new file mode 100644 (file)
index 0000000..5baf95c
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options -mno-soft-stack } */
+
+void sink(void *);
+
+void f(int s)
+{
+  char a[s];
+  /* { dg-message {sorry, unimplemented: target cannot support alloca} {} { target *-*-* } .-1 } */
+  sink(a);
+}