]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx: Add a test case where 'alloca's evaporate [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-2-O1.c: New.

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

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 (file)
index 0000000..56cc3f2
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options {-O1 -mno-soft-stack} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { check-function-bodies {** } {} } } */
+
+int
+main(void)
+{
+  return !(__builtin_alloca(100) != __builtin_alloca(10));
+}
+/*
+** main:
+** \.visible \.func \(\.param\.u32 %value_out\) main \(\.param\.u32 %in_ar0, \.param\.u64 %in_ar1\)
+** {
+**     \.reg\.u32 %value;
+**             mov\.u32        %value, 0;
+**     st\.param\.u32  \[%value_out\], %value;
+**     ret;
+*/