[gcc]
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr54089-9.c
blob3ced51eecf4b2702f6c6918dc6c2fe86f17a2afe
1 /* Check that the rotcr instruction is generated. */
2 /* { dg-do compile } */
3 /* { dg-options "-O1" } */
4 /* { dg-final { scan-assembler-times "rotcl" 4 } } */
5 /* { dg-final { scan-assembler-not "movt" } } */
6 /* { dg-final { scan-assembler-not "or\t" } } */
7 /* { dg-final { scan-assembler-not "rotl" } } */
8 /* { dg-final { scan-assembler-not "and" } } */
10 typedef char bool;
12 int
13 test_00 (int* a, int* b)
15 int i;
16 int r = 0;
17 for (i = 0; i < 16; ++i)
19 bool t = a[i] == b[i];
20 r = (r << 1) | t;
22 return r;
25 int
26 test_01 (int* a, int* b)
28 int i;
29 int r = 0;
30 for (i = 0; i < 16; ++i)
32 bool t = a[i] == b[i];
33 r = (r << 2) | t;
35 return r;
38 int
39 test_02 (int* a, int* b)
41 int i;
42 int r = 0;
43 for (i = 0; i < 16; ++i)
45 bool t = a[i] == b[i];
46 r = (r << 3) | t;
48 return r;
51 int
52 test_03 (const bool* a)
54 int i;
55 int r = 0;
56 for (i = 0; i < 16; ++i)
58 bool t = a[i];
59 r = (r << 1) | (t & 1);
61 return r;