| 1 |
/* Document what we do for '__builtin_stack_address()'. */ |
| 2 |
|
| 3 |
/* { dg-do compile } |
| 4 |
TODO We can't 'assemble' this -- it's invalid PTX code. */ |
| 5 |
/* { dg-options -O3 } */ |
| 6 |
/* { dg-additional-options -save-temps } */ |
| 7 |
/* { dg-final { check-function-bodies {** } {} } } */ |
| 8 |
|
| 9 |
void sink(void *); |
| 10 |
|
| 11 |
void f(void) |
| 12 |
{ |
| 13 |
void *p; |
| 14 |
p = __builtin_stack_address(); |
| 15 |
sink(p); |
| 16 |
} |
| 17 |
/* |
| 18 |
** f: |
| 19 |
** \.visible \.func f |
| 20 |
** { |
| 21 |
** { |
| 22 |
** \.param\.u64 %out_arg1; |
| 23 |
** st\.param\.u64 \[%out_arg1\], %stack; |
| 24 |
** call sink, \(%out_arg1\); |
| 25 |
** } |
| 26 |
** ret; |
| 27 |
*/ |
| 28 |
|
| 29 |
/* The concept of a '%stack' pointer doesn't apply like this for |
| 30 |
'-mno-soft-stack': PTX "native" stacks (TODO), and for '-msoft-stack' in |
| 31 |
this form also constitutes invalid PTX code (TODO). |
| 32 |
|
| 33 |
{ dg-final { scan-assembler-not {%stack} { xfail *-*-* } } } */ |
| 34 |
|
| 35 |
/* As this is an internal-use built-in function, we don't bother with |
| 36 |
emitting proper error diagnostics. */ |