Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr54236-3.c
blobfc0d111a9e9dba79ec23c7a4c0a35bc7a51baaf7
1 /* Tests to check the utilization of the addc and subc instructions.
2 If everything works as expected we won't see any movt instructions in
3 these cases. */
4 /* { dg-do compile } */
5 /* { dg-options "-O1" } */
6 /* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */
7 /* { dg-final { scan-assembler-times "addc" 1 } } */
8 /* { dg-final { scan-assembler-times "subc" 1 } } */
9 /* { dg-final { scan-assembler-not "movt" } } */
11 int
12 test_000 (int* x, unsigned int c)
14 /* 1x addc */
15 int s = 0;
16 unsigned int i;
17 for (i = 0; i < c; ++i)
18 s += ! (x[i] & 0x3000);
19 return s;
22 int
23 test_001 (int* x, unsigned int c)
25 /* 1x subc */
26 int s = 0;
27 unsigned int i;
28 for (i = 0; i < c; ++i)
29 s -= ! (x[i] & 0x3000);
30 return s;