Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / depdemo / main.c
1 /* main.c -- inter-library dependency test program
2
3    Copyright (C) 1998, 1999, 2000, 2006 Free Software Foundation
4    Written by Thomas Tanner, 1998
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 "l1/l1.h"
26 #include "l2/l2.h"
27 #include "l4/l4.h"
28 #include <stdio.h>
29 #include <string.h>
30
31 int
32 main (int argc, char **argv)
33 {
34   printf("dependencies:\n");
35   func_l1(0);
36   func_l2(0);
37   func_l4(0);
38   if (argc == 2 && strcmp (argv[1], "-alt") == 0
39       && var_l1 + var_l2 + var_l4 == 8)
40         return 0;
41   printf("var_l1(%d) + var_l2(%d) + var_l4(%d) == %d\n",var_l1,var_l2,var_l4, var_l1 + var_l2 + var_l4);
42   if (var_l1 + var_l2 + var_l4 != 20)
43         {
44         printf("var_l1(%d) + var_l2(%d) + var_l4(%d) != 20\n",var_l1,var_l2,var_l4);
45         return 1;
46         }
47   return 0;
48 }