| 1 |
/* Test inline ASM clobber for SP register */ |
| 2 |
|
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-O1" } */ |
| 5 |
|
| 6 |
/* -O1 in the options is significant. */ |
| 7 |
|
| 8 |
extern void abort (void); |
| 9 |
|
| 10 |
int |
| 11 |
test1 (void) |
| 12 |
{ |
| 13 |
int res; |
| 14 |
|
| 15 |
/* { dg-warning "listing the stack pointer register 'sp' in a clobber list is deprecated" "" { target pru-*-* } .+2 } */ |
| 16 |
/* { dg-message "note: the value of the stack pointer after an 'asm' statement must be the same as it was before the statement" "" { target pru-*-* } .+1 } */ |
| 17 |
asm volatile( |
| 18 |
"ldi %[res], 101 \n\t" |
| 19 |
: [res] "=r" (res) |
| 20 |
: |
| 21 |
: "sp"); |
| 22 |
|
| 23 |
return res; |
| 24 |
} |