gcc/
[official-gcc.git] / libjava / testsuite / libjava.lang / sourcelocation.java
blob6cf1e40ef4a8c8706e4763e398749f722f978bce
1 /* This test should test the source location attribution.
2 We print the line number of different parts of the program to make sure
3 that the source code attribution is correct.
4 To make this test pass, one need to have up-to-date addr2line installed
5 to parse the dwarf4 data format.
6 */
7 public class sourcelocation {
8 public static void main(String args[]) {
9 try {
10 System.out.println(new Exception().getStackTrace()[0].getLineNumber());
11 throw new Exception();
12 } catch (Exception e) {
13 System.out.println(new Exception().getStackTrace()[0].getLineNumber());
14 } finally {
15 System.out.println(new Exception().getStackTrace()[0].getLineNumber());