| 1 |
/* { dg-options "-msave-restore" } */ |
| 2 |
/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Og" } } */ |
| 3 |
|
| 4 |
/* This test covers a case where we can't (currently) remove the calls to |
| 5 |
the save/restore stubs. The cast of the return value from BAR requires |
| 6 |
a zero extension between the call to BAR, and the return from FOO, this |
| 7 |
currently prevents the removal of the save/restore calls. */ |
| 8 |
|
| 9 |
typedef unsigned long long u_64; |
| 10 |
typedef unsigned int u_32; |
| 11 |
|
| 12 |
extern u_32 bar (u_32 arg); |
| 13 |
|
| 14 |
u_64 foo (u_32 arg) |
| 15 |
{ |
| 16 |
return (u_64) bar (arg); |
| 17 |
} |
| 18 |
|
| 19 |
/* { dg-final { scan-assembler "call\[ \t\]*t0,__riscv_save_0" } } */ |
| 20 |
/* { dg-final { scan-assembler "tail\[ \t\]*__riscv_restore_0" } } */ |