1! { dg-do compile }
2!
3! PR fortran/54370
4!
5! The following program was ICEing at tree-check time
6! "L()" was regarded as default-kind logical.
7!
8! Contributed by Kirill Chilikin
9!
10      MODULE M
11      CONTAINS
12
13      LOGICAL(C_BOOL) FUNCTION L() BIND(C)
14      USE, INTRINSIC :: ISO_C_BINDING
15      L = .FALSE.
16      END FUNCTION
17
18      LOGICAL(8) FUNCTION L2() BIND(C) ! { dg-warning "GNU Extension: LOGICAL result variable 'l2' at .1. with non-C_Bool kind in BIND.C. procedure 'l2'" }
19      L2 = .FALSE._8
20      END FUNCTION
21
22      SUBROUTINE S()
23      DO WHILE (L())
24      ENDDO
25      DO WHILE (L2())
26      ENDDO
27      END
28
29      END
30