llvm-project/flang/test/Semantics/declarations01.f90
PeixinQiao 1f17a8978c [flang] Add one missed semantic check for named constant in common block
As Fortran 2018 R874, common block object must be one variable name, which
cannot be one named constant. Add this check.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D126762
2022-06-09 00:43:30 +08:00

14 lines
338 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! test named constant declarations
function f1() result(x)
!ERROR: A function result may not also be a named constant
integer, parameter :: x = 1
integer, parameter :: x2 = 1
integer :: x3
!ERROR: A named constant 'x2' may not appear in a COMMON block
common /blk/ x2, x3
end