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.
This commit is contained in:
parent
678c3f06fc
commit
2116e8d227
1 changed files with 32 additions and 0 deletions
|
@ -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. */
|
Loading…
Add table
Reference in a new issue