[TableGen][SystemZ] Correctly check the range of a leaf immediate (#119931)
[llvm-project.git] / flang / test / Semantics / resolve81.f90
blobdb5b19f1155ea40e1fafaad386ec6a8bbdfc855e
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C801 The same attr-spec shall not appear more than once in a given
3 ! type-declaration-stmt.
5 ! R801 type-declaration-stmt ->
6 ! declaration-type-spec [[, attr-spec]... ::] entity-decl-list
7 ! attr-spec values are:
8 ! PUBLIC, PRIVATE, ALLOCATABLE, ASYNCHRONOUS, CODIMENSION, CONTIGUOUS,
9 ! DIMENSION (array-spec), EXTERNAL, INTENT (intent-spec), INTRINSIC,
10 ! BIND(C), OPTIONAL, PARAMETER, POINTER, PROTECTED, SAVE, TARGET, VALUE,
11 ! VOLATILE
12 module m
14 !WARNING: Attribute 'PUBLIC' cannot be used more than once
15 real, public, allocatable, public :: publicVar
16 !WARNING: Attribute 'PRIVATE' cannot be used more than once
17 real, private, allocatable, private :: privateVar
18 !WARNING: Attribute 'ALLOCATABLE' cannot be used more than once
19 real, allocatable, allocatable :: allocVar
20 !WARNING: Attribute 'ASYNCHRONOUS' cannot be used more than once
21 real, asynchronous, public, asynchronous :: asynchVar
22 !ERROR: Attribute 'CODIMENSION' cannot be used more than once
23 real, codimension[*], codimension[*] :: codimensionVar
24 !WARNING: Attribute 'CONTIGUOUS' cannot be used more than once
25 real, contiguous, pointer, contiguous :: contigVar(:)
26 !ERROR: Attribute 'DIMENSION' cannot be used more than once
27 real, dimension(5), dimension(5) :: arrayVar
28 !WARNING: Attribute 'EXTERNAL' cannot be used more than once
29 real, external, external :: externFunc
30 !WARNING: Attribute 'INTRINSIC' cannot be used more than once
31 !ERROR: 'cos' may not have both the BIND(C) and INTRINSIC attributes
32 !ERROR: An interface name with the BIND attribute must appear if the BIND attribute appears in a procedure declaration
33 real, intrinsic, bind(c), intrinsic :: cos
34 !WARNING: Attribute 'BIND(C)' cannot be used more than once
35 integer, bind(c), volatile, bind(c) :: bindVar
36 !WARNING: Attribute 'PARAMETER' cannot be used more than once
37 real, parameter, parameter :: realConst = 4.3
38 !WARNING: Attribute 'POINTER' cannot be used more than once
39 real, pointer, pointer :: realPtr
40 !WARNING: Attribute 'PROTECTED' cannot be used more than once
41 real, protected, protected :: realProt
42 !WARNING: Attribute 'SAVE' cannot be used more than once
43 real, save, save :: saveVar
44 !WARNING: Attribute 'TARGET' cannot be used more than once
45 real, target, target :: targetVar
46 !WARNING: Attribute 'VOLATILE' cannot be used more than once
47 real, volatile, volatile :: volatileVar
49 contains
50 subroutine testTypeDecl(arg1, arg2, arg3, arg4, arg5, arg6)
51 !WARNING: Attribute 'INTENT(IN)' cannot be used more than once
52 real, intent(in), intent(in) :: arg1
53 !WARNING: Attribute 'INTENT(OUT)' cannot be used more than once
54 real, intent(out), intent(out) :: arg2
55 !WARNING: Attribute 'INTENT(INOUT)' cannot be used more than once
56 real, intent(inout), intent(inout) :: arg3
57 !WARNING: Attribute 'OPTIONAL' cannot be used more than once
58 integer, optional, intent(in), optional :: arg4
59 !WARNING: Attribute 'VALUE' cannot be used more than once
60 integer, value, intent(in), value :: arg5
61 !ERROR: Attributes 'INTENT(IN)' and 'INTENT(INOUT)' conflict with each other
62 integer, intent(in), pointer, intent(inout) :: arg6
64 arg2 =3.5
65 end subroutine testTypeDecl
66 end module m