llvm-project/flang/test/Driver/fatal-errors-semantics.f90
Tarun Prabhu 03d8184d65
[flang][NFC] Strip trailing whitespace from tests (1 of N)
Only the fortran source files in flang/test have been modified. The
other files in the directory will be cleaned up in subsequent commits
2025-11-07 10:29:33 -07:00

40 lines
1.2 KiB
Fortran

! RUN: not %flang_fc1 %s 2>&1 | FileCheck %s --check-prefix=CHECK1
! RUN: not %flang_fc1 -Wfatal-errors %s 2>&1 | FileCheck %s --check-prefix=CHECK2
module m
contains
subroutine s0(p)
real, pointer, intent(in) :: p
end
subroutine s1(p)
real, pointer, intent(in) :: p(:)
end
subroutine sa(p)
real, pointer, intent(in) :: p(..)
end
subroutine sao(p)
real, intent(in), optional, pointer :: p(..)
end
subroutine soa(a)
real, intent(in), optional, allocatable :: a(..)
end
subroutine test
real, pointer :: a0, a1(:)
!CHECK1: fatal-errors-semantics.f90:{{.*}} error:
!CHECK2: fatal-errors-semantics.f90:{{.*}} error:
call s0(null(a1))
!CHECK1: fatal-errors-semantics.f90:{{.*}} error:
!CHECK2-NOT: error:
call s1(null(a0))
!CHECK1: fatal-errors-semantics.f90:{{.*}} error:
!CHECK2-NOT: error:
call sa(null())
!CHECK1: fatal-errors-semantics.f90:{{.*}} error:
!CHECK2-NOT: error:
call sao(null())
!CHECK1: fatal-errors-semantics.f90:{{.*}} error:
!CHECK2-NOT: error:
call soa(null())
end
end