brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 0acf233 Raw
56 lines · plain
1! RUN: not %flang_fc1 -pedantic %s 2>&1 | FileCheck %s2! Test extension: allow forward references to dummy arguments or COMMON3! from specification expressions in scopes with IMPLICIT NONE(TYPE),4! as long as those symbols are eventually typed later.5 6!CHECK: warning: 'n1' was used without (or before) being explicitly typed7!CHECK: error: No explicit type declared for dummy argument 'n1'8subroutine foo1(a, n1)9  implicit none10  real a(n1)11end12 13!CHECK: warning: 'n2' was used without (or before) being explicitly typed14subroutine foo2(a, n2)15  implicit none16  real a(n2)17!CHECK: error: The type of 'n2' has already been implicitly declared18  double precision n219end20 21!CHECK: warning: 'n3a' was used under IMPLICIT NONE(TYPE) before being explicitly typed22!CHECK: warning: 'n3b' was used under IMPLICIT NONE(TYPE) before being explicitly typed23!CHECK-NOT: error: Dummy argument 'n3a'24!CHECK-NOT: error: Dummy argument 'n3b'25subroutine foo3(a, n3a, n3b)26  implicit none27  integer a(n3a, n3b)28  integer n3a29  integer(8) n3b30end31 32!CHECK: warning: 'n4' was used without (or before) being explicitly typed33!CHECK: error: No explicit type declared for 'n4'34subroutine foo4(a)35  implicit none36  real a(n4)37  common /b4/ n438end39 40!CHECK: warning: 'n5' was used without (or before) being explicitly typed41subroutine foo5(a)42  implicit none43  real a(n5)44  common /b5/ n545!CHECK: error: The type of 'n5' has already been implicitly declared46  double precision n547end48 49!CHECK: warning: 'n6' was used without (or before) being explicitly typed50subroutine foo6(a)51  implicit none52  real a(n6)53  common /b6/ n654  integer n655end56