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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 765 jeremybenn
// Test to make sure static initializers are called
2
 
3
class bar
4
{
5
  public static int zog;
6
  public static int zag;
7
 
8
  static
9
  {
10
    zog = 12;
11
    zag = 2;
12
  }
13
 
14
  public bar() { }
15
}
16
 
17
public class StaticConstructor
18
{
19
  static int foo ()
20
  {
21
    return new bar().zog;
22
  }
23
 
24
  public static void main(String args[])
25
  {
26
    System.out.println ("" + (foo() + bar.zag));
27
  }
28
}
29
 

powered by: WebSVN 2.1.0

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