summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/439-npe/expected.txt70
-rw-r--r--test/439-npe/src/Main.java240
2 files changed, 3 insertions, 307 deletions
diff --git a/test/439-npe/expected.txt b/test/439-npe/expected.txt
index b4fd6bb002..34855ee91d 100644
--- a/test/439-npe/expected.txt
+++ b/test/439-npe/expected.txt
@@ -52,73 +52,3 @@ $opt$noinline$getByteElement
$opt$noinline$getBooleanElement
$opt$noinline$getCharElement
$opt$noinline$getShortElement
-i0=4
-i1=8
-i2=12
-i3=16
-i4=20
-i5=24
-i6=28
-i7=32
-i8=36
-i9=40
-i10=44
-i11=48
-i12=52
-i13=56
-i14=44
-i15=57
-l0=84
-l1=88
-l2=92
-l3=96
-l4=100
-l5=104
-l6=108
-l7=112
-l8=116
-l9=120
-l10=124
-l11=128
-l12=132
-l13=136
-l14=104
-l15=146
-f0=164.0
-f1=168.0
-f2=172.0
-f3=176.0
-f4=180.0
-f5=184.0
-f6=188.0
-f7=192.0
-f8=196.0
-f9=200.0
-f10=204.0
-f11=208.0
-f12=212.0
-f13=216.0
-f14=164.0
-f15=55.5
-d0=244.0
-d1=248.0
-d2=252.0
-d3=256.0
-d4=260.0
-d5=264.0
-d6=268.0
-d7=272.0
-d8=276.0
-d9=280.0
-d10=284.0
-d11=288.0
-d12=292.0
-d13=296.0
-d14=224.0
-d15=75.125
-addInt=42
-addLong=111
-addFloat=0.5
-addDouble=0.125
-m=null
-i=2
diff --git a/test/439-npe/src/Main.java b/test/439-npe/src/Main.java
index bc044a44c4..8f66da04de 100644
--- a/test/439-npe/src/Main.java
+++ b/test/439-npe/src/Main.java
@@ -634,246 +634,12 @@ public class Main {
} catch (NullPointerException npe) {
check(npe, thisLine += 6, methodLine += 5, "$opt$noinline$getShortElement");
}
+ }
- $opt$noinline$testRegisterRetrieval();
- }
-
- static void $opt$noinline$testRegisterRetrieval() {
- Main[] array = $noinline$PrepareArray();
- int i0 = 0;
- int i1 = 1;
- int i2 = 2;
- int i3 = 3;
- int i4 = 4;
- int i5 = 5;
- int i6 = 6;
- int i7 = 7;
- int i8 = 8;
- int i9 = 9;
- int i10 = 10;
- int i11 = 11;
- int i12 = 12;
- int i13 = 13;
- int i14 = 14;
- int i15 = 15;
- long l0 = 20L;
- long l1 = 21L;
- long l2 = 22L;
- long l3 = 23L;
- long l4 = 24L;
- long l5 = 25L;
- long l6 = 26L;
- long l7 = 27L;
- long l8 = 28L;
- long l9 = 29L;
- long l10 = 30L;
- long l11 = 31L;
- long l12 = 32L;
- long l13 = 33L;
- long l14 = 34L;
- long l15 = 35L;
- float f0 = 40.0f;
- float f1 = 41.0f;
- float f2 = 42.0f;
- float f3 = 43.0f;
- float f4 = 44.0f;
- float f5 = 45.0f;
- float f6 = 46.0f;
- float f7 = 47.0f;
- float f8 = 48.0f;
- float f9 = 49.0f;
- float f10 = 50.0f;
- float f11 = 51.0f;
- float f12 = 52.0f;
- float f13 = 53.0f;
- float f14 = 54.0f;
- float f15 = 55.0f;
- double d0 = 60.0;
- double d1 = 61.0;
- double d2 = 62.0;
- double d3 = 63.0;
- double d4 = 64.0;
- double d5 = 65.0;
- double d6 = 66.0;
- double d7 = 67.0;
- double d8 = 68.0;
- double d9 = 69.0;
- double d10 = 70.0;
- double d11 = 71.0;
- double d12 = 72.0;
- double d13 = 73.0;
- double d14 = 74.0;
- double d15 = 75.0;
- int addInt = -1;
- long addLong = -2L;
- float addFloat = -3.0f;
- double addDouble = -4.0;
- Main m = null;
- int i = 0;
- try {
- for (i = 0; i < array.length; ++i) {
- m = array[i];
- // We have 16 ints, 16 longs, 16 floats, 16 doubles and a few helper variables here,
- // none of them anonymous. Hopefully, all available physical registers will be allocated
- // to these variables, so that when `m.intField` throws NPE during the third iteration,
- // we will fully test retrieval of values from all physical registers.
- addInt = m.intField;
- addLong = m.longField;
- addFloat = m.floatField;
- addDouble = m.doubleField;
- i0 += i1;
- i1 += i2;
- i2 += i3;
- i3 += i4;
- i4 += i5;
- i5 += i6;
- i6 += i7;
- i7 += i8;
- i8 += i9;
- i9 += i10;
- i10 += i11;
- i11 += i12;
- i12 += i13;
- i13 += i14;
- i14 += i15;
- i15 += addInt;
- l0 += l1;
- l1 += l2;
- l2 += l3;
- l3 += l4;
- l4 += l5;
- l5 += l6;
- l6 += l7;
- l7 += l8;
- l8 += l9;
- l9 += l10;
- l10 += l11;
- l11 += l12;
- l12 += l13;
- l13 += l14;
- l14 += l15;
- l15 += addLong;
- f0 += f1;
- f1 += f2;
- f2 += f3;
- f3 += f4;
- f4 += f5;
- f5 += f6;
- f6 += f7;
- f7 += f8;
- f8 += f9;
- f9 += f10;
- f10 += f11;
- f11 += f12;
- f12 += f13;
- f13 += f14;
- f14 += f15;
- f15 += addFloat;
- d0 += d1;
- d1 += d2;
- d2 += d3;
- d3 += d4;
- d4 += d5;
- d5 += d6;
- d6 += d7;
- d7 += d8;
- d8 += d9;
- d9 += d10;
- d10 += d11;
- d11 += d12;
- d12 += d13;
- d13 += d14;
- d14 += d15;
- d15 += addDouble;
- }
- } catch (NullPointerException npe) {
- System.out.println("i0=" + i0);
- System.out.println("i1=" + i1);
- System.out.println("i2=" + i2);
- System.out.println("i3=" + i3);
- System.out.println("i4=" + i4);
- System.out.println("i5=" + i5);
- System.out.println("i6=" + i6);
- System.out.println("i7=" + i7);
- System.out.println("i8=" + i8);
- System.out.println("i9=" + i9);
- System.out.println("i10=" + i10);
- System.out.println("i11=" + i11);
- System.out.println("i12=" + i12);
- System.out.println("i13=" + i13);
- System.out.println("i14=" + i14);
- System.out.println("i15=" + i15);
- System.out.println("l0=" + l0);
- System.out.println("l1=" + l1);
- System.out.println("l2=" + l2);
- System.out.println("l3=" + l3);
- System.out.println("l4=" + l4);
- System.out.println("l5=" + l5);
- System.out.println("l6=" + l6);
- System.out.println("l7=" + l7);
- System.out.println("l8=" + l8);
- System.out.println("l9=" + l9);
- System.out.println("l10=" + l10);
- System.out.println("l11=" + l11);
- System.out.println("l12=" + l12);
- System.out.println("l13=" + l13);
- System.out.println("l14=" + l14);
- System.out.println("l15=" + l15);
- System.out.println("f0=" + f0);
- System.out.println("f1=" + f1);
- System.out.println("f2=" + f2);
- System.out.println("f3=" + f3);
- System.out.println("f4=" + f4);
- System.out.println("f5=" + f5);
- System.out.println("f6=" + f6);
- System.out.println("f7=" + f7);
- System.out.println("f8=" + f8);
- System.out.println("f9=" + f9);
- System.out.println("f10=" + f10);
- System.out.println("f11=" + f11);
- System.out.println("f12=" + f12);
- System.out.println("f13=" + f13);
- System.out.println("f14=" + f14);
- System.out.println("f15=" + f15);
- System.out.println("d0=" + d0);
- System.out.println("d1=" + d1);
- System.out.println("d2=" + d2);
- System.out.println("d3=" + d3);
- System.out.println("d4=" + d4);
- System.out.println("d5=" + d5);
- System.out.println("d6=" + d6);
- System.out.println("d7=" + d7);
- System.out.println("d8=" + d8);
- System.out.println("d9=" + d9);
- System.out.println("d10=" + d10);
- System.out.println("d11=" + d11);
- System.out.println("d12=" + d12);
- System.out.println("d13=" + d13);
- System.out.println("d14=" + d14);
- System.out.println("d15=" + d15);
- System.out.println("addInt=" + addInt);
- System.out.println("addLong=" + addLong);
- System.out.println("addFloat=" + addFloat);
- System.out.println("addDouble=" + addDouble);
- System.out.println("m=" + m);
- System.out.println("i=" + i);
- }
- }
-
- static Main[] $noinline$PrepareArray() {
- if (doThrow) { throw new Error(); }
- Main[] array = new Main[] { new Main(), new Main(), null, new Main() };
- array[1].intField = 42;
- array[1].longField = 111L;
- array[1].floatField = 0.5f;
- array[1].doubleField = 0.125;
- return array;
- }
-
- static void check(NullPointerException npe, int mainLine, int methodLine, String methodName) {
+ static void check(NullPointerException npe, int mainLine, int medthodLine, String methodName) {
System.out.println(methodName);
StackTraceElement[] trace = npe.getStackTrace();
- checkElement(trace[0], "Main", methodName, "Main.java", methodLine);
+ checkElement(trace[0], "Main", methodName, "Main.java", medthodLine);
checkElement(trace[1], "Main", "main", "Main.java", mainLine);
}