| 1 |
! Test that actual logical arguments convert to the right kind when it is non-default |
| 2 |
! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s |
| 3 |
! RUN: %flang_fc1 -fdebug-unparse -fdefault-integer-8 %s 2>&1 | FileCheck %s --check-prefixes CHECK-8 |
| 4 |
|
| 5 |
module m |
| 6 |
interface foog |
| 7 |
subroutine foo4(l) |
| 8 |
logical(kind=4), intent(in) :: l |
| 9 |
end subroutine foo4 |
| 10 |
|
| 11 |
subroutine foo8(l) |
| 12 |
logical(kind=8), intent(in) :: l |
| 13 |
end subroutine foo8 |
| 14 |
end interface foog |
| 15 |
end module m |
| 16 |
|
| 17 |
program main |
| 18 |
use m |
| 19 |
integer :: x(10), y |
| 20 |
! CHECK: CALL foo(.true._4) |
| 21 |
! CHECK-8: CALL foo(logical(.true._4,kind=8)) |
| 22 |
call foo(1 < 2) |
| 23 |
! CHECK: CALL fooa(x>y) |
| 24 |
! CHECK-8: CALL fooa(logical(x>y,kind=8)) |
| 25 |
call fooa(x > y) |
| 26 |
|
| 27 |
! Ensure that calls to interfaces call the correct subroutine |
| 28 |
! CHECK: CALL foo4(.true._4) |
| 29 |
! CHECK-8: CALL foo8(.true._8) |
| 30 |
call foog(.true.) |
| 31 |
|
| 32 |
contains |
| 33 |
subroutine foo(l) |
| 34 |
logical :: l |
| 35 |
end subroutine foo |
| 36 |
|
| 37 |
subroutine fooa(l) |
| 38 |
logical :: l(10) |
| 39 |
end subroutine fooa |
| 40 |
|
| 41 |
end program main |