52 lines · plain
1! Test that actual logical arguments convert to the right kind when it is non-default2! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s3! RUN: %flang_fc1 -fdebug-unparse -fdefault-integer-8 %s 2>&1 | FileCheck %s --check-prefixes CHECK-84 5module m6 interface foog7 subroutine foo4(l)8 logical(kind=4), intent(in) :: l9 end subroutine foo410 subroutine foo8(l)11 logical(kind=8), intent(in) :: l12 end subroutine foo813 end interface foog14end module m15 16program main17 use m18 integer :: x(10), y19 20 ! CHECK: CALL foo(.true._4)21 ! CHECK-8: CALL foo(.true._8)22 call foo(.true.)23 ! CHECK: CALL foo(.true._4)24 ! CHECK-8: CALL foo(.true._8)25 call foo(1 < 2)26 ! CHECK: CALL foo(x(1_8)>y)27 ! CHECK-8: CALL foo(logical(x(1_8)>y,kind=8))28 call foo(x(1) > y)29 ! CHECK: CALL fooa(x>y)30 ! CHECK-8: CALL fooa(logical(x>y,kind=8))31 call fooa(x > y)32 33 ! Ensure that calls to interfaces call the correct subroutine34 ! CHECK: CALL foo4(.true._4)35 ! CHECK-8: CALL foo8(.true._8)36 call foog(.true.)37 ! CHECK: CALL foo4(.true._4)38 ! CHECK-8: CALL foo8(.true._8)39 call foog(1 < 2)40 ! CHECK: CALL foo4(x(1_8)>y)41 ! CHECK-8: CALL foo8(logical(x(1_8)>y,kind=8))42 call foog(x(1) > y)43 44 contains45 subroutine foo(l)46 logical :: l47 end subroutine foo48 subroutine fooa(l)49 logical :: l(10)50 end subroutine fooa51end program main52