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_v5_ok } */
6 /* { dg-options "-O2" } */
11 return (i
== 0) ? 32 : __builtin_ctz (i
);
17 return (i
!= 0) ? __builtin_ctz (i
) : 32;
21 fooctz3 (unsigned int i
)
23 return (i
> 0) ? __builtin_ctz (i
) : 32;
26 /* { dg-final { scan-assembler-times "rbit\t*" 3 } } */
31 return (i
== 0) ? 32 : __builtin_clz (i
);
37 return (i
!= 0) ? __builtin_clz (i
) : 32;
41 fooclz3 (unsigned int i
)
43 return (i
> 0) ? __builtin_clz (i
) : 32;
46 /* { dg-final { scan-assembler-times "clz\t" 6 } } */
47 /* { dg-final { scan-assembler-not "cmp\t.*0" } } */