view gcc/testsuite/gfortran.dg/do_5.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
!
! PR fortran/54370
!
! The following program was ICEing at tree-check time
! "L()" was regarded as default-kind logical.
!
! Contributed by Kirill Chilikin
!
      MODULE M
      CONTAINS

      LOGICAL(C_BOOL) FUNCTION L() BIND(C)
      USE, INTRINSIC :: ISO_C_BINDING
      L = .FALSE.
      END FUNCTION

      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'" }
      L2 = .FALSE._8
      END FUNCTION

      SUBROUTINE S()
      DO WHILE (L())
      ENDDO
      DO WHILE (L2())
      ENDDO
      END

      END