gcc/testsuite/gcc.target/i386/bmi2-pr112518.c
raw| 1 | /* PR target/112518 */ |
| 2 | /* { dg-do run { target { bmi2 && int128 } } } */ |
| 3 | /* { dg-options "-Os -mbmi2" } */ |
| 4 | |
| 5 | #include "bmi2-check.h" |
| 6 | |
| 7 | unsigned u; |
| 8 | int g; |
| 9 | |
| 10 | unsigned long long |
| 11 | foo (int i) |
| 12 | { |
| 13 | unsigned long long x = u; |
| 14 | g = __builtin_mul_overflow_p (u, ((unsigned __int128) 4292468825) << 64 | 150, 0); |
| 15 | x |= g % i; |
| 16 | return x; |
| 17 | } |
| 18 | |
| 19 | static __attribute__((noipa)) void |
| 20 | bmi2_test () |
| 21 | { |
| 22 | unsigned long long x = foo (3); |
| 23 | if (x) |
| 24 | __builtin_abort (); |
| 25 | } |