Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr116896.c

raw
1 /* PR middle-end/116896 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -masm=att -fno-stack-protector" } */
4 /* { dg-final { scan-assembler-times "\tjp\t" 2 } } */
5 /* { dg-final { scan-assembler-not "\tj\[^mp\]\[a-z\]*\t" } } */
6 /* { dg-final { scan-assembler-times "\tsbb\[bl\]\t\\\$0, " 4 } } */
7 /* { dg-final { scan-assembler-times "\tseta\t" 4 } } */
8
9 signed char
10 foo (float x, float y)
11 {
12 if (x == y)
13 return 0;
14 else if (x < y)
15 return -1;
16 else if (x > y)
17 return 1;
18 else
19 return 2;
20 }
21
22 __attribute__((optimize ("fast-math"))) signed char
23 bar (float x, float y)
24 {
25 if (x == y)
26 return 0;
27 else if (x < y)
28 return -1;
29 else if (x > y)
30 return 1;
31 else
32 return 2;
33 }
34
35 signed char
36 baz (float x, float y)
37 {
38 if (x == y)
39 return 0;
40 else if (x < y)
41 return -1;
42 else if (x > y)
43 return 1;
44 else
45 return -127;
46 }
47
48 __attribute__((optimize ("fast-math"))) signed char
49 qux (float x, float y)
50 {
51 if (x == y)
52 return 0;
53 else if (x < y)
54 return -1;
55 else if (x > y)
56 return 1;
57 else
58 return -127;
59 }