selected_char_kind.c (selected_char_kind): Fix return value for ISO_10646.

* intrinsics/selected_char_kind.c (selected_char_kind): Fix
	return value for ISO_10646.

	* gfortran.dg/selected_char_kind_4.f90: New test.

From-SVN: r160527
This commit is contained in:
François-Xavier Coudert 2010-06-10 09:16:08 +00:00
parent acaed831f6
commit cefab2e482
4 changed files with 59 additions and 26 deletions

View File

@ -1,3 +1,7 @@
2010-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* gfortran.dg/selected_char_kind_4.f90: New test.
2010-06-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/pr42461.c: New test.

View File

@ -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

View File

@ -1,3 +1,8 @@
2010-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* intrinsics/selected_char_kind.c (selected_char_kind): Fix
return value for ISO_10646.
2010-06-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* mk-kinds-h.sh: Define GFC_REAL_*_LITERAL_SUFFIX and
@ -43,31 +48,31 @@
2010-05-07 Janne Blomqvist <jb@gcc.gnu.org>
* libgfortran.h (free_mem): Remove prototype.
* runtime/memory.c (free_mem): Remove function.
* intrinsics/date_and_time.c (secnds): Replace free_mem() with
free().
* io/fbuf.c (fbuf_destroy): Likewise.
* io/format.c (free_format_hash_table): Likewise.
(save_parsed_format): Likewise.
(free_format_data): Likewise.
* io/list_read.c (free_saved): Likewise.
(free_line): Likewise.
(nml_touch_nodes): Likewise.
(nml_read_obj): Likewise
* io/lock.c (free_ionml): Likewise.
* io/open.c (new_unit): Likewise.
(already_open): Likewise.
* io/unit.c (destroy_unit_mutex): Likewise.
(free_internal_unit): Likewise.
(close_unit_1): Likewise.
* io/unix.c (raw_close): Likewise.
(buf_close): Likewise.
(mem_close): Likewise.
(tempfile): Likewise.
* io/write.c (nml_write_obj): Likewise.
* io/write_float.def (output_float_FMT_G_##): Likewise.
* runtime/error.c (show_locus): Likewise.
* libgfortran.h (free_mem): Remove prototype.
* runtime/memory.c (free_mem): Remove function.
* intrinsics/date_and_time.c (secnds): Replace free_mem() with
free().
* io/fbuf.c (fbuf_destroy): Likewise.
* io/format.c (free_format_hash_table): Likewise.
(save_parsed_format): Likewise.
(free_format_data): Likewise.
* io/list_read.c (free_saved): Likewise.
(free_line): Likewise.
(nml_touch_nodes): Likewise.
(nml_read_obj): Likewise
* io/lock.c (free_ionml): Likewise.
* io/open.c (new_unit): Likewise.
(already_open): Likewise.
* io/unit.c (destroy_unit_mutex): Likewise.
(free_internal_unit): Likewise.
(close_unit_1): Likewise.
* io/unix.c (raw_close): Likewise.
(buf_close): Likewise.
(mem_close): Likewise.
(tempfile): Likewise.
* io/write.c (nml_write_obj): Likewise.
* io/write_float.def (output_float_FMT_G_##): Likewise.
* runtime/error.c (show_locus): Likewise.
2010-05-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

View File

@ -40,7 +40,7 @@ selected_char_kind (gfc_charlen_type name_len, char *name)
|| (len == 7 && strncasecmp (name, "default", 7) == 0))
return 1;
else if (len == 9 && strncasecmp (name, "iso_10646", 9) == 0)
return 1;
return 4;
else
return -1;
}