mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 23:06:34 +00:00

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
14 lines
338 B
Fortran
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
|