1 /* Check that the negc instruction is generated as expected for the cases
2 below. If we see a movrt or #-1 negc sequence it means that the pattern
3 which handles the inverted case does not work properly. */
4 /* { dg-do compile } */
5 /* { dg-options "-O1" } */
6 /* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
7 /* { dg-final { scan-assembler-times "negc" 10 } } */
8 /* { dg-final { scan-assembler-not "movrt|#-1|add|sub" } } */
11 test00 (int a
, int b
, int* x
)
13 return (a
== b
) ? 0x7FFFFFFF : 0x80000000;
17 test00_inv (int a
, int b
)
19 return (a
!= b
) ? 0x80000000 : 0x7FFFFFFF;
25 return (a
>= b
) ? 0x7FFFFFFF : 0x80000000;
29 test01_inv (int a
, int b
)
31 return (a
< b
) ? 0x80000000 : 0x7FFFFFFF;
37 return (a
> b
) ? 0x7FFFFFFF : 0x80000000;
41 test02_inv (int a
, int b
)
43 return (a
<= b
) ? 0x80000000 : 0x7FFFFFFF;
49 return ((a
& b
) == 0) ? 0x7FFFFFFF : 0x80000000;
53 test03_inv (int a
, int b
)
55 return ((a
& b
) != 0) ? 0x80000000 : 0x7FFFFFFF;
61 return ((a
& 0x55) == 0) ? 0x7FFFFFFF : 0x80000000;
67 return ((a
& 0x55) != 0) ? 0x80000000 : 0x7FFFFFFF;