summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/KeepInline.java
blob: 8c2672dd06c7ca6eff91c00f3e2bd9a27beaab01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Demonstrate that private methods can be reflected even if they are
// not referenced at compile-time (i.e. -fkeep-inline-functions works).
import java.lang.reflect.Method;
public class KeepInline {
  private void example() {
    System.out.println("example");
  }
  public static void main(String[] args) {
    try {
      KeepInline pr = new KeepInline();
      Method[] meths = pr.getClass().getDeclaredMethods();
      for (int n = 0; n < meths.length; n++)
        System.out.println(meths[n]);
    } catch (Throwable t) {
      t.printStackTrace();
    }
  }
}