Files
clang-p2996/flang/test/Semantics/call26.f90
Daniil Dudkin 8867e83d00 [flang] Fix ICE for passing a label for non alternate return arguments
When we pass an alternate return specifier to a regular (not an asterisk)
dummy argument, flang would throw an internal compiler error of
derefencing a null pointer.
To avoid the ICE, a check was added.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D123947
2022-05-04 12:32:33 +03:00

18 lines
553 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
module m
contains
subroutine simple_arg(x)
integer, intent(in) :: x
end subroutine simple_arg
subroutine procedure_arg(x)
procedure(simple_arg) :: x
end subroutine procedure_arg
subroutine s
!ERROR: Alternate return label '42' cannot be associated with dummy argument 'x='
call simple_arg(*42)
!ERROR: Alternate return label '42' cannot be associated with dummy argument 'x='
call procedure_arg(*42)
42 stop
end subroutine s
end module m