aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog25
-rw-r--r--gcc/fortran/check.c241
-rw-r--r--gcc/fortran/gfortran.h9
-rw-r--r--gcc/fortran/intrinsic.c96
-rw-r--r--gcc/fortran/intrinsic.h35
-rw-r--r--gcc/fortran/iresolve.c218
-rw-r--r--gcc/fortran/trans-intrinsic.c9
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/g77_intrinsics_funcs.f51
-rw-r--r--gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f82
10 files changed, 772 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index f2ab959..7ab43e4 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,28 @@
+2005-03-22 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ * check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
+ gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
+ gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
+ gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
+ gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
+ gfc_check_perror): new functions to check newly implemented
+ g77 intrinsics.
+ * gfortran.h: adding symbols for new intrinsics.
+ * intrinsic.c (add_functions): adding new intrinsics.
+ (add_subroutines): adding new intrinsics.
+ * intrinsic.h: prototype for all checking and resolving
+ functions.
+ * iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
+ gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
+ gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
+ gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
+ gfc_resolve_kill_sub, gfc_resolve_link_sub,
+ gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
+ gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
+ gfc_resolve_perror): new functions to resolve intrinsics.
+ * trans-intrinsic.c (gfc_conv_intrinsic_function): add case
+ for new symbols.
+
2005-03-19 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* dump-parse-tree.c (gfc_show_expr): Dump name of namespace
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 7a971f2..8fae444 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -575,6 +575,35 @@ gfc_check_char (gfc_expr * i, gfc_expr * kind)
try
+gfc_check_chdir (gfc_expr * dir)
+{
+ if (type_check (dir, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
+gfc_check_chdir_sub (gfc_expr * dir, gfc_expr * status)
+{
+ if (type_check (dir, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (status == NULL)
+ return SUCCESS;
+
+ if (type_check (status, 1, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (status, 1) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_cmplx (gfc_expr * x, gfc_expr * y, gfc_expr * kind)
{
if (numeric_check (x, 0) == FAILURE)
@@ -1008,6 +1037,41 @@ gfc_check_ishftc (gfc_expr * i, gfc_expr * shift, gfc_expr * size)
try
+gfc_check_kill (gfc_expr * pid, gfc_expr * sig)
+{
+ if (type_check (pid, 0, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (type_check (sig, 1, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
+gfc_check_kill_sub (gfc_expr * pid, gfc_expr * sig, gfc_expr * status)
+{
+ if (type_check (pid, 0, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (type_check (sig, 1, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (status == NULL)
+ return SUCCESS;
+
+ if (type_check (status, 2, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (status, 2) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_kind (gfc_expr * x)
{
if (x->ts.type == BT_DERIVED)
@@ -1039,6 +1103,76 @@ gfc_check_lbound (gfc_expr * array, gfc_expr * dim)
try
+gfc_check_link (gfc_expr * path1, gfc_expr * path2)
+{
+ if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
+gfc_check_link_sub (gfc_expr * path1, gfc_expr * path2, gfc_expr * status)
+{
+ if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (status == NULL)
+ return SUCCESS;
+
+ if (type_check (status, 2, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (status, 2) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
+gfc_check_symlnk (gfc_expr * path1, gfc_expr * path2)
+{
+ if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
+gfc_check_symlnk_sub (gfc_expr * path1, gfc_expr * path2, gfc_expr * status)
+{
+ if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (status == NULL)
+ return SUCCESS;
+
+ if (type_check (status, 2, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (status, 2) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_logical (gfc_expr * a, gfc_expr * kind)
{
if (type_check (a, 0, BT_LOGICAL) == FAILURE)
@@ -1454,6 +1588,41 @@ gfc_check_real (gfc_expr * a, gfc_expr * kind)
try
+gfc_check_rename (gfc_expr * path1, gfc_expr * path2)
+{
+ if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
+gfc_check_rename_sub (gfc_expr * path1, gfc_expr * path2, gfc_expr * status)
+{
+ if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (type_check (path2, 1, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (status == NULL)
+ return SUCCESS;
+
+ if (type_check (status, 2, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (status, 2) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_repeat (gfc_expr * x, gfc_expr * y)
{
if (type_check (x, 0, BT_CHARACTER) == FAILURE)
@@ -1658,6 +1827,19 @@ gfc_check_size (gfc_expr * array, gfc_expr * dim)
try
+gfc_check_sleep_sub (gfc_expr * seconds)
+{
+ if (type_check (seconds, 0, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (seconds, 0) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_spread (gfc_expr * source, gfc_expr * dim, gfc_expr * ncopies)
{
if (source->rank >= GFC_MAX_DIMENSIONS)
@@ -2234,6 +2416,16 @@ gfc_check_etime_sub (gfc_expr * values, gfc_expr * time)
try
+gfc_check_gerror (gfc_expr * msg)
+{
+ if (type_check (msg, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_getcwd_sub (gfc_expr * cwd, gfc_expr * status)
{
if (type_check (cwd, 0, BT_CHARACTER) == FAILURE)
@@ -2253,6 +2445,16 @@ gfc_check_getcwd_sub (gfc_expr * cwd, gfc_expr * status)
try
+gfc_check_getlog (gfc_expr * msg)
+{
+ if (type_check (msg, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_exit (gfc_expr * status)
{
if (status == NULL)
@@ -2285,6 +2487,45 @@ gfc_check_flush (gfc_expr * unit)
try
+gfc_check_hostnm (gfc_expr * name)
+{
+ if (type_check (name, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
+gfc_check_hostnm_sub (gfc_expr * name, gfc_expr * status)
+{
+ if (type_check (name, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (status == NULL)
+ return SUCCESS;
+
+ if (scalar_check (status, 1) == FAILURE)
+ return FAILURE;
+
+ if (type_check (status, 1, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
+gfc_check_perror (gfc_expr * string)
+{
+ if (type_check (string, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_umask (gfc_expr * mask)
{
if (type_check (mask, 0, BT_INTEGER) == FAILURE)
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 82665e9..b216772 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -292,6 +292,7 @@ enum gfc_generic_isym_id
GFC_ISYM_BTEST,
GFC_ISYM_CEILING,
GFC_ISYM_CHAR,
+ GFC_ISYM_CHDIR,
GFC_ISYM_CMPLX,
GFC_ISYM_COMMAND_ARGUMENT_COUNT,
GFC_ISYM_CONJG,
@@ -317,6 +318,7 @@ enum gfc_generic_isym_id
GFC_ISYM_GETGID,
GFC_ISYM_GETPID,
GFC_ISYM_GETUID,
+ GFC_ISYM_HOSTNM,
GFC_ISYM_IACHAR,
GFC_ISYM_IAND,
GFC_ISYM_IARGC,
@@ -325,15 +327,18 @@ enum gfc_generic_isym_id
GFC_ISYM_IBSET,
GFC_ISYM_ICHAR,
GFC_ISYM_IEOR,
+ GFC_ISYM_IERRNO,
GFC_ISYM_INDEX,
GFC_ISYM_INT,
GFC_ISYM_IOR,
GFC_ISYM_IRAND,
GFC_ISYM_ISHFT,
GFC_ISYM_ISHFTC,
+ GFC_ISYM_KILL,
GFC_ISYM_LBOUND,
GFC_ISYM_LEN,
GFC_ISYM_LEN_TRIM,
+ GFC_ISYM_LINK,
GFC_ISYM_LGE,
GFC_ISYM_LGT,
GFC_ISYM_LLE,
@@ -359,6 +364,7 @@ enum gfc_generic_isym_id
GFC_ISYM_PRODUCT,
GFC_ISYM_RAND,
GFC_ISYM_REAL,
+ GFC_ISYM_RENAME,
GFC_ISYM_REPEAT,
GFC_ISYM_RESHAPE,
GFC_ISYM_RRSPACING,
@@ -378,9 +384,12 @@ enum gfc_generic_isym_id
GFC_ISYM_SR_KIND,
GFC_ISYM_STAT,
GFC_ISYM_SUM,
+ GFC_ISYM_SYMLNK,
GFC_ISYM_SYSTEM,
GFC_ISYM_TAN,
GFC_ISYM_TANH,
+ GFC_ISYM_TIME,
+ GFC_ISYM_TIME8,
GFC_ISYM_TRANSFER,
GFC_ISYM_TRANSPOSE,
GFC_ISYM_TRIM,
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index ebf5cb2..7336e63 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -1092,6 +1092,12 @@ add_functions (void)
make_generic ("char", GFC_ISYM_CHAR, GFC_STD_F77);
+ add_sym_1 ("chdir", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ gfc_check_chdir, NULL, gfc_resolve_chdir,
+ a, BT_CHARACTER, dc, REQUIRED);
+
+ make_generic ("chdir", GFC_ISYM_CHDIR, GFC_STD_GNU);
+
add_sym_3 ("cmplx", 1, 1, BT_COMPLEX, dz, GFC_STD_F77,
gfc_check_cmplx, gfc_simplify_cmplx, gfc_resolve_cmplx,
x, BT_UNKNOWN, dr, REQUIRED, y, BT_UNKNOWN, dr, OPTIONAL,
@@ -1323,6 +1329,12 @@ add_functions (void)
make_generic ("getuid", GFC_ISYM_GETUID, GFC_STD_GNU);
+ add_sym_1 ("hostnm", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ gfc_check_hostnm, NULL, gfc_resolve_hostnm,
+ a, BT_CHARACTER, dc, REQUIRED);
+
+ make_generic ("hostnm", GFC_ISYM_HOSTNM, GFC_STD_GNU);
+
add_sym_1 ("huge", 0, 1, BT_REAL, dr, GFC_STD_F95,
gfc_check_huge, gfc_simplify_huge, NULL,
x, BT_UNKNOWN, dr, REQUIRED);
@@ -1383,6 +1395,11 @@ add_functions (void)
make_generic ("ieor", GFC_ISYM_IEOR, GFC_STD_F95);
+ add_sym_0 ("ierrno", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
+ NULL, NULL, gfc_resolve_ierrno);
+
+ make_generic ("ierrno", GFC_ISYM_IERRNO, GFC_STD_GNU);
+
add_sym_3 ("index", 1, 1, BT_INTEGER, di, GFC_STD_F77,
gfc_check_index, gfc_simplify_index, NULL,
stg, BT_CHARACTER, dc, REQUIRED, ssg, BT_CHARACTER, dc, REQUIRED,
@@ -1430,6 +1447,12 @@ add_functions (void)
make_generic ("ishftc", GFC_ISYM_ISHFTC, GFC_STD_F95);
+ add_sym_2 ("kill", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
+ gfc_check_kill, NULL, gfc_resolve_kill,
+ a, BT_INTEGER, di, REQUIRED, b, BT_INTEGER, di, REQUIRED);
+
+ make_generic ("kill", GFC_ISYM_KILL, GFC_STD_GNU);
+
add_sym_1 ("kind", 0, 1, BT_INTEGER, di, GFC_STD_F95,
gfc_check_kind, gfc_simplify_kind, NULL,
x, BT_REAL, dr, REQUIRED);
@@ -1452,6 +1475,8 @@ add_functions (void)
NULL, gfc_simplify_len_trim, gfc_resolve_len_trim,
stg, BT_CHARACTER, dc, REQUIRED);
+ make_alias ("lnblnk", GFC_STD_GNU);
+
make_generic ("len_trim", GFC_ISYM_LEN_TRIM, GFC_STD_F95);
add_sym_2 ("lge", 1, 0, BT_LOGICAL, dl, GFC_STD_F77,
@@ -1478,6 +1503,12 @@ add_functions (void)
make_generic ("llt", GFC_ISYM_LLT, GFC_STD_F77);
+ add_sym_2 ("link", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ gfc_check_link, NULL, gfc_resolve_link,
+ a, BT_CHARACTER, dc, REQUIRED, b, BT_CHARACTER, dc, REQUIRED);
+
+ make_generic ("link", GFC_ISYM_LINK, GFC_STD_GNU);
+
add_sym_1 ("log", 1, 1, BT_REAL, dr, GFC_STD_F77,
gfc_check_fn_rc, gfc_simplify_log, gfc_resolve_log,
x, BT_REAL, dr, REQUIRED);
@@ -1744,6 +1775,12 @@ add_functions (void)
make_generic ("real", GFC_ISYM_REAL, GFC_STD_F77);
+ add_sym_2 ("rename", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ gfc_check_rename, NULL, gfc_resolve_rename,
+ a, BT_CHARACTER, dc, REQUIRED, b, BT_CHARACTER, dc, REQUIRED);
+
+ make_generic ("rename", GFC_ISYM_RENAME, GFC_STD_GNU);
+
add_sym_2 ("repeat", 0, 1, BT_CHARACTER, dc, GFC_STD_F95,
gfc_check_repeat, gfc_simplify_repeat, gfc_resolve_repeat,
stg, BT_CHARACTER, dc, REQUIRED, n, BT_INTEGER, di, REQUIRED);
@@ -1904,6 +1941,12 @@ add_functions (void)
make_generic ("sum", GFC_ISYM_SUM, GFC_STD_F95);
+ add_sym_2 ("symlnk", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ gfc_check_symlnk, NULL, gfc_resolve_symlnk,
+ a, BT_CHARACTER, dc, REQUIRED, b, BT_CHARACTER, dc, REQUIRED);
+
+ make_generic ("symlnk", GFC_ISYM_SYMLNK, GFC_STD_GNU);
+
add_sym_1 ("system", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
NULL, NULL, NULL,
c, BT_CHARACTER, dc, REQUIRED);
@@ -1930,6 +1973,16 @@ add_functions (void)
make_generic ("tanh", GFC_ISYM_TANH, GFC_STD_F77);
+ add_sym_0 ("time", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
+ NULL, NULL, gfc_resolve_time);
+
+ make_generic ("time", GFC_ISYM_TIME, GFC_STD_GNU);
+
+ add_sym_0 ("time8", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
+ NULL, NULL, gfc_resolve_time8);
+
+ make_generic ("time8", GFC_ISYM_TIME8, GFC_STD_GNU);
+
add_sym_1 ("tiny", 0, 1, BT_REAL, dr, GFC_STD_F95,
gfc_check_x, gfc_simplify_tiny, NULL,
x, BT_REAL, dr, REQUIRED);
@@ -2024,6 +2077,10 @@ add_subroutines (void)
gfc_check_second_sub, NULL, gfc_resolve_second_sub,
tm, BT_REAL, dr, REQUIRED);
+ add_sym_2s ("chdir", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_chdir_sub, NULL, gfc_resolve_chdir_sub,
+ name, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
+
add_sym_4s ("date_and_time", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_date_and_time, NULL, NULL,
dt, BT_CHARACTER, dc, OPTIONAL, tm, BT_CHARACTER, dc, OPTIONAL,
@@ -2038,6 +2095,10 @@ add_subroutines (void)
gfc_check_etime_sub, NULL, gfc_resolve_etime_sub,
vl, BT_REAL, 4, REQUIRED, tm, BT_REAL, 4, REQUIRED);
+ add_sym_1s ("gerror", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_gerror, NULL, gfc_resolve_gerror, c, BT_CHARACTER,
+ dc, REQUIRED);
+
add_sym_2s ("getcwd", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_getcwd_sub, NULL, gfc_resolve_getcwd_sub,
c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
@@ -2050,6 +2111,10 @@ add_subroutines (void)
NULL, NULL, gfc_resolve_getarg,
c, BT_INTEGER, di, REQUIRED, vl, BT_CHARACTER, dc, REQUIRED);
+ add_sym_1s ("getlog", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_getlog, NULL, gfc_resolve_getlog, c, BT_CHARACTER,
+ dc, REQUIRED);
+
/* F2003 commandline routines. */
add_sym_3s ("get_command", 0, 1, BT_UNKNOWN, 0, GFC_STD_F2003,
@@ -2098,6 +2163,32 @@ add_subroutines (void)
gfc_check_flush, NULL, gfc_resolve_flush,
c, BT_INTEGER, di, OPTIONAL);
+ add_sym_2s ("hostnm", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_hostnm_sub, NULL, gfc_resolve_hostnm_sub,
+ c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
+
+ add_sym_3s ("kill", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, gfc_check_kill_sub,
+ NULL, gfc_resolve_kill_sub, c, BT_INTEGER, di, REQUIRED,
+ val, BT_INTEGER, di, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
+
+ add_sym_3s ("link", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_link_sub, NULL, gfc_resolve_link_sub,
+ name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER,
+ dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
+
+ add_sym_1s ("perror", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_perror, NULL, gfc_resolve_perror,
+ c, BT_CHARACTER, dc, REQUIRED);
+
+ add_sym_3s ("rename", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_rename_sub, NULL, gfc_resolve_rename_sub,
+ name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER,
+ dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
+
+ add_sym_1s ("sleep", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_sleep_sub, NULL, gfc_resolve_sleep_sub,
+ val, BT_CHARACTER, dc, REQUIRED);
+
add_sym_3s ("fstat", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_fstat_sub, NULL, gfc_resolve_fstat_sub,
ut, BT_INTEGER, di, REQUIRED, vl, BT_INTEGER, di, REQUIRED,
@@ -2108,6 +2199,11 @@ add_subroutines (void)
name, BT_CHARACTER, dc, REQUIRED, vl, BT_INTEGER, di, REQUIRED,
st, BT_INTEGER, di, OPTIONAL);
+ add_sym_3s ("symlnk", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_symlnk_sub, NULL, gfc_resolve_symlnk_sub,
+ name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER,
+ dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
+
add_sym_2s ("system", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
NULL, NULL, gfc_resolve_system_sub,
c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index 3f5fcba..bf2c80a 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -40,6 +40,7 @@ try gfc_check_atan2 (gfc_expr *, gfc_expr *);
try gfc_check_besn (gfc_expr *, gfc_expr *);
try gfc_check_btest (gfc_expr *, gfc_expr *);
try gfc_check_char (gfc_expr *, gfc_expr *);
+try gfc_check_chdir (gfc_expr *);
try gfc_check_cmplx (gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_count (gfc_expr *, gfc_expr *);
try gfc_check_cshift (gfc_expr *, gfc_expr *, gfc_expr *);
@@ -55,6 +56,7 @@ try gfc_check_fn_r (gfc_expr *);
try gfc_check_fn_rc (gfc_expr *);
try gfc_check_fnum (gfc_expr *);
try gfc_check_g77_math1 (gfc_expr *);
+try gfc_check_hostnm (gfc_expr *);
try gfc_check_huge (gfc_expr *);
try gfc_check_i (gfc_expr *);
try gfc_check_iand (gfc_expr *, gfc_expr *);
@@ -69,8 +71,10 @@ try gfc_check_ior (gfc_expr *, gfc_expr *);
try gfc_check_irand (gfc_expr *);
try gfc_check_ishft (gfc_expr *, gfc_expr *);
try gfc_check_ishftc (gfc_expr *, gfc_expr *, gfc_expr *);
+try gfc_check_kill (gfc_expr *, gfc_expr *);
try gfc_check_kind (gfc_expr *);
try gfc_check_lbound (gfc_expr *, gfc_expr *);
+try gfc_check_link (gfc_expr *, gfc_expr *);
try gfc_check_logical (gfc_expr *, gfc_expr *);
try gfc_check_min_max (gfc_actual_arglist *);
try gfc_check_min_max_integer (gfc_actual_arglist *);
@@ -90,6 +94,7 @@ try gfc_check_radix (gfc_expr *);
try gfc_check_rand (gfc_expr *);
try gfc_check_range (gfc_expr *);
try gfc_check_real (gfc_expr *, gfc_expr *);
+try gfc_check_rename (gfc_expr *, gfc_expr *);
try gfc_check_repeat (gfc_expr *, gfc_expr *);
try gfc_check_reshape (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_scale (gfc_expr *, gfc_expr *);
@@ -105,6 +110,7 @@ try gfc_check_spread (gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_srand (gfc_expr *);
try gfc_check_stat (gfc_expr *, gfc_expr *);
try gfc_check_sum (gfc_expr *, gfc_expr *, gfc_expr *);
+try gfc_check_symlnk (gfc_expr *, gfc_expr *);
try gfc_check_transfer (gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_transpose (gfc_expr *);
try gfc_check_trim (gfc_expr *);
@@ -117,18 +123,28 @@ try gfc_check_x (gfc_expr *);
/* Intrinsic subroutines. */
+try gfc_check_chdir_sub (gfc_expr *, gfc_expr *);
try gfc_check_cpu_time (gfc_expr *);
try gfc_check_system_clock (gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_date_and_time (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_exit (gfc_expr *);
try gfc_check_flush (gfc_expr *);
try gfc_check_fstat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+try gfc_check_gerror (gfc_expr *);
+try gfc_check_getlog (gfc_expr *);
try gfc_check_mvbits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *);
try gfc_check_random_number (gfc_expr *);
try gfc_check_random_seed (gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_etime_sub (gfc_expr *, gfc_expr *);
try gfc_check_getcwd_sub (gfc_expr *, gfc_expr *);
+try gfc_check_hostnm_sub (gfc_expr *, gfc_expr *);
+try gfc_check_kill_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+try gfc_check_perror (gfc_expr *);
+try gfc_check_rename_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+try gfc_check_link_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+try gfc_check_symlnk_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+try gfc_check_sleep_sub (gfc_expr *);
try gfc_check_stat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_system_sub (gfc_expr *, gfc_expr *);
try gfc_check_umask_sub (gfc_expr *, gfc_expr *);
@@ -256,6 +272,7 @@ void gfc_resolve_besn (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_btest (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ceiling (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_char (gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_chdir (gfc_expr *, gfc_expr *);
void gfc_resolve_cmplx (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_dcmplx (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_conjg (gfc_expr *, gfc_expr *);
@@ -281,10 +298,12 @@ void gfc_resolve_getcwd (gfc_expr *, gfc_expr *);
void gfc_resolve_getgid (gfc_expr *);
void gfc_resolve_getpid (gfc_expr *);
void gfc_resolve_getuid (gfc_expr *);
+void gfc_resolve_hostnm (gfc_expr *, gfc_expr *);
void gfc_resolve_iand (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ibclr (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ibits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ibset (gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_ierrno (gfc_expr *);
void gfc_resolve_ieor (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ichar (gfc_expr *, gfc_expr *);
void gfc_resolve_idnint (gfc_expr *, gfc_expr *);
@@ -292,9 +311,11 @@ void gfc_resolve_int (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ior (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ishft (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ishftc (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_kill (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_lbound (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_len (gfc_expr *, gfc_expr *);
void gfc_resolve_len_trim (gfc_expr *, gfc_expr *);
+void gfc_resolve_link (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_log (gfc_expr *, gfc_expr *);
void gfc_resolve_log10 (gfc_expr *, gfc_expr *);
void gfc_resolve_logical (gfc_expr *, gfc_expr *, gfc_expr *);
@@ -314,6 +335,7 @@ void gfc_resolve_not (gfc_expr *, gfc_expr *);
void gfc_resolve_pack (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_product (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_real (gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_rename (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_repeat (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_reshape (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *);
@@ -332,9 +354,12 @@ void gfc_resolve_sqrt (gfc_expr *, gfc_expr *);
void gfc_resolve_stat (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_srand (gfc_code *);
void gfc_resolve_sum (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_symlnk (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_system (gfc_expr *, gfc_expr *);
void gfc_resolve_tan (gfc_expr *, gfc_expr *);
void gfc_resolve_tanh (gfc_expr *, gfc_expr *);
+void gfc_resolve_time (gfc_expr *);
+void gfc_resolve_time8 (gfc_expr *);
void gfc_resolve_transfer (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_transpose (gfc_expr *, gfc_expr *);
void gfc_resolve_trim (gfc_expr *, gfc_expr *);
@@ -346,17 +371,27 @@ void gfc_resolve_verify (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
/* Intrinsic subroutine resolution. */
+void gfc_resolve_chdir_sub (gfc_code *);
void gfc_resolve_cpu_time (gfc_code *);
void gfc_resolve_exit (gfc_code *);
void gfc_resolve_flush (gfc_code *);
void gfc_resolve_fstat_sub (gfc_code *);
+void gfc_resolve_gerror (gfc_code *);
void gfc_resolve_getarg (gfc_code *);
void gfc_resolve_getcwd_sub (gfc_code *);
+void gfc_resolve_getlog (gfc_code *);
void gfc_resolve_get_command (gfc_code *);
void gfc_resolve_get_command_argument (gfc_code *);
void gfc_resolve_get_environment_variable (gfc_code *);
+void gfc_resolve_hostnm_sub (gfc_code *);
+void gfc_resolve_kill_sub (gfc_code *);
void gfc_resolve_mvbits (gfc_code *);
+void gfc_resolve_perror (gfc_code *);
void gfc_resolve_random_number (gfc_code *);
+void gfc_resolve_rename_sub (gfc_code *);
+void gfc_resolve_link_sub (gfc_code *);
+void gfc_resolve_symlnk_sub (gfc_code *);
+void gfc_resolve_sleep_sub (gfc_code *);
void gfc_resolve_stat_sub (gfc_code *);
void gfc_resolve_system_clock (gfc_code *);
void gfc_resolve_system_sub (gfc_code *);
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 9a30b7d..746b97d 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -253,6 +253,31 @@ gfc_resolve_char (gfc_expr * f, gfc_expr * a, gfc_expr * kind)
void
+gfc_resolve_chdir (gfc_expr * f, gfc_expr * d ATTRIBUTE_UNUSED)
+{
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = gfc_default_integer_kind;
+ f->value.function.name = gfc_get_string (PREFIX("chdir_i%d"), f->ts.kind);
+}
+
+
+void
+gfc_resolve_chdir_sub (gfc_code * c)
+{
+ const char *name;
+ int kind;
+
+ if (c->ext.actual->next->expr != NULL)
+ kind = c->ext.actual->next->expr->ts.kind;
+ else
+ kind = gfc_default_integer_kind;
+
+ name = gfc_get_string (PREFIX("chdir_i%d_sub"), kind);
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
+}
+
+
+void
gfc_resolve_cmplx (gfc_expr * f, gfc_expr * x, gfc_expr * y, gfc_expr * kind)
{
f->ts.type = BT_COMPLEX;
@@ -533,6 +558,14 @@ gfc_resolve_getuid (gfc_expr * f)
}
void
+gfc_resolve_hostnm (gfc_expr * f, gfc_expr * n ATTRIBUTE_UNUSED)
+{
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = 4;
+ f->value.function.name = gfc_get_string (PREFIX ("hostnm"));
+}
+
+void
gfc_resolve_iand (gfc_expr * f, gfc_expr * i, gfc_expr * j)
{
/* If the kind of i and j are different, then g77 cross-promoted the
@@ -596,6 +629,15 @@ gfc_resolve_idnint (gfc_expr * f, gfc_expr * a)
void
+gfc_resolve_ierrno (gfc_expr * f)
+{
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = gfc_default_integer_kind;
+ f->value.function.name = gfc_get_string (PREFIX("ierrno_i%d"), f->ts.kind);
+}
+
+
+void
gfc_resolve_ieor (gfc_expr * f, gfc_expr * i, gfc_expr * j)
{
/* If the kind of i and j are different, then g77 cross-promoted the
@@ -670,6 +712,17 @@ gfc_resolve_ishftc (gfc_expr * f, gfc_expr * i, gfc_expr * shift,
void
+gfc_resolve_kill (gfc_expr * f, ATTRIBUTE_UNUSED gfc_expr * p,
+ ATTRIBUTE_UNUSED gfc_expr * s)
+{
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = gfc_default_integer_kind;
+
+ f->value.function.name = gfc_get_string (PREFIX("kill_i%d"), f->ts.kind);
+}
+
+
+void
gfc_resolve_lbound (gfc_expr * f, gfc_expr * array,
gfc_expr * dim)
{
@@ -708,6 +761,16 @@ gfc_resolve_len_trim (gfc_expr * f, gfc_expr * string)
void
+gfc_resolve_link (gfc_expr * f, gfc_expr * p1 ATTRIBUTE_UNUSED,
+ gfc_expr * p2 ATTRIBUTE_UNUSED)
+{
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = gfc_default_integer_kind;
+ f->value.function.name = gfc_get_string (PREFIX("link_i%d"), f->ts.kind);
+}
+
+
+void
gfc_resolve_log (gfc_expr * f, gfc_expr * x)
{
f->ts = x->ts;
@@ -1019,6 +1082,16 @@ gfc_resolve_real (gfc_expr * f, gfc_expr * a, gfc_expr * kind)
void
+gfc_resolve_rename (gfc_expr * f, gfc_expr * p1 ATTRIBUTE_UNUSED,
+ gfc_expr * p2 ATTRIBUTE_UNUSED)
+{
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = gfc_default_integer_kind;
+ f->value.function.name = gfc_get_string (PREFIX("rename_i%d"), f->ts.kind);
+}
+
+
+void
gfc_resolve_repeat (gfc_expr * f, gfc_expr * string,
gfc_expr * ncopies ATTRIBUTE_UNUSED)
{
@@ -1275,6 +1348,16 @@ gfc_resolve_sum (gfc_expr * f, gfc_expr * array, gfc_expr * dim,
}
+void
+gfc_resolve_symlnk (gfc_expr * f, gfc_expr * p1 ATTRIBUTE_UNUSED,
+ gfc_expr * p2 ATTRIBUTE_UNUSED)
+{
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = gfc_default_integer_kind;
+ f->value.function.name = gfc_get_string (PREFIX("symlnk_i%d"), f->ts.kind);
+}
+
+
/* Resolve the g77 compatibility function SYSTEM. */
void
@@ -1305,6 +1388,24 @@ gfc_resolve_tanh (gfc_expr * f, gfc_expr * x)
void
+gfc_resolve_time (gfc_expr * f)
+{
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = 4;
+ f->value.function.name = gfc_get_string (PREFIX("time_func"));
+}
+
+
+void
+gfc_resolve_time8 (gfc_expr * f)
+{
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = 8;
+ f->value.function.name = gfc_get_string (PREFIX("time8_func"));
+}
+
+
+void
gfc_resolve_transfer (gfc_expr * f, gfc_expr * source ATTRIBUTE_UNUSED,
gfc_expr * mold, gfc_expr * size)
{
@@ -1490,6 +1591,70 @@ gfc_resolve_random_number (gfc_code * c ATTRIBUTE_UNUSED)
}
+void
+gfc_resolve_rename_sub (gfc_code * c)
+{
+ const char *name;
+ int kind;
+
+ if (c->ext.actual->next->next->expr != NULL)
+ kind = c->ext.actual->next->next->expr->ts.kind;
+ else
+ kind = gfc_default_integer_kind;
+
+ name = gfc_get_string (PREFIX("rename_i%d_sub"), kind);
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
+}
+
+
+void
+gfc_resolve_kill_sub (gfc_code * c)
+{
+ const char *name;
+ int kind;
+
+ if (c->ext.actual->next->next->expr != NULL)
+ kind = c->ext.actual->next->next->expr->ts.kind;
+ else
+ kind = gfc_default_integer_kind;
+
+ name = gfc_get_string (PREFIX("kill_i%d_sub"), kind);
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
+}
+
+
+void
+gfc_resolve_link_sub (gfc_code * c)
+{
+ const char *name;
+ int kind;
+
+ if (c->ext.actual->next->next->expr != NULL)
+ kind = c->ext.actual->next->next->expr->ts.kind;
+ else
+ kind = gfc_default_integer_kind;
+
+ name = gfc_get_string (PREFIX("link_i%d_sub"), kind);
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
+}
+
+
+void
+gfc_resolve_symlnk_sub (gfc_code * c)
+{
+ const char *name;
+ int kind;
+
+ if (c->ext.actual->next->next->expr != NULL)
+ kind = c->ext.actual->next->next->expr->ts.kind;
+ else
+ kind = gfc_default_integer_kind;
+
+ name = gfc_get_string (PREFIX("symlnk_i%d_sub"), kind);
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
+}
+
+
/* G77 compatibility subroutines etime() and dtime(). */
void
@@ -1514,6 +1679,22 @@ gfc_resolve_second_sub (gfc_code * c)
}
+void
+gfc_resolve_sleep_sub (gfc_code * c)
+{
+ const char *name;
+ int kind;
+
+ if (c->ext.actual->expr != NULL)
+ kind = c->ext.actual->expr->ts.kind;
+ else
+ kind = gfc_default_integer_kind;
+
+ name = gfc_get_string (PREFIX("sleep_i%d_sub"), kind);
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
+}
+
+
/* G77 compatibility function srand(). */
void
@@ -1665,6 +1846,43 @@ gfc_resolve_flush (gfc_code * c)
c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
}
+
+void
+gfc_resolve_gerror (gfc_code * c)
+{
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX ("gerror"));
+}
+
+
+void
+gfc_resolve_getlog (gfc_code * c)
+{
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX ("getlog"));
+}
+
+
+void
+gfc_resolve_hostnm_sub (gfc_code * c)
+{
+ const char *name;
+ int kind;
+
+ if (c->ext.actual->next->expr != NULL)
+ kind = c->ext.actual->next->expr->ts.kind;
+ else
+ kind = gfc_default_integer_kind;
+
+ name = gfc_get_string (PREFIX("hostnm_i%d_sub"), kind);
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
+}
+
+
+void
+gfc_resolve_perror (gfc_code * c)
+{
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX ("perror_sub"));
+}
+
/* Resolve the STAT and FSTAT intrinsic subroutines. */
void
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index f24db5f..20bddbd 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -2977,6 +2977,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
gfc_conv_intrinsic_bound (se, expr, 1);
break;
+ case GFC_ISYM_CHDIR:
case GFC_ISYM_DOT_PRODUCT:
case GFC_ISYM_ETIME:
case GFC_ISYM_FNUM:
@@ -2985,12 +2986,20 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
case GFC_ISYM_GETGID:
case GFC_ISYM_GETPID:
case GFC_ISYM_GETUID:
+ case GFC_ISYM_HOSTNM:
+ case GFC_ISYM_KILL:
+ case GFC_ISYM_IERRNO:
case GFC_ISYM_IRAND:
+ case GFC_ISYM_LINK:
case GFC_ISYM_MATMUL:
case GFC_ISYM_RAND:
+ case GFC_ISYM_RENAME:
case GFC_ISYM_SECOND:
case GFC_ISYM_STAT:
+ case GFC_ISYM_SYMLNK:
case GFC_ISYM_SYSTEM:
+ case GFC_ISYM_TIME:
+ case GFC_ISYM_TIME8:
case GFC_ISYM_UMASK:
case GFC_ISYM_UNLINK:
gfc_conv_intrinsic_funcall (se, expr);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6ea0ee9..4b33170 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-22 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ * g77_intrinsics_funcs.f: New test.
+ * g77_intrinsics_sub.f: New test.
+
2005-03-22 Richard Guenther <rguenth@tat.physik.uni-tuebingen.de>
Jan Hubicka <jh@suse.cz>
Steven Bosscher <stevenb@suse.de
@@ -68,6 +73,7 @@
* gcc.c-torture/compile/pr20539-1.c: Likewise.
* g++.dg/opt/pr13066-1.C: Likewise.
+>>>>>>> 1.5197
2005-03-20 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/bitfld-14.c, gcc.dg/enum3.c: New tests.
diff --git a/gcc/testsuite/gfortran.dg/g77_intrinsics_funcs.f b/gcc/testsuite/gfortran.dg/g77_intrinsics_funcs.f
new file mode 100644
index 0000000..fa09024
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/g77_intrinsics_funcs.f
@@ -0,0 +1,51 @@
+! {dg-do compile}
+! Testing g77 intrinsics as subroutines
+ integer*8 i8
+ integer*4 i4
+ integer i
+ character*80 c
+
+ i8 = time ()
+ i4 = time ()
+ i8 = time8 ()
+ i4 = time8 ()
+
+ i8 = hostnm (c)
+ i4 = hostnm (c)
+ i = hostnm (c)
+
+ i8 = ierrno ()
+ i4 = ierrno ()
+ i = ierrno ()
+
+ i8 = kill (i8, i8)
+ i8 = kill (i8, i4)
+ i8 = kill (i4, i8)
+ i8 = kill (i4, i4)
+ i4 = kill (i8, i8)
+ i4 = kill (i8, i4)
+ i4 = kill (i4, i8)
+ i4 = kill (i4, i4)
+
+ i8 = link ('foo', 'bar')
+ i4 = link ('foo', 'bar')
+ i = link ('foo', 'bar')
+
+ i8 = rename ('foo', 'bar')
+ i4 = rename ('foo', 'bar')
+ i = rename ('foo', 'bar')
+
+ i8 = symlnk ('foo', 'bar')
+ i4 = symlnk ('foo', 'bar')
+ i = symlnk ('foo', 'bar')
+
+! Cleaning our mess
+ call unlink ('bar')
+
+! This should be the last test, unless you want garbage everywhere in
+! your filesystem.
+ i8 = chdir ('..')
+ i4 = chdir ('..')
+ i = chdir ('..')
+
+ end
diff --git a/gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f b/gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f
new file mode 100644
index 0000000..5a47446
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f
@@ -0,0 +1,82 @@
+! {dg-do compile}
+! Testing g77 intrinsics as subroutines
+ integer*8 i8, j8
+ integer*4 i4, j4
+ integer i, j
+ character*80 c
+
+ call gerror (c)
+ call getlog (c)
+
+ call hostnm (c, status = i8)
+ call hostnm (c, i8)
+ call hostnm (c, status = i4)
+ call hostnm (c, i4)
+ call hostnm (c, status = i)
+ call hostnm (c, i)
+ call hostnm (c)
+
+ call kill (i8, i8, status = i8)
+ call kill (i8, i8, i8)
+ call kill (i4, i8, i8)
+ call kill (i8, i4, i8)
+ call kill (i8, i8, i4)
+ call kill (i4, i4, i8)
+ call kill (i4, i8, i4)
+ call kill (i8, i4, i4)
+ call kill (i4, i4, i4)
+ call kill (i, i, i)
+ call kill (i8, i8)
+ call kill (i4, i8)
+ call kill (i8, i4)
+ call kill (i4, i4)
+ call kill (i, i)
+
+ call link ('foo', 'bar', status = i8)
+ call link ('foo', 'bar', status = i4)
+ call link ('foo', 'bar', status = i)
+ call link ('foo', 'bar', i8)
+ call link ('foo', 'bar', i4)
+ call link ('foo', 'bar', i)
+ call link ('foo', 'bar')
+
+ call perror (c)
+
+ call rename ('foo', 'bar', status = i8)
+ call rename ('foo', 'bar', status = i4)
+ call rename ('foo', 'bar', status = i)
+ call rename ('foo', 'bar', i8)
+ call rename ('foo', 'bar', i4)
+ call rename ('foo', 'bar', i)
+ call rename ('foo', 'bar')
+
+ i = 1
+ i4 = 1
+ i8 = 1
+ call sleep (i)
+ call sleep (i4)
+ call sleep (i8)
+ call sleep (-1)
+
+ call symlnk ('foo', 'bar', status = i8)
+ call symlnk ('foo', 'bar', status = i4)
+ call symlnk ('foo', 'bar', status = i)
+ call symlnk ('foo', 'bar', i8)
+ call symlnk ('foo', 'bar', i4)
+ call symlnk ('foo', 'bar', i)
+ call symlnk ('foo', 'bar')
+
+! Cleaning our mess
+ call unlink ('bar')
+
+! This should be the last test, unless you want garbage everywhere in
+! your filesystem.
+ call chdir ('..', status = i8)
+ call chdir ('..', i8)
+ call chdir ('..', status = i4)
+ call chdir ('..', i4)
+ call chdir ('..', status = i)
+ call chdir ('..', i)
+ call chdir ('..')
+
+ end