gcc/testsuite/gcc.target/i386/pr78037.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-require-effective-target bmi } */ |
| 3 | /* { dg-options "-O2 -mbmi" } */ |
| 4 | |
| 5 | #include <x86intrin.h> |
| 6 | |
| 7 | #include "bmi-check.h" |
| 8 | |
| 9 | int |
| 10 | __attribute__((noinline, noclone)) |
| 11 | foo (int x) |
| 12 | { |
| 13 | return __tzcnt_u32 (x) & 0x1f; |
| 14 | } |
| 15 | |
| 16 | static void |
| 17 | bmi_test () |
| 18 | { |
| 19 | if (foo (0) != 0) |
| 20 | abort (); |
| 21 | } |