| 1 | ! audit31 Finding 14: `iand(val_c_long, not(int(z'400', c_int)))` |
| 2 | ! tripped the IR verifier with "bitwise op: operand width mismatch |
| 3 | ! i64 vs i32". F2018 §16.9.104 doesn't require iand/ior/ieor to |
| 4 | ! receive same-kind operands; unify operand widths before emitting |
| 5 | ! the bit_and. Task #495. |
| 6 | ! CHECK: 768 |
| 7 | program audit31_mixed_kind_bitwise |
| 8 | use iso_c_binding |
| 9 | implicit none |
| 10 | integer(c_long) :: val = int(z'700', c_long) |
| 11 | integer(c_int) :: mask |
| 12 | mask = int(z'400', c_int) |
| 13 | print *, iand(val, int(not(mask), c_long)) |
| 14 | end program |
| 15 |