1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 extern const unsigned char mode_ibit
[];
5 extern const unsigned char mode_fbit
[];
6 extern const signed char smode_ibit
[];
7 extern const signed char smode_fbit
[];
9 /* We use bit-and rather than modulo to ensure we're actually
10 testing the desired match.pd pattern. */
14 int ret
= (mode_fbit
[indx
] - mode_ibit
[indx
]) & 3;
21 int ret
= (mode_fbit
[indx
] - mode_ibit
[indx
]) & 3;
28 int ret
= (smode_fbit
[indx
] - smode_ibit
[indx
]) & 3;
35 int ret
= (smode_fbit
[indx
] - smode_ibit
[indx
]) & 3;
43 int ret
= (mode_fbit
[indx
] + mode_ibit
[indx
]) & 3;
50 int ret
= (mode_fbit
[indx
] + mode_ibit
[indx
]) & 3;
57 int ret
= (smode_fbit
[indx
] + smode_ibit
[indx
]) & 3;
64 int ret
= (smode_fbit
[indx
] + smode_ibit
[indx
]) & 3;
68 /* The shortening patterns in match.pd should arrange to do the
69 arithmetic in char modes and thus any casts to ints should
71 /* { dg-final {scan-tree-dump-not "\\(int\\)" "optimized"} } */
73 /* We should have casted 4 operands from signed to unsigned char types. */
74 /* { dg-final {scan-tree-dump-times "\\(unsigned char\\)" 8 "optimized" } } */
76 /* And two return values should have been casted from unsigned char to
78 /* { dg-final {scan-tree-dump-times "\\(signed char\\)" 4 "optimized" } } */