OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.c++/] [local.cc] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
// Tests for local types
// Tests for local types
 
 
void marker1 (void)
void marker1 (void)
{
{
}
}
 
 
 
 
int foobar (int x)
int foobar (int x)
{
{
  class Local {
  class Local {
  public:
  public:
    int loc1;
    int loc1;
    char loc_foo (char c)
    char loc_foo (char c)
    {
    {
      return c + 3;
      return c + 3;
    }
    }
  };
  };
 
 
  Local l;
  Local l;
  static Local l1;
  static Local l1;
  char  c;
  char  c;
 
 
  l.loc1 = 23;
  l.loc1 = 23;
 
 
  c = l.loc_foo('x');
  c = l.loc_foo('x');
  return c + 2;
  return c + 2;
}
}
 
 
int main()
int main()
{
{
  int c;
  int c;
 
 
  c = foobar (31);
  c = foobar (31);
 
 
 { // inner block
 { // inner block
   class InnerLocal {
   class InnerLocal {
   public:
   public:
     char ilc;
     char ilc;
     int * ip;
     int * ip;
     int il_foo (unsigned const char & uccr)
     int il_foo (unsigned const char & uccr)
     {
     {
       return uccr + 333;
       return uccr + 333;
     }
     }
     class NestedInnerLocal {
     class NestedInnerLocal {
     public:
     public:
       int nil;
       int nil;
       int nil_foo (int i)
       int nil_foo (int i)
       {
       {
         return i * 27;
         return i * 27;
       }
       }
     };
     };
     NestedInnerLocal nest1;
     NestedInnerLocal nest1;
   };
   };
 
 
   InnerLocal il;
   InnerLocal il;
 
 
   il.ilc = 'b';
   il.ilc = 'b';
   il.ip = &c;
   il.ip = &c;
 }
 }
 marker1();
 marker1();
}
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.