1 /* Test that we can remove the conditional move due to CLZ
2 being defined at zero. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target arm_arch_v6t2_ok } */
6 /* { dg-options "-O2" } */
7 /* { dg-add-options arm_arch_v6t2 } */
12 return (i
== 0) ? 32 : __builtin_ctz (i
);
18 return (i
!= 0) ? __builtin_ctz (i
) : 32;
22 fooctz3 (unsigned int i
)
24 return (i
> 0) ? __builtin_ctz (i
) : 32;
27 /* { dg-final { scan-assembler-times "rbit\t*" 3 } } */
32 return (i
== 0) ? 32 : __builtin_clz (i
);
38 return (i
!= 0) ? __builtin_clz (i
) : 32;
42 fooclz3 (unsigned int i
)
44 return (i
> 0) ? __builtin_clz (i
) : 32;
47 /* { dg-final { scan-assembler-times "clz\t" 6 } } */
48 /* { dg-final { scan-assembler-not "cmp\t.*0" } } */