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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [PR19870.java] - Blame information for rev 765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
// PR19870: Test static field access across nested class boundaries.
2
//
3
public class PR19870
4
{
5
  private static int x = 123;
6
 
7
  static class Foo
8
  {
9
    private static int junk = 1000;
10
 
11
    static void snafu( )
12
    {
13
      System.out.println( x);
14
      x = 456;
15
      System.out.println( PR19870.x);
16
      PR19870.x = 789;
17
      System.out.println( PR19870.x);
18
 
19
      System.out.println( Bar.junk);
20
    }
21
  }
22
 
23
  static class Bar
24
  {
25
    private static int junk = 1984;
26
 
27
    static void snafu( )
28
    {
29
      System.out.println( Foo.junk);
30
      Foo.junk = 2000;
31
      System.out.println( Foo.junk);
32
    }
33
  }
34
 
35
  public static void main( String[] args)
36
  {
37
    Foo.snafu( );
38
    Bar.snafu( );
39
 
40
    System.out.println( Foo.junk);
41
    Foo.junk = 3000;
42
    System.out.println( Foo.junk);
43
  }
44
}

powered by: WebSVN 2.1.0

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