* gcc.target/i386/pr70021.c: Add -mtune=skylake.
[official-gcc.git] / gcc / testsuite / gcc.target / visium / overflow8.c
blob5761e3ed9e851cee59ffb1c5ed3f035fae3a314a
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 #include <stdbool.h>
6 bool my_uadd_overflow (unsigned char a, unsigned char b, unsigned char *res)
8 return __builtin_add_overflow (a, b, res);
11 bool my_usub_overflow (unsigned char a, unsigned char b, unsigned char *res)
13 return __builtin_sub_overflow (a, b, res);
16 bool my_uneg_overflow (unsigned char a, unsigned char *res)
18 return __builtin_sub_overflow (0, a, res);
21 bool my_add_overflow (signed char a, signed char b, signed char *res)
23 return __builtin_add_overflow (a, b, res);
26 bool my_sub_overflow (signed char a, signed char b, signed char *res)
28 return __builtin_sub_overflow (a, b, res);
31 bool my_neg_overflow (signed char a, signed char *res)
33 return __builtin_sub_overflow (0, a, res);
36 /* { dg-final { scan-assembler-times "add.b" 2 } } */
37 /* { dg-final { scan-assembler-times "sub.b" 4 } } */
38 /* { dg-final { scan-assembler-not "cmp.b" } } */
39 /* { dg-final { scan-assembler-not "mov.b" } } */