Add three semantics tests for lock-stmt. The first includes
standard-conforming statements, the second includes
non-standard-conforming statements because of syntax errors,
and the third includes non-standard-conforming statements
because of semantic errors, such as type or rank mismatches.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
In order check constraint C1608 in the Fortran 2018 standard, let's add a check that flang accepts the following with and without the allocatable attribute
use iso_fortran_env type foo type(lock_type), allocatable :: bar end type type(foo) foobar[*] end
which gfortran rejects when the allocatable attribute is present but the NAG (nagfor) compiler correctly accepts either way.
Have you looked into whether there's a useful way to test constraint C1607, .e.g, with
type(lock_type)=, parameter :: const[*]=0
which seems not so useful because a parameter can't be be a coarray and a lock_type entity must be a coarray, but it's possible there's better way to test the constraint or it's possible the constraint is redundant because of C1608.
@rouson Thanks for the review. I have landed this patch and based on your suggestion, I will work on a separate test and separate differential where I will test the different possibilities for declarations of type lock_type and testing the constraints that you referenced.