File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,15 +11,26 @@ logical(C_BOOL) function logical_not(a) bind(C)
1111end function
1212end interface
1313
14- logical (C_BOOL) :: t, f
14+ logical (C_BOOL) :: tc, fc
15+ logical :: t0, f0, t1, f1
16+ ! ! show there's no warnings
1517
1618logical :: true_f, false_f
1719
18- t = .true.
19- f = .false.
20+ t0 = .true.
21+ f0 = .false.
22+ tc = t0
23+ fc = f0
24+ t1 = tc
25+ f1 = fc
2026
21- false_f = logical_not(t)
22- true_f = logical_not(f)
27+ if (.not. t1) error stop " logical(C_BOOL) .true. should be .true."
28+ if (.not. t1 .eqv. t0) error stop " logical(C_BOOL) .true. should EQV .true."
29+ if (f1) error stop " logical(C_BOOL) .false. should be .false."
30+ if (.not. f1 .eqv. f0) error stop " logical(C_BOOL) .false. should EQV .false."
31+
32+ false_f = logical_not(tc)
33+ true_f = logical_not(fc)
2334
2435if (false_f) error stop " logical_not(.true.) should be .false."
2536if (.not. true_f) error stop " logical_not(.false.) should be .true."
You can’t perform that action at this time.
0 commit comments