aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2008-04-30 21:45:02 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2008-04-30 21:45:02 +0000
commita39faface6511df98bd39a8f6134a992a3feee35 (patch)
tree12d8a378f5315443b91acd73a7def97e1a6accf5 /gcc/fortran/check.c
parenta91ded4bb889da5eef83123edb59203979dee491 (diff)
downloadgcc-a39faface6511df98bd39a8f6134a992a3feee35.zip
gcc-a39faface6511df98bd39a8f6134a992a3feee35.tar.gz
gcc-a39faface6511df98bd39a8f6134a992a3feee35.tar.bz2
intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.
* intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic. * intrinsic.h (gfc_check_selected_char_kind, gfc_simplify_selected_char_kind): New prototypes. * gfortran.h (gfc_isym_id): Add GFC_ISYM_SC_KIND. * trans.h (gfor_fndecl_sc_kind): New function decl. * trans-decl.c (gfor_fndecl_sc_kind): Build new decl. * arith.c (gfc_compare_with_Cstring): New function. * arith.h (gfc_compare_with_Cstring): New prototype. * check.c (gfc_check_selected_char_kind): New function. * primary.c (match_string_constant, match_kind_param): Mark symbols used as literal constant kind param as referenced. * trans-intrinsic.c (gfc_conv_intrinsic_sc_kind): New function. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_sc_kind. * intrinsic.texi (SELECTED_CHAR_KIND): Document new intrinsic. * simplify.c (gfc_simplify_selected_char_kind): New function. * intrinsics/selected_char_kind.c: New file. * Makefile.am: Add intrinsics/selected_char_kind.c. * Makefile.in: Regenerate. * gfortran.dg/selected_char_kind_1.f90: New test. * gfortran.dg/selected_char_kind_2.f90: New test. * gfortran.dg/selected_char_kind_3.f90: New test. From-SVN: r134839
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index c02656c..5f78240 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -2350,6 +2350,22 @@ gfc_check_secnds (gfc_expr *r)
try
+gfc_check_selected_char_kind (gfc_expr *name)
+{
+ if (type_check (name, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (name, 0) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_selected_int_kind (gfc_expr *r)
{
if (type_check (r, 0, BT_INTEGER) == FAILURE)