1 /* Test whether an AND mask or'ed with the know zero bits that equals a mode
2 mask is a candidate for zero extendion. */
4 /* Note: This test requires that char, int and long have different sizes and the
5 target has a way to do 32 -> 64 bit zero extension other than AND. */
7 /* { dg-do compile { target i?86-*-* x86_64-*-* s390*-*-* } } */
8 /* { dg-require-effective-target lp64 } */
9 /* { dg-options "-O3 -dP" } */
11 unsigned long foo (unsigned char c
)
16 i
= ((unsigned int)c
) << 8;
17 i
|= ((unsigned int)c
) << 20;
26 unsigned long bar (unsigned char c
)
31 i
= ((unsigned int)c
) << 8;
32 i
|= ((unsigned int)c
) << 20;
41 /* Check that no pattern containing an AND expression was used. */
42 /* { dg-final { scan-assembler-not "\\(and:" { target { ! { s390*-*-* } } } } } */
43 /* { dg-final { scan-assembler-not "\\tng?rk?\\t" { target { s390*-*-* } } } } */