3 ! Checks for the SELECTED_CHAR_KIND intrinsic
5 integer, parameter :: ascii
= selected_char_kind ("ascii")
6 integer, parameter :: default
= selected_char_kind ("default")
8 character(kind
=ascii
) :: s1
9 character(kind
=default
) :: s2
10 character(kind
=selected_char_kind ("ascii")) :: s3
11 character(kind
=selected_char_kind ("default")) :: s4
13 if (kind (s1
) /= selected_char_kind ("ascii")) STOP 1
14 if (kind (s2
) /= selected_char_kind ("default")) STOP 2
15 if (kind (s3
) /= ascii
) STOP 3
16 if (kind (s4
) /= default
) STOP 4
18 if (selected_char_kind("ascii") /= 1) STOP 5
19 if (selected_char_kind("default") /= 1) STOP 6
20 if (selected_char_kind("defauLt") /= 1) STOP 7
21 if (selected_char_kind("foo") /= -1) STOP 8
22 if (selected_char_kind("asciiiii") /= -1) STOP 9
23 if (selected_char_kind("default ") /= 1) STOP 10
26 call test("default", 1)
27 call test("defauLt", 1)
28 call test("asciiiiii", -1)
30 call test("default ", 1)
31 call test("default x", -1)
33 call test(ascii_
"ascii", 1)
34 call test(ascii_
"default", 1)
35 call test(ascii_
"defauLt", 1)
36 call test(ascii_
"asciiiiii", -1)
37 call test(ascii_
"foo", -1)
38 call test(ascii_
"default ", 1)
39 call test(ascii_
"default x", -1)
41 call test(default_
"ascii", 1)
42 call test(default_
"default", 1)
43 call test(default_
"defauLt", 1)
44 call test(default_
"asciiiiii", -1)
45 call test(default_
"foo", -1)
46 call test(default_
"default ", 1)
47 call test(default_
"default x", -1)
49 if (kind (selected_char_kind ("")) /= kind(0)) STOP 11
53 character(len
=*,kind
=selected_char_kind("ascii")) s
57 if (selected_char_kind (s
) /= i
) STOP 12
61 character(len
=*,kind
=selected_char_kind("default")) s
64 if (selected_char_kind (s
) /= i
) STOP 13