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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.cp/] [local.cc] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
// Tests for local types
2
 
3
void marker1 (void)
4
{
5
}
6
 
7
void marker2 (void)
8
{
9
}
10
 
11
int foobar (int x)
12
{
13
  class Local {
14
  public:
15
    int loc1;
16
    char loc_foo (char c)
17
    {
18
      return c + 3;
19
    }
20
  };
21
 
22
  Local l;
23
  static Local l1;
24
  char  c;
25
 
26
  marker1 ();
27
 
28
  l.loc1 = 23;
29
 
30
  c = l.loc_foo('x');
31
  return c + 2;
32
}
33
 
34
int main()
35
{
36
  int c;
37
 
38
  c = foobar (31);
39
 
40
 { // inner block
41
   class InnerLocal {
42
   public:
43
     char ilc;
44
     int * ip;
45
     int il_foo (unsigned const char & uccr)
46
     {
47
       return uccr + 333;
48
     }
49
     class NestedInnerLocal {
50
     public:
51
       int nil;
52
       int nil_foo (int i)
53
       {
54
         return i * 27;
55
       }
56
     };
57
     NestedInnerLocal nest1;
58
   };
59
 
60
   InnerLocal il;
61
 
62
   il.ilc = 'b';
63
   il.ip = &c;
64
   marker2();
65
 }
66
}

powered by: WebSVN 2.1.0

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