2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr51244-5.c
blob4c7d5bf26f0f96b1a9016c90e7ebb65e43e12ff5
1 /* Check that no unnecessary sign or zero extension insn is generated after
2 a negc or movrt insn that stores the inverted T bit in a reg. */
3 /* { dg-do compile } */
4 /* { dg-options "-O2" } */
5 /* { dg-final { scan-assembler-not "extu|exts" } } */
7 int
8 test_00 (int a, int b, int* c, short* d, int x)
10 *d = x != 0;
11 *c = -1;
13 if (x != 0)
14 return a > 0;
16 return 0;
19 unsigned char
20 test_01 (int x)
22 if (x < 58 && x > 47)
23 return 1;
24 return 0;
27 char
28 test_02 (int x)
30 if (x < 58 && x > 47)
31 return 1;
32 return 0;
35 unsigned short
36 test_03 (int x)
38 if (x < 58 && x > 47)
39 return 1;
40 return 0;
43 short
44 test_04 (int x)
46 if (x < 58 && x > 47)
47 return 1;
48 return 0;