| Last change
 on this file since 3578 was             325, checked in by bird, 22 years ago | 
        
          | 
Enumerations.
 | 
        
          | 
              
Property                 cvs2svn:cvs-rev
 set to                 1.4
Property                 svn:eol-style
 set to                 native
Property                 svn:executable
 set to                 *
Property                 svn:keywords
 set to                 Author Date Id Revision | 
        
          | File size:
            902 bytes | 
      
      
| Line |  | 
|---|
| 1 | /* step this code and check that everything is visible and step ordre is ok. */ | 
|---|
| 2 |  | 
|---|
| 3 | /* Check that both these are viewable in the 'program monitor'. */ | 
|---|
| 4 | static int      fileglobal = 2; | 
|---|
| 5 | int             realglobal = 1; | 
|---|
| 6 |  | 
|---|
| 7 | /* Enum test: check that these are ok and the value is stringified */ | 
|---|
| 8 | enum ENM { enmA, enmB, enmC}; | 
|---|
| 9 | static enum ENM enmfileglobal = enmA; | 
|---|
| 10 | enum ENM        enmrealglobal = enmB; | 
|---|
| 11 |  | 
|---|
| 12 | /* Enum test: check that these are ok and the value is stringified */ | 
|---|
| 13 | enum { enmAnon, enmBnon, enmCnon} | 
|---|
| 14 | enmAnonymous; | 
|---|
| 15 |  | 
|---|
| 16 |  | 
|---|
| 17 | int foo(int i, int j) | 
|---|
| 18 | { | 
|---|
| 19 | static int myVar = 0; | 
|---|
| 20 | static int myVar2; | 
|---|
| 21 |  | 
|---|
| 22 | if (myVar++) | 
|---|
| 23 | { | 
|---|
| 24 | int scope; | 
|---|
| 25 |  | 
|---|
| 26 | return scope + myVar + myVar2; | 
|---|
| 27 | } | 
|---|
| 28 | myVar2++; | 
|---|
| 29 | return 0; | 
|---|
| 30 | } | 
|---|
| 31 |  | 
|---|
| 32 | static int bar(int i, int j) | 
|---|
| 33 | { | 
|---|
| 34 | return i+j; | 
|---|
| 35 | } | 
|---|
| 36 |  | 
|---|
| 37 | void stub(void) | 
|---|
| 38 | { | 
|---|
| 39 | } | 
|---|
| 40 |  | 
|---|
| 41 | int main(int argc, char **argv) | 
|---|
| 42 | { | 
|---|
| 43 | int i; | 
|---|
| 44 | i = foo(1, 2); | 
|---|
| 45 | i += bar(1, 2); | 
|---|
| 46 | stub(); | 
|---|
| 47 | return i; | 
|---|
| 48 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.