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