| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-fno-inline -O2 -fomit-frame-pointer -ffixed-x2 -ffixed-x3 -ffixed-x4 -ffixed-x5 -ffixed-x6 -ffixed-x7 -ffixed-x8 -ffixed-x9 -ffixed-x10 -ffixed-x11 -ffixed-x12 -ffixed-x13 -ffixed-x14 -ffixed-x15 -ffixed-x16 -ffixed-x17 -ffixed-x18 -ffixed-x19 -ffixed-x20 -ffixed-x21 -ffixed-x22 -ffixed-x23 -ffixed-x24 -ffixed-x25 -ffixed-x26 -ffixed-x27 -ffixed-28 -ffixed-29 --save-temps -mgeneral-regs-only -fno-ipa-cp -fno-schedule-fusion -fno-peephole2 --param=aarch64-stp-policy=never" } */ |
| 3 |
|
| 4 |
extern void abort (); |
| 5 |
|
| 6 |
int |
| 7 |
dec (int a, int b) |
| 8 |
{ |
| 9 |
return a + b; |
| 10 |
} |
| 11 |
|
| 12 |
int |
| 13 |
cal (int a, int b) |
| 14 |
{ |
| 15 |
int sum1 = a * b; |
| 16 |
int sum2 = a / b; |
| 17 |
int sum = dec (sum1, sum2); |
| 18 |
return a + b + sum + sum1 + sum2; |
| 19 |
} |
| 20 |
|
| 21 |
int |
| 22 |
main (int argc, char **argv) |
| 23 |
{ |
| 24 |
int ret = cal (2, 1); |
| 25 |
|
| 26 |
if (ret != 11) |
| 27 |
abort (); |
| 28 |
|
| 29 |
return 0; |
| 30 |
} |
| 31 |
|
| 32 |
/* { dg-final { scan-assembler-times "str\tx30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */ |
| 33 |
/* { dg-final { scan-assembler "str\tw30, \\\[sp, \[0-9\]+\\\]" } } */ |
| 34 |
|
| 35 |
/* { dg-final { scan-assembler "ldr\tw30, \\\[sp, \[0-9\]+\\\]" } } */ |
| 36 |
/* { dg-final { scan-assembler-times "ldr\tx30, \\\[sp\\\], \[0-9\]+" 2 } } */ |
| 37 |
|