Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / subs3.c
blob90f20b8439106c41c4f0c29ea398b1362a399430
1 /* { dg-do run } */
2 /* { dg-options "-O2 --save-temps -fno-inline" } */
4 extern void abort (void);
5 typedef long long s64;
7 int
8 subs_ext (s64 a, int b, int c)
10 s64 d = a - b;
12 if (d == 0)
13 return a + c;
14 else
15 return b + d + c;
18 int
19 subs_shift_ext (s64 a, int b, int c)
21 s64 d = (a - ((s64)b << 3));
23 if (d == 0)
24 return a + c;
25 else
26 return b + d + c;
29 int main ()
31 int x;
32 s64 y;
34 x = subs_ext (0x13000002ll, 41, 15);
35 if (x != 318767121)
36 abort ();
38 x = subs_ext (0x50505050ll, 29, 4);
39 if (x != 1347440724)
40 abort ();
42 x = subs_ext (0x12121212121ll, 2, 14);
43 if (x != 555819311)
44 abort ();
46 x = subs_shift_ext (0x123456789ll, 4, 12);
47 if (x != 591751033)
48 abort ();
50 x = subs_shift_ext (0x02020202ll, 9, 8);
51 if (x != 33685963)
52 abort ();
54 x = subs_shift_ext (0x987987987987ll, 23, 41);
55 if (x != -2020050673)
56 abort ();
58 return 0;
61 /* { dg-final { scan-assembler-times "subs\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+, sxtw" 2 } } */