| Last change
 on this file since 877 was             307, checked in by bird, 22 years ago | 
        
          | 
Fixing, confirmed on linux.
 | 
        
          | 
              
Property                 cvs2svn:cvs-rev
 set to                 1.2
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> | 
|---|
| 3 | extern int bar1; | 
|---|
| 4 | extern int bar2; | 
|---|
| 5 | extern int bar3; | 
|---|
| 6 | extern int bar4; | 
|---|
| 7 | extern int bar5; | 
|---|
| 8 | extern int bar6; | 
|---|
| 9 |  | 
|---|
| 10 | int 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 != 21) | 
|---|
| 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.