From c31e515db161e96913c0c3041daaa39e9181101d Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 4 Mar 2006 13:23:19 +0000 Subject: [PATCH] Since we've had problems recognizing the "special" Fortran constants, add an explicit test case that checks for them. It is necessary to put this test function here because the OMPI_IS* macros are only defined in this directory. This commit was SVN r9195. --- ompi/mpi/f77/Makefile.am | 7 ++- ompi/mpi/f77/test_constants_f.c | 76 +++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 ompi/mpi/f77/test_constants_f.c diff --git a/ompi/mpi/f77/Makefile.am b/ompi/mpi/f77/Makefile.am index e88861cb23..ffce670dac 100644 --- a/ompi/mpi/f77/Makefile.am +++ b/ompi/mpi/f77/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana # University Research and Technology # Corporation. All rights reserved. # Copyright (c) 2004-2005 The University of Tennessee and The University @@ -16,8 +16,6 @@ # $HEADER$ # - - SUBDIRS = profile # @@ -66,7 +64,8 @@ headers = \ libmpi_f77_la_SOURCES = \ constants_f.c \ attr_fn_f.c \ - strings.c + strings.c \ + test_constants_f.c # # libmpi_c_mpi.la is only built in some cases (see above) diff --git a/ompi/mpi/f77/test_constants_f.c b/ompi/mpi/f77/test_constants_f.c new file mode 100644 index 0000000000..10e6d85bec --- /dev/null +++ b/ompi/mpi/f77/test_constants_f.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/f77/bindings.h" +#include "ompi/mpi/f77/constants.h" + +/* This is an internal test function for Open MPI; it does not have a + profiled equivalent. */ + +PN(void, ompi_test_fortran_constants, OMPI_TEST_FORTRAN_CONSTANTS, (char *bottom, char *in_place, char *argv, char *argvs, char *status, char *statuses, MPI_Fint *flag)); + +#if OMPI_HAVE_WEAK_SYMBOLS +#pragma weak OMPI_TEST_FORTRAN_CONSTANTS = ompi_test_fortran_constants_f +#pragma weak ompi_test_fortran_constants = ompi_test_fortran_constants_f +#pragma weak ompi_test_fortran_constants_ = ompi_test_fortran_constants_f +#pragma weak ompi_test_fortran_constants__ = ompi_test_fortran_constants_f +#endif + +#if ! OMPI_HAVE_WEAK_SYMBOLS +OMPI_GENERATE_F77_BINDINGS (OMPI_TEST_FORTRAN_CONSTANTS, + ompi_test_fortran_constants, + ompi_test_fortran_constants_, + ompi_test_fortran_constants__, + ompi_test_fortran_constants_f, + (char *bottom, char *in_place, char *argv, char *argvs, char *status, char *statuses, MPI_Fint *flag) + (bottom, in_place, argv, argvs, status, statuses, flag) ) +#endif + +void ompi_test_fortran_constants_f(char *bottom, char *in_place, + char *argv, char *argvs, + char *status, char *statuses, + MPI_Fint *flag) +{ + *flag = 1; + if (!OMPI_IS_FORTRAN_BOTTOM(bottom)) { + fprintf(stderr, "WARNING: Fortran MPI_BOTTOM not recognized properly\n"); + *flag = 0; + } + if (!OMPI_IS_FORTRAN_IN_PLACE(in_place)) { + fprintf(stderr, "WARNING: Fortran MPI_IN_PLACE not recognized properly\n"); + *flag = 0; + } + if (!OMPI_IS_FORTRAN_ARGV_NULL(argv)) { + fprintf(stderr, "WARNING: Fortran MPI_ARGV_NULL not recognized properly\n"); + *flag = 0; + } + if (!OMPI_IS_FORTRAN_ARGVS_NULL(argvs)) { + fprintf(stderr, "WARNING: Fortran MPI_ARGVS_NULL not recognized properly\n"); + *flag = 0; + } + if (!OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { + fprintf(stderr, "WARNING: Fortran MPI_STATUS_IGNORE not recognized properly\n"); + *flag = 0; + } + if (!OMPI_IS_FORTRAN_STATUSES_IGNORE(statuses)) { + fprintf(stderr, "WARNING: Fortran MPI_STATUSES not recognized properly\n"); + *flag = 0; + } +}