2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / lr_free_1.c
blob50dcf04e69732a9d231d4e655994523b3aa2a05a
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" } */
4 extern void abort ();
6 int
7 dec (int a, int b)
9 return a + b;
12 int
13 cal (int a, int b)
15 int sum1 = a * b;
16 int sum2 = a / b;
17 int sum = dec (sum1, sum2);
18 return a + b + sum + sum1 + sum2;
21 int
22 main (int argc, char **argv)
24 int ret = cal (2, 1);
26 if (ret != 11)
27 abort ();
29 return 0;
32 /* { dg-final { scan-assembler-times "str\tx30, \\\[sp, -\[0-9\]+\\\]!" 2 } } */
33 /* { dg-final { scan-assembler "str\tw30, \\\[sp, \[0-9\]+\\\]" } } */
35 /* { dg-final { scan-assembler "ldr\tw30, \\\[sp, \[0-9\]+\\\]" } } */
36 /* { dg-final { scan-assembler-times "ldr\tx30, \\\[sp\\\], \[0-9\]+" 2 } } */