Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / kinds02.f90
blobb02659e701f318d5f840b22f9f154550f158941e
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C712 The value of scalar-int-constant-expr shall be nonnegative and
3 ! shall specify a representation method that exists on the processor.
4 ! C714 The value of kind-param shall be nonnegative.
5 ! C715 The value of kind-param shall specify a representation method that
6 ! exists on the processor.
7 ! C719 The value of scalar-int-constant-expr shall be nonnegative and shall
8 ! specify a representation method that exists on the processor.
9 ! C725 The optional comma in a length-selector is permitted only if no
10 ! double-colon separator appears in the typedeclaration- stmt.
11 ! C727 The value of kind-param shall specify a representation method that
12 ! exists on the processor.
13 ! C728 The value of kind-param shall specify a representation method that
14 ! exists on the processor.
16 !ERROR: INTEGER(KIND=0) is not a supported type
17 integer(kind=0) :: j0
18 !ERROR: INTEGER(KIND=-1) is not a supported type
19 integer(kind=-1) :: jm1
20 !ERROR: INTEGER(KIND=3) is not a supported type
21 integer(kind=3) :: j3
22 !ERROR: INTEGER(KIND=32) is not a supported type
23 integer(kind=32) :: j32
24 !ERROR: REAL(KIND=0) is not a supported type
25 real(kind=0) :: a0
26 !ERROR: REAL(KIND=-1) is not a supported type
27 real(kind=-1) :: am1
28 !ERROR: REAL(KIND=1) is not a supported type
29 real(kind=1) :: a1
30 !ERROR: REAL(KIND=7) is not a supported type
31 real(kind=7) :: a7
32 !ERROR: REAL(KIND=32) is not a supported type
33 real(kind=32) :: a32
34 !ERROR: COMPLEX(KIND=0) is not a supported type
35 complex(kind=0) :: z0
36 !ERROR: COMPLEX(KIND=-1) is not a supported type
37 complex(kind=-1) :: zm1
38 !ERROR: COMPLEX(KIND=1) is not a supported type
39 complex(kind=1) :: z1
40 !ERROR: COMPLEX(KIND=7) is not a supported type
41 complex(kind=7) :: z7
42 !ERROR: COMPLEX(KIND=32) is not a supported type
43 complex(kind=32) :: z32
44 !ERROR: COMPLEX*1 is not a supported type
45 complex*1 :: zs1
46 !ERROR: COMPLEX*2 is not a supported type
47 complex*2 :: zs2
48 !ERROR: COMPLEX*64 is not a supported type
49 complex*64 :: zs64
50 !ERROR: LOGICAL(KIND=0) is not a supported type
51 logical(kind=0) :: l0
52 !ERROR: LOGICAL(KIND=-1) is not a supported type
53 logical(kind=-1) :: lm1
54 !ERROR: LOGICAL(KIND=3) is not a supported type
55 logical(kind=3) :: l3
56 !ERROR: LOGICAL(KIND=16) is not a supported type
57 logical(kind=16) :: l16
58 integer, parameter :: negOne = -1
59 !ERROR: unsupported LOGICAL(KIND=0)
60 logical :: lvar0 = .true._0
61 logical :: lvar1 = .true._1
62 logical :: lvar2 = .true._2
63 !ERROR: unsupported LOGICAL(KIND=3)
64 logical :: lvar3 = .true._3
65 logical :: lvar4 = .true._4
66 !ERROR: unsupported LOGICAL(KIND=5)
67 logical :: lvar5 = .true._5
68 !ERROR: unsupported LOGICAL(KIND=-1)
69 logical :: lvar6 = .true._negOne
70 character (len=99, kind=1) :: cvar1
71 character (len=99, kind=2) :: cvar2
72 character *4, cvar3
73 character *(5), cvar4
74 !ERROR: KIND value (3) not valid for CHARACTER
75 character (len=99, kind=3) :: cvar5
76 !ERROR: KIND value (-1) not valid for CHARACTER
77 character (len=99, kind=-1) :: cvar6
78 character(len=*), parameter :: cvar7 = 1_"abcd"
79 character(len=*), parameter :: cvar8 = 2_"abcd"
80 !ERROR: CHARACTER(KIND=3) is not a supported type
81 character(len=*), parameter :: cvar9 = 3_"abcd"
82 character(len=*), parameter :: cvar10 = 4_"abcd"
83 !ERROR: CHARACTER(KIND=8) is not a supported type
84 character(len=*), parameter :: cvar11 = 8_"abcd"
85 end program
87 subroutine s(a, b)
88 character(*,2) :: a
89 !ERROR: KIND value (8) not valid for CHARACTER
90 character(*,8) :: b
91 end