gcc/testsuite/gcc.dg/tree-ssa/pr114760-2.c
raw| 1 | /* PR tree-optimization/114760 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-require-effective-target clz } */ |
| 4 | /* { dg-options "-O3 -fdump-tree-optimized" } */ |
| 5 | |
| 6 | // Check that for signed type, there's no CLZ. |
| 7 | #define PREC (__CHAR_BIT__ * __SIZEOF_INT__) |
| 8 | int |
| 9 | no_nlz32 (int b) { |
| 10 | int c = PREC; |
| 11 | |
| 12 | while (b != 0) { |
| 13 | b /= 2; |
| 14 | c --; |
| 15 | } |
| 16 | |
| 17 | return c; |
| 18 | } |
| 19 | |
| 20 | /* { dg-final { scan-tree-dump-not "__builtin_ctz|\\.CLZ" "optimized" } } */ |