diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-12-13 13:54:10 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2025-01-08 23:00:47 +0100 |
commit | 2116e8d2275f8bfb04263f26eed17b928513fed8 (patch) | |
tree | 277c03d5c20998ebe8701fbcbbc40ae20bb11ee3 /gcc | |
parent | 678c3f06fc165b883f63b0c44ce9f650b7c1504a (diff) | |
download | gcc-2116e8d2275f8bfb04263f26eed17b928513fed8.zip gcc-2116e8d2275f8bfb04263f26eed17b928513fed8.tar.gz gcc-2116e8d2275f8bfb04263f26eed17b928513fed8.tar.bz2 |
nvptx: Add '__builtin_stack_save()', '__builtin_stack_restore()' test case [PR65181]
Documenting the status quo.
PR target/65181
gcc/testsuite/
* gcc.target/nvptx/__builtin_stack_save___builtin_stack_restore-1.c:
Add.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.target/nvptx/__builtin_stack_save___builtin_stack_restore-1.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/nvptx/__builtin_stack_save___builtin_stack_restore-1.c b/gcc/testsuite/gcc.target/nvptx/__builtin_stack_save___builtin_stack_restore-1.c new file mode 100644 index 0000000..294014d --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/__builtin_stack_save___builtin_stack_restore-1.c @@ -0,0 +1,32 @@ +/* Document what we do for '__builtin_stack_save()', '__builtin_stack_restore()'. */ + +/* { dg-do compile } + TODO We can't 'assemble' this -- it's invalid PTX code. */ +/* { dg-options {-O3 -mno-soft-stack} } */ +/* { dg-additional-options -save-temps } */ +/* { dg-final { check-function-bodies {** } {} } } */ + +void *p; + +void f(void) +{ + p = __builtin_stack_save(); + asm volatile ("" : : : "memory"); + __builtin_stack_restore(p); + asm volatile ("" : : : "memory"); +} +/* +** f: +** \.visible \.func f +** { +** st\.global\.u64 \[p\], %stack; +** ret; +*/ + +/* The concept of a '%stack' pointer doesn't apply like this for + '-mno-soft-stack': PTX "native" stacks (TODO). + + { dg-final { scan-assembler-not {%stack} { xfail *-*-* } } } */ + +/* As these are an internal-use built-in function, we don't bother with + emitting proper error diagnostics. */ |