Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / fcdemo / cprogram.c
1 /* cprogram.c
2
3    Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
4    Written by Ralf Wildenhues, 2002
5
6    This file is part of GNU Libtool.
7
8 GNU Libtool is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of
11 the License, or (at your option) any later version.
12
13 GNU Libtool is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU Libtool; see the file COPYING.  If not, a copy
20 can be downloaded from  http://www.gnu.org/licenses/gpl.html,
21 or obtained by writing to the Free Software Foundation, Inc.,
22 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 */
24
25 #include "foo.h"
26 #include <stdio.h>
27
28 int
29 main ()
30 {
31   int arg,cres,fres;
32   
33   printf ("Welcome to GNU libtool mixed C/Fortran demo!\n");
34   
35   arg = 2;
36   
37   cres = csub (arg);
38   
39   printf ("The C subroutine returned, claiming that 2*%d = %d\n",arg,cres);
40   
41   if (cres == 2*arg)
42     printf ("The C subroutine is ok!\n");
43   
44   printf ("\nCalling the C wrapper routine...\n");
45   fres = fwrapper (arg);
46   
47   printf ("The C wrapper to the fortran subroutine returned,\n"
48           "claiming that 2*%d = %d\n",arg,fres);
49   
50   if (fres == 2*arg)
51     printf ("The Fortran subroutine is ok!\n");
52   
53   return 0;
54 }
55