2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr85095-2.c
blobfbd7992bf4fb9fd143c93f64431a6439afbffc79
1 /* PR target/85095 *
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -masm=att" } */
5 unsigned int
6 f1 (unsigned int a, unsigned int b)
8 unsigned int i = __builtin_add_overflow (a, b, &a);
9 return a + i;
12 unsigned int
13 f2 (unsigned int a, unsigned int b)
15 unsigned int i = __builtin_add_overflow (a, b, &a);
16 return a - i;
19 #ifdef __x86_64__
20 unsigned long long
21 f3 (unsigned long long a, unsigned long long b)
23 unsigned long long i = __builtin_add_overflow (a, b, &a);
24 return a + i;
27 unsigned long long
28 f4 (unsigned long long a, unsigned long long b)
30 unsigned long long i = __builtin_add_overflow (a, b, &a);
31 return a - i;
34 unsigned long long
35 f5 (unsigned int a, unsigned int b)
37 unsigned int i = __builtin_add_overflow (a, b, &a);
38 return a + i;
41 unsigned long long
42 f6 (unsigned int a, unsigned int b)
44 unsigned int i = __builtin_add_overflow (a, b, &a);
45 return a - i;
47 #endif
49 /* { dg-final { scan-assembler-times "adcl\t\\\$0," 1 { target ia32 } } } */
50 /* { dg-final { scan-assembler-times "sbbl\t\\\$0," 1 { target ia32 } } } */
51 /* { dg-final { scan-assembler-times "adcl\t\\\$0," 2 { target { ! ia32 } } } } */
52 /* { dg-final { scan-assembler-times "sbbl\t\\\$0," 2 { target { ! ia32 } } } } */
53 /* { dg-final { scan-assembler-times "adcq\t\\\$0," 1 { target { ! ia32 } } } } */
54 /* { dg-final { scan-assembler-times "sbbq\t\\\$0," 1 { target { ! ia32 } } } } */