https://gcc.gnu.org/g:5a269a2c5bd47e5399af60efe70be7392e0fbebf

commit 5a269a2c5bd47e5399af60efe70be7392e0fbebf
Author: Thomas Schwinge <tschwi...@baylibre.com>
Date:   Wed Dec 11 15:22:06 2024 +0100

    nvptx: Add 'sorry, unimplemented: target cannot support alloca' test cases 
[PR65181]
    
    Documenting the status quo.
    
            PR target/65181
            gcc/testsuite/
            * gcc.target/nvptx/alloca-1-O0.c: New.
            * gcc.target/nvptx/alloca-2-O1.c: Likewise.
            * gcc.target/nvptx/vla-1-O0.c: Likewise.

Diff:
---
 gcc/testsuite/ChangeLog.omp                  |  5 +++++
 gcc/testsuite/gcc.target/nvptx/alloca-1-O0.c | 10 ++++++++++
 gcc/testsuite/gcc.target/nvptx/alloca-2-O1.c |  9 +++++++++
 gcc/testsuite/gcc.target/nvptx/vla-1-O0.c    | 11 +++++++++++
 4 files changed, 35 insertions(+)

diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp
index 165591973cb0..bd30626a0dca 100644
--- a/gcc/testsuite/ChangeLog.omp
+++ b/gcc/testsuite/ChangeLog.omp
@@ -1,5 +1,10 @@
 2024-12-18  Thomas Schwinge  <tschwi...@baylibre.com>
 
+       PR target/65181
+       * gcc.target/nvptx/alloca-1-O0.c: New.
+       * gcc.target/nvptx/alloca-2-O1.c: Likewise.
+       * gcc.target/nvptx/vla-1-O0.c: Likewise.
+
        Backported from trunk:
        2024-06-05  Wilco Dijkstra  <wilco.dijks...@arm.com>
 
diff --git a/gcc/testsuite/gcc.target/nvptx/alloca-1-O0.c 
b/gcc/testsuite/gcc.target/nvptx/alloca-1-O0.c
new file mode 100644
index 000000000000..c76348fbb386
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/alloca-1-O0.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options {-O0 -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/alloca-2-O1.c 
b/gcc/testsuite/gcc.target/nvptx/alloca-2-O1.c
new file mode 100644
index 000000000000..cbeebaa7051c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/alloca-2-O1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options {-O1 -mno-soft-stack} } */
+
+int
+main(void)
+{
+  return !(__builtin_alloca(100) != __builtin_alloca(10));
+  /* { dg-message {sorry, unimplemented: target cannot support alloca} {} { 
target *-*-* } .-1 } */
+}
diff --git a/gcc/testsuite/gcc.target/nvptx/vla-1-O0.c 
b/gcc/testsuite/gcc.target/nvptx/vla-1-O0.c
new file mode 100644
index 000000000000..de39755b85f8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/vla-1-O0.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options {-O0 -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);
+}

Reply via email to