home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / gdb / testsuite / gdb.t12 / gdbme1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-12  |  878 b   |  46 lines

  1. static int filelocal = 2;    /* In Data section */
  2. static int filelocal_bss;    /* In BSS section */
  3. #ifndef __STDC__
  4. #define    const    /**/
  5. #endif
  6. static const int filelocal_ro = 202;    /* In Read-Only Data section */
  7.  
  8. foo ()
  9. {
  10.   static int funclocal = 3;    /* In Data section */
  11.   static int funclocal_bss;    /* In BSS section */
  12.   static const int funclocal_ro = 203;    /* RO Data */
  13.   static const int funclocal_ro_bss;    /* RO Data */
  14.  
  15.   funclocal_bss = 103;
  16.   bar ();
  17. }
  18.  
  19. bar ()
  20. {
  21.   static int funclocal = 4;    /* In data section */
  22.   static int funclocal_bss;    /* In BSS section */
  23.   funclocal_bss = 104;
  24. }
  25.  
  26. init1 ()
  27. {
  28.   filelocal_bss = 102;
  29. }
  30.  
  31. /* On some systems, such as AIX, unreferenced variables are deleted
  32.    from the executable.  */
  33. usestatics1 ()
  34. {
  35.   useit1 (filelocal);
  36.   useit1 (filelocal_bss);
  37.   useit1 (filelocal_ro);
  38. }
  39.  
  40. useit1 (val)
  41. {
  42.     static int usedval;
  43.  
  44.     usedval = val;
  45. }
  46.