summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/selected_char_kind_4.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/selected_char_kind_4.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/selected_char_kind_4.f9024
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/selected_char_kind_4.f90 b/gcc/testsuite/gfortran.dg/selected_char_kind_4.f90
new file mode 100644
index 000000000..046ddf0e7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/selected_char_kind_4.f90
@@ -0,0 +1,24 @@
+! { dg-do run }
+!
+! Check that runtime result values of SELECTED_CHAR_KIND agree with
+! front-end simplification results.
+!
+ implicit none
+ character(len=20) :: s
+
+ s = "ascii"
+ if (selected_char_kind(s) /= selected_char_kind("ascii")) call abort
+
+ s = "default"
+ if (selected_char_kind(s) /= selected_char_kind("default")) call abort
+
+ s = "iso_10646"
+ if (selected_char_kind(s) /= selected_char_kind("iso_10646")) call abort
+
+ s = ""
+ if (selected_char_kind(s) /= selected_char_kind("")) call abort
+
+ s = "invalid"
+ if (selected_char_kind(s) /= selected_char_kind("invalid")) call abort
+
+end