Commit 7a4ef310 by Andrew Haley Committed by Andrew Haley

StackTrace2.java: Rewrite to prevent spurious failure when some methods are inlined.

2008-08-07  Andrew Haley  <aph@redhat.com>

	* testsuite/libjava.lang/StackTrace2.java: Rewrite to prevent
	spurious failure when some methods are inlined.

From-SVN: r138840
parent b53b23dc
2008-08-07 Andrew Haley <aph@redhat.com>
* testsuite/libjava.lang/StackTrace2.java: Rewrite to prevent
spurious failure when some methods are inlined.
2008-08-05 Matthias Klose <doko@ubuntu.com> 2008-08-05 Matthias Klose <doko@ubuntu.com>
* HACKING: Update instructions how to build gcj/javaprims.h. * HACKING: Update instructions how to build gcj/javaprims.h.
......
...@@ -7,7 +7,7 @@ public class StackTrace2 ...@@ -7,7 +7,7 @@ public class StackTrace2
{ {
try try
{ {
a(); new StackTrace2().a();
} }
catch (Exception x) catch (Exception x)
{ {
...@@ -16,14 +16,14 @@ public class StackTrace2 ...@@ -16,14 +16,14 @@ public class StackTrace2
} }
} }
static void a() void a()
{ {
new Inner(); new Inner().foo();
} }
static class Inner class Inner
{ {
public Inner() public void foo()
{ {
doCrash(null); doCrash(null);
} }
...@@ -38,7 +38,7 @@ public class StackTrace2 ...@@ -38,7 +38,7 @@ public class StackTrace2
{ {
System.out.println("Trace length = " + trace.length); System.out.println("Trace length = " + trace.length);
checkLine(trace[0], "StackTrace2$Inner", "doCrash", 33); checkLine(trace[0], "StackTrace2$Inner", "doCrash", 33);
checkLine(trace[1], "StackTrace2$Inner", "<init>", 28); checkLine(trace[1], "StackTrace2$Inner", "foo", 28);
checkLine(trace[2], "StackTrace2", "a", 21); checkLine(trace[2], "StackTrace2", "a", 21);
checkLine(trace[3], "StackTrace2", "main", 10); checkLine(trace[3], "StackTrace2", "main", 10);
} }
......
Trace length = 4 Trace length = 4
StackTrace2$Inner.doCrash:OK StackTrace2$Inner.doCrash:OK
StackTrace2$Inner.<init>:OK StackTrace2$Inner.foo:OK
StackTrace2.a:OK StackTrace2.a:OK
StackTrace2.main:OK StackTrace2.main:OK
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment