2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sbc.c
blob7a2eb998f7df54bbd9559592767e8c02b7d6b244
1 /* { dg-do run } */
2 /* { dg-options "-O2 --save-temps" } */
4 extern void abort (void);
6 typedef unsigned int u32int;
7 typedef unsigned long long u64int;
9 u32int
10 test_si (u32int w1, u32int w2, u32int w3, u32int w4)
12 u32int w0;
13 /* { dg-final { scan-assembler "sbc\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+\n" } } */
14 w0 = w1 - w2 - (w3 < w4);
15 return w0;
18 u64int
19 test_di (u64int x1, u64int x2, u64int x3, u64int x4)
21 u64int x0;
22 /* { dg-final { scan-assembler "sbc\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+\n" } } */
23 x0 = x1 - x2 - (x3 < x4);
24 return x0;
27 int
28 main ()
30 u32int x;
31 u64int y;
32 x = test_si (7, 8, 12, 15);
33 if (x != -2)
34 abort();
35 y = test_di (0x987654321ll, 0x123456789ll, 0x345345345ll, 0x123123123ll);
36 if (y != 0x8641fdb98ll)
37 abort();
38 return 0;