gcc/testsuite/gcc.target/avr/pr114975-popcount.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-additional-options "-Os" } */ |
| 3 | |
| 4 | typedef __UINT8_TYPE__ uint8_t; |
| 5 | |
| 6 | uint8_t use_pop1 (int y, uint8_t x) |
| 7 | { |
| 8 | return 1 + __builtin_popcount (x); |
| 9 | } |
| 10 | |
| 11 | uint8_t use_pop2 (uint8_t x) |
| 12 | { |
| 13 | x += 1; |
| 14 | return 1 - __builtin_popcount (x); |
| 15 | } |
| 16 | |
| 17 | /* { dg-final { scan-assembler-times "__popcountqi2" 2 } } */ |