]>
Commit | Line | Data |
---|---|---|
6cfea11b TJ |
1 | /* Driver for treelang test pgm */ |
2 | ||
d7ee9f9f TJ |
3 | /* |
4 | ||
5 | Copyright (C) 2001, 2002 Free Software Foundation, Inc. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify it | |
8 | under the terms of the GNU General Public License as published by the | |
9 | Free Software Foundation; either version 2, or (at your option) any | |
10 | later version. | |
11 | ||
12 | This program 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 this program; if not, write to the Free Software | |
19 | Foundation, 59 Temple Place - Suite 330, | |
20 | Boston, MA 02111-1307, USA. | |
21 | ||
22 | In other words, you are welcome to use, share and improve this program. | |
23 | You are forbidden to forbid anyone else to use, share and improve | |
24 | what you give them. Help stamp out software-hoarding! | |
25 | */ | |
26 | ||
6cfea11b TJ |
27 | int add(int, int); |
28 | int subtract(int, int); | |
29 | int first_nonzero(int, int); | |
30 | ||
31 | int | |
32 | main (int argc, char *argv[]) | |
33 | { | |
34 | printf("2:%d\n", add(1,1)); | |
35 | printf("7:%d\n", add(3,4)); | |
36 | printf("-1:%d\n", subtract(3,4)); | |
37 | printf("1:%d\n", subtract(2,1)); | |
38 | printf("3:%d\n", first_nonzero(0,3)); | |
39 | printf("0:%d\n", first_nonzero(0,0)); | |
40 | printf("1:%d\n", first_nonzero(1,0)); | |
41 | printf("15:%d\n", double_plus_one(7)); | |
42 | return 0; | |
43 | } |