Merge aosp-toolchain/gcc/gcc-4_9 changes.
[official-gcc.git] / gcc-4_9 / gcc / testsuite / gcc.target / sh / pr51244-12.c
blobda941015cc8aa592ac6d09dd5294b839c5b83fa0
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" } } */
10 int
11 test00 (int a, int b, int* x)
13 return (a == b) ? 0x7FFFFFFF : 0x80000000;
16 int
17 test00_inv (int a, int b)
19 return (a != b) ? 0x80000000 : 0x7FFFFFFF;
22 int
23 test01 (int a, int b)
25 return (a >= b) ? 0x7FFFFFFF : 0x80000000;
28 int
29 test01_inv (int a, int b)
31 return (a < b) ? 0x80000000 : 0x7FFFFFFF;
34 int
35 test02 (int a, int b)
37 return (a > b) ? 0x7FFFFFFF : 0x80000000;
40 int
41 test02_inv (int a, int b)
43 return (a <= b) ? 0x80000000 : 0x7FFFFFFF;
46 int
47 test03 (int a, int b)
49 return ((a & b) == 0) ? 0x7FFFFFFF : 0x80000000;
52 int
53 test03_inv (int a, int b)
55 return ((a & b) != 0) ? 0x80000000 : 0x7FFFFFFF;
58 int
59 test04 (int a)
61 return ((a & 0x55) == 0) ? 0x7FFFFFFF : 0x80000000;
64 int
65 test04_inv (int a)
67 return ((a & 0x55) != 0) ? 0x80000000 : 0x7FFFFFFF;