gcc/testsuite/gcc.target/i386/apx-pr124892.c
raw| 1 | /* PR target/124892 */ |
| 2 | /* { dg-do run { target { apxf && { lzcnt && { ! ia32 } } } } } */ |
| 3 | /* { dg-options "-O2 -frename-registers" } */ |
| 4 | |
| 5 | [[gnu::noipa, gnu::target ("apxf"), gnu::target ("lzcnt")]] char |
| 6 | foo (unsigned u) |
| 7 | { |
| 8 | return __builtin_stdc_bit_ceil (u); |
| 9 | } |
| 10 | |
| 11 | int |
| 12 | main () |
| 13 | { |
| 14 | if (!__builtin_cpu_supports ("apxf")) |
| 15 | return 0; |
| 16 | if (!__builtin_cpu_supports ("lzcnt")) |
| 17 | return 0; |
| 18 | if (foo (7) != 8) |
| 19 | __builtin_abort (); |
| 20 | } |