Fortran · 591 bytes Raw Blame History
1 ! audit31 Finding 13: `.and.` / `.or.` on a derived-type LOGICAL
2 ! component tripped the verifier with "operands must be Bool
3 ! (i8 / bool)". The component loads as i8 (the stored byte), and
4 ! coerce_to_type's Int→Bool arm was emitting `int_trunc` which
5 ! produced a value of type i8, not Bool. Rework Int→Bool to emit
6 ! `icmp ne val, 0` so the result IS a Bool. Task #494.
7 ! CHECK: T
8 program audit31_logical_i8
9 implicit none
10 type :: rec_t
11 logical :: active
12 end type
13 type(rec_t) :: r
14 logical :: ok
15 r%active = .true.
16 ok = r%active .and. .true.
17 print *, ok
18 end program
19