source: trunk/testcase/weak/weak2-main.c@ 306

Last change on this file since 306 was 306, checked in by bird, 22 years ago

Early coding.

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1016 bytes
Line 
1/* test more complex weak stuff. Both weak symbols and weak external symbols. */
2#include <stdio.h>
3extern int bar1;
4extern int bar2;
5extern int bar3;
6extern int bar4;
7extern int bar5;
8extern int bar6;
9
10int main()
11{
12 int i;
13 int cErrors = 0;
14
15 i = foo();
16 if (i != 1)
17 {
18 printf("foo() returned %d, exepcted 1\n", i);
19 cErrors++;
20 }
21
22 i = foo3();
23 if (i != 1)
24 {
25 printf("foo3() returned %d, exepcted 1\n", i);
26 cErrors++;
27 }
28
29 i = foo4();
30 if (i != -1)
31 {
32 printf("foo4() returned %d, exepcted -1\n", i);
33 cErrors++;
34 }
35
36 i = foo5();
37 if (i != 1)
38 {
39 printf("foo5() returned %d, exepcted 1\n", i);
40 cErrors++;
41 }
42
43 i = foo6();
44 if (i != 12)
45 {
46 printf("foo6() returned %d, exepcted 12\n", i);
47 cErrors++;
48 }
49
50 i = bar1 + bar2 + bar3 + bar4 + bar5 + bar6;
51 if (i != 15)
52 {
53 printf("bar sum is %d exepcted 21\n", i);
54 cErrors++;
55 }
56
57 return cErrors;
58}
Note: See TracBrowser for help on using the repository browser.