Merge "Add uninitialized/protected field access test. Also some minor formatting and comment cleanup."
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget/TestStubs.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget/TestStubs.java
index 7745918..b5de007 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget/TestStubs.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget/TestStubs.java
@@ -19,6 +19,6 @@
public class TestStubs {
// used by testVFE4
private int TestStubField = 50;
- // used by testVFE15
+ // used by testVFE15 and testVFE35
protected int TestStubProtectedField = 50;
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget/Test_iget.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget/Test_iget.java
index c3a0f09..938beec 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget/Test_iget.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget/Test_iget.java
@@ -31,7 +31,7 @@
import dot.junit.opcodes.iget.d.T_iget_9;
public class Test_iget extends DxTestCase {
-
+
/**
* @title type - int
*/
@@ -64,9 +64,9 @@
public void testE2() {
loadAndRun("dot.junit.opcodes.iget.d.T_iget_9", NullPointerException.class);
}
-
+
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -74,23 +74,22 @@
}
/**
- *
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
load("dot.junit.opcodes.iget.d.T_iget_3", VerifyError.class);
}
-
+
/**
- * @constraint B13
- * @title read integer from long field - only field with same name but
+ * @constraint B13
+ * @title read integer from long field - only field with same name but
* different type exist
*/
public void testVFE3() {
loadAndRun("dot.junit.opcodes.iget.d.T_iget_13", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read inaccessible private field.
@@ -115,7 +114,7 @@
public void testVFE6() {
loadAndRun("dot.junit.opcodes.iget.d.T_iget_8", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read superclass' private field from subclass.
@@ -124,69 +123,63 @@
//@uses dot.junit.opcodes.iget.d.T_iget_1
loadAndRun("dot.junit.opcodes.iget.d.T_iget_12", IllegalAccessError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget shall not work for reference fields
*/
public void testVFE8() {
load("dot.junit.opcodes.iget.d.T_iget_14", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget shall not work for short fields
*/
public void testVFE9() {
load("dot.junit.opcodes.iget.d.T_iget_15", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget shall not work for boolean fields
*/
public void testVFE10() {
load("dot.junit.opcodes.iget.d.T_iget_16", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget shall not work for char fields
*/
public void testVFE11() {
load("dot.junit.opcodes.iget.d.T_iget_17", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget shall not work for byte fields
*/
public void testVFE12() {
load("dot.junit.opcodes.iget.d.T_iget_18", VerifyError.class);
- }
-
+ }
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget shall not work for double fields
*/
public void testVFE13() {
load("dot.junit.opcodes.iget.d.T_iget_19", VerifyError.class);
- }
-
+ }
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget shall not work for long fields
*/
public void testVFE14() {
load("dot.junit.opcodes.iget.d.T_iget_20", VerifyError.class);
}
-
+
/**
* @constraint B12
* @title Attempt to read protected field of unrelated class.
@@ -195,18 +188,17 @@
//@uses dot.junit.opcodes.iget.TestStubs
loadAndRun("dot.junit.opcodes.iget.d.T_iget_21", IllegalAccessError.class);
}
-
+
/**
* @constraint A11
* @title Attempt to read static field.
*/
public void testVFE16() {
- //@uses dot.junit.opcodes.iget.TestStubs
loadAndRun("dot.junit.opcodes.iget.d.T_iget_5", IncompatibleClassChangeError.class);
}
/**
- * @constraint B6
+ * @constraint B6
* @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
@@ -214,11 +206,20 @@
}
/**
- * @constraint N/A
+ * @constraint N/A
* @title instance fields may only be accessed on reference values.
*/
public void testVFE31() {
load("dot.junit.opcodes.iget.d.T_iget_31", VerifyError.class);
}
+
+ /**
+ * @constraint N/A
+ * @title Attempt to read inaccessible protected field on uninitialized reference.
+ */
+ public void testVFE35() {
+ //@uses dot.junit.opcodes.iget.TestStubs
+ load("dot.junit.opcodes.iget.d.T_iget_35", VerifyError.class);
+ }
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget/d/T_iget_35.d b/tools/vm-tests-tf/src/dot/junit/opcodes/iget/d/T_iget_35.d
new file mode 100644
index 0000000..57df084
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget/d/T_iget_35.d
@@ -0,0 +1,31 @@
+; Copyright (C) 2016 The Android Open Source Project
+;
+; Licensed under the Apache License, Version 2.0 (the "License");
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+
+.source T_iget_35.java
+.class public dot.junit.opcodes.iget.d.T_iget_35
+.super java/lang/Object
+
+.method public <init>()V
+.limit regs 1
+ invoke-direct {v0}, java/lang/Object/<init>()V
+ return-void
+.end method
+
+.method public run()I
+.limit regs 2
+ iget v0, v1, dot.junit.opcodes.iget.TestStubs.TestStubProtectedField I
+ return v0
+.end method
+
+
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget/d/T_iget_35.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget/d/T_iget_35.java
new file mode 100644
index 0000000..696a6a1
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget/d/T_iget_35.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dot.junit.opcodes.iget.d;
+
+public class T_iget_35 {
+
+ public int run() {
+ return 0;
+ }
+}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/TestStubs.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/TestStubs.java
index 8dcd427..af78d74 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/TestStubs.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/TestStubs.java
@@ -19,6 +19,6 @@
public class TestStubs {
// used by testVFE4
private boolean TestStubField = true;
- // used by testVFE15
+ // used by testVFE15 and testVFE35
protected boolean TestStubProtectedField = true;
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/Test_iget_boolean.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/Test_iget_boolean.java
index f16b89c..1f6a94a 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/Test_iget_boolean.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/Test_iget_boolean.java
@@ -30,16 +30,15 @@
import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_9;
public class Test_iget_boolean extends DxTestCase {
-
+
/**
- * @title get boolean from field
+ * @title get boolean from field
*/
public void testN1() {
T_iget_boolean_1 t = new T_iget_boolean_1();
assertEquals(true, t.run());
}
-
/**
* @title access protected field from subclass
*/
@@ -59,7 +58,7 @@
}
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -67,22 +66,22 @@
}
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_3", VerifyError.class);
}
-
+
/**
- * @constraint B13
- * @title read boolean from long field - only field with same name but
+ * @constraint B13
+ * @title read boolean from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
loadAndRun("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_13", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read inaccessible field
@@ -108,7 +107,7 @@
public void testVFE6() {
loadAndRun("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_8", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read superclass' private field from subclass.
@@ -118,64 +117,63 @@
//@uses dot.junit.opcodes.iget_boolean.d.T_iget_boolean_12
loadAndRun("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_12", IllegalAccessError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_boolean shall not work for reference fields
*/
public void testVFE8() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_14", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_boolean shall not work for short fields
*/
public void testVFE9() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_15", VerifyError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_boolean shall not work for int fields
*/
public void testVFE10() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_16", VerifyError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_boolean shall not work for char fields
*/
public void testVFE11() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_17", VerifyError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_boolean shall not work for byte fields
*/
public void testVFE12() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_18", VerifyError.class);
- }
-
+ }
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_boolean shall not work for double fields
*/
public void testVFE13() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_19", VerifyError.class);
- }
-
+ }
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_boolean shall not work for long fields
*/
public void testVFE14() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_20", VerifyError.class);
}
-
+
/**
* @constraint B12
* @title Attempt to read inaccessible protected field.
@@ -191,14 +189,13 @@
* @title Attempt to read static field.
*/
public void testVFE16() {
- //@uses dot.junit.opcodes.iget_boolean.TestStubs
loadAndRun("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_5",
IncompatibleClassChangeError.class);
}
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_30", VerifyError.class);
@@ -211,4 +208,13 @@
public void testVFE31() {
load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_31", VerifyError.class);
}
+
+ /**
+ * @constraint N/A
+ * @title Attempt to read inaccessible protected field on uninitialized reference.
+ */
+ public void testVFE35() {
+ //@uses dot.junit.opcodes.iget_boolean.TestStubs
+ load("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_35", VerifyError.class);
+ }
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_35.d b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_35.d
new file mode 100644
index 0000000..babcc08
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_35.d
@@ -0,0 +1,31 @@
+; Copyright (C) 2016 The Android Open Source Project
+;
+; Licensed under the Apache License, Version 2.0 (the "License");
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+
+.source T_iget_boolean_35.java
+.class public dot.junit.opcodes.iget_boolean.d.T_iget_boolean_35
+.super java/lang/Object
+
+.method public <init>()V
+.limit regs 1
+ invoke-direct {v0}, java/lang/Object/<init>()V
+ return-void
+.end method
+
+.method public run()Z
+.limit regs 2
+ iget-boolean v0, v1, dot.junit.opcodes.iget_boolean.TestStubs.TestStubProtectedField Z
+ return v0
+.end method
+
+
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_35.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_35.java
new file mode 100644
index 0000000..7c95c37
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_35.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dot.junit.opcodes.iget_boolean.d;
+
+public class T_iget_boolean_35 {
+
+ public boolean run(){
+ return false;
+ }
+}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/TestStubs.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/TestStubs.java
index 90b1f13..ffae3b1 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/TestStubs.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/TestStubs.java
@@ -19,6 +19,6 @@
public class TestStubs {
// used by testVFE4
private byte TestStubField = 50;
- // ussed by testVFE15
+ // used by testVFE15 and testVFE35
protected byte TestStubProtectedField = 50;
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/Test_iget_byte.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/Test_iget_byte.java
index 410dad4..4e7bbc7 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/Test_iget_byte.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/Test_iget_byte.java
@@ -30,16 +30,15 @@
import dot.junit.opcodes.iget_byte.d.T_iget_byte_9;
public class Test_iget_byte extends DxTestCase {
-
+
/**
- * @title get byte from field
+ * @title get byte from field
*/
public void testN1() {
T_iget_byte_1 t = new T_iget_byte_1();
assertEquals(77, t.run());
}
-
/**
* @title access protected field from subclass
*/
@@ -55,10 +54,10 @@
*/
public void testE2() {
loadAndRun("dot.junit.opcodes.iget_byte.d.T_iget_byte_9", NullPointerException.class);
- }
+ }
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -66,22 +65,22 @@
}
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_3", VerifyError.class);
}
-
+
/**
- * @constraint B13
- * @title read byte from long field - only field with same name but
+ * @constraint B13
+ * @title read byte from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
loadAndRun("dot.junit.opcodes.iget_byte.d.T_iget_byte_13", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read inaccessible field.
@@ -106,7 +105,7 @@
public void testVFE6() {
loadAndRun("dot.junit.opcodes.iget_byte.d.T_iget_byte_8", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read superclass' private field from subclass.
@@ -115,63 +114,63 @@
//@uses dot.junit.opcodes.iget_byte.d.T_iget_byte_1
loadAndRun("dot.junit.opcodes.iget_byte.d.T_iget_byte_12", IllegalAccessError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_byte shall not work for reference fields
*/
public void testVFE8() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_14", VerifyError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_byte shall not work for short fields
*/
public void testVFE9() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_15", VerifyError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_byte shall not work for int fields
*/
public void testVFE10() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_16", VerifyError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_byte shall not work for char fields
*/
public void testVFE11() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_17", VerifyError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_byte shall not work for boolean fields
*/
public void testVFE12() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_18", VerifyError.class);
- }
-
+ }
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_byte shall not work for double fields
*/
public void testVFE13() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_19", VerifyError.class);
- }
-
+ }
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_byte shall not work for long fields
*/
public void testVFE14() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_20", VerifyError.class);
}
-
+
/**
* @constraint B12
* @title Attempt to read inaccessible protected field.
@@ -181,20 +180,18 @@
loadAndRun("dot.junit.opcodes.iget_byte.d.T_iget_byte_21", IllegalAccessError.class);
}
-
/**
* @constraint A11
* @title Attempt to read static field.
*/
public void testVFE16() {
- //@uses dot.junit.opcodes.iget_byte.TestStubs
loadAndRun("dot.junit.opcodes.iget_byte.d.T_iget_byte_5",
IncompatibleClassChangeError.class);
}
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_30", VerifyError.class);
@@ -207,4 +204,13 @@
public void testVFE31() {
load("dot.junit.opcodes.iget_byte.d.T_iget_byte_31", VerifyError.class);
}
+
+ /**
+ * @constraint N/A
+ * @title Attempt to read inaccessible protected field on uninitialized reference.
+ */
+ public void testVFE35() {
+ //@uses dot.junit.opcodes.iget_byte.TestStubs
+ load("dot.junit.opcodes.iget_byte.d.T_iget_byte_35", VerifyError.class);
+ }
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_35.d b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_35.d
new file mode 100644
index 0000000..8792c96
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_35.d
@@ -0,0 +1,33 @@
+; Copyright (C) 2016 The Android Open Source Project
+;
+; Licensed under the Apache License, Version 2.0 (the "License");
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+
+.source T_iget_byte_35.java
+.class public dot.junit.opcodes.iget_byte.d.T_iget_byte_35
+.super java/lang/Object
+
+.method public <init>()V
+.limit regs 1
+ invoke-direct {v0}, java/lang/Object/<init>()V
+ return-void
+.end method
+
+.method public run()B
+.limit regs 2
+ iget-byte v0, v1, dot.junit.opcodes.iget_byte.TestStubs.TestStubProtectedField B
+ return v0
+.end method
+
+
+
+
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_35.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_35.java
new file mode 100644
index 0000000..17e78f1
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_35.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dot.junit.opcodes.iget_byte.d;
+
+public class T_iget_byte_35 {
+
+ public byte run() {
+ return 0;
+ }
+}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/TestStubs.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/TestStubs.java
index 5bf73ae..6969a104 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/TestStubs.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/TestStubs.java
@@ -19,6 +19,6 @@
public class TestStubs {
// used by testVFE4
private char TestStubField = 50;
- // ussed by testVFE15
+ // ussed by testVFE15 and testVFE35
protected char TestStubProtectedField = 50;
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/Test_iget_char.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/Test_iget_char.java
index ff86ae3..c2b8f1c 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/Test_iget_char.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/Test_iget_char.java
@@ -30,9 +30,9 @@
import dot.junit.opcodes.iget_char.d.T_iget_char_9;
public class Test_iget_char extends DxTestCase {
-
+
/**
- * @title get char from field
+ * @title get char from field
*/
public void testN1() {
T_iget_char_1 t = new T_iget_char_1();
@@ -56,10 +56,9 @@
public void testE2() {
loadAndRun("dot.junit.opcodes.iget_char.d.T_iget_char_9", NullPointerException.class);
}
-
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -67,24 +66,22 @@
}
/**
- *
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_3", VerifyError.class);
}
-
+
/**
- *
- * @constraint B13
- * @title read char from long field - only field with same name but
+ * @constraint B13
+ * @title read char from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
loadAndRun("dot.junit.opcodes.iget_char.d.T_iget_char_13", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read inaccessible field.
@@ -109,7 +106,7 @@
public void testVFE6() {
loadAndRun("dot.junit.opcodes.iget_char.d.T_iget_char_8", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read superclass' private field from subclass.
@@ -118,67 +115,63 @@
//@uses dot.junit.opcodes.iget_char.d.T_iget_char_1
loadAndRun("dot.junit.opcodes.iget_char.d.T_iget_char_12", IllegalAccessError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_char shall not work for reference fields
*/
public void testVFE8() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_14", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_char shall not work for short fields
*/
public void testVFE9() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_15", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_char shall not work for int fields
*/
public void testVFE10() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_16", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_char shall not work for byte fields
*/
public void testVFE11() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_17", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_char shall not work for boolean fields
*/
public void testVFE12() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_18", VerifyError.class);
- }
-
+ }
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_char shall not work for double fields
*/
public void testVFE13() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_19", VerifyError.class);
- }
-
+ }
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_char shall not work for long fields
*/
public void testVFE14() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_20", VerifyError.class);
}
-
+
/**
* @constraint B12
* @title Attempt to read inaccessible protected field.
@@ -194,15 +187,13 @@
* @title Attempt to read static field.
*/
public void testVFE16() {
- //@uses dot.junit.opcodes.iget_char.TestStubs
loadAndRun("dot.junit.opcodes.iget_char.d.T_iget_char_5",
IncompatibleClassChangeError.class);
}
-
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_30", VerifyError.class);
@@ -215,4 +206,13 @@
public void testVFE31() {
load("dot.junit.opcodes.iget_char.d.T_iget_char_31", VerifyError.class);
}
+
+ /**
+ * @constraint N/A
+ * @title Attempt to read inaccessible protected field on uninitialized reference.
+ */
+ public void testVFE35() {
+ //@uses dot.junit.opcodes.iget_char.TestStubs
+ load("dot.junit.opcodes.iget_char.d.T_iget_char_35", VerifyError.class);
+ }
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/d/T_iget_char_35.d b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/d/T_iget_char_35.d
new file mode 100644
index 0000000..53ac999
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/d/T_iget_char_35.d
@@ -0,0 +1,31 @@
+; Copyright (C) 2016 The Android Open Source Project
+;
+; Licensed under the Apache License, Version 2.0 (the "License");
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+
+.source T_iget_char_35.java
+.class public dot.junit.opcodes.iget_char.d.T_iget_char_35
+.super java/lang/Object
+
+.method public <init>()V
+.limit regs 1
+ invoke-direct {v0}, java/lang/Object/<init>()V
+ return-void
+.end method
+
+.method public run()C
+.limit regs 2
+ iget-char v0, v1, dot.junit.opcodes.iget_char.TestStubs.TestStubProtectedField C
+ return v0
+.end method
+
+
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/d/T_iget_char_35.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/d/T_iget_char_35.java
new file mode 100644
index 0000000..0b3434a
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_char/d/T_iget_char_35.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dot.junit.opcodes.iget_char.d;
+
+public class T_iget_char_35 {
+
+ public char run() {
+ return 0;
+ }
+}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/TestStubs.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/TestStubs.java
index 0a68e56..74d7f93 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/TestStubs.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/TestStubs.java
@@ -19,6 +19,6 @@
public class TestStubs {
// used by testVFE4
private Object TestStubField = null;
- // used by testVFE15
+ // used by testVFE16 and testVFE35
protected Object TestStubProtectedField = null;
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/Test_iget_object.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/Test_iget_object.java
index 7314141..9ae5548 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/Test_iget_object.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/Test_iget_object.java
@@ -24,6 +24,7 @@
import dot.junit.opcodes.iget_object.d.T_iget_object_13;
import dot.junit.opcodes.iget_object.d.T_iget_object_21;
import dot.junit.opcodes.iget_object.d.T_iget_object_22;
+import dot.junit.opcodes.iget_object.d.T_iget_object_35;
import dot.junit.opcodes.iget_object.d.T_iget_object_5;
import dot.junit.opcodes.iget_object.d.T_iget_object_6;
import dot.junit.opcodes.iget_object.d.T_iget_object_7;
@@ -31,9 +32,9 @@
import dot.junit.opcodes.iget_object.d.T_iget_object_9;
public class Test_iget_object extends DxTestCase {
-
+
/**
- * @title get reference from field
+ * @title get reference from field
*/
public void testN1() {
T_iget_object_1 t = new T_iget_object_1();
@@ -56,10 +57,10 @@
*/
public void testE2() {
loadAndRun("dot.junit.opcodes.iget_object.d.T_iget_object_9", NullPointerException.class);
- }
+ }
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -67,24 +68,22 @@
}
/**
- *
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_3", VerifyError.class);
}
-
+
/**
- *
- * @constraint B13
- * @title (read object from long field - only field with same name but
+ * @constraint B13
+ * @title (read object from long field - only field with same name but
* different type exists)
*/
public void testVFE3() {
loadAndRun("dot.junit.opcodes.iget_object.d.T_iget_object_13", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read inaccessible field.
@@ -109,7 +108,7 @@
public void testVFE6() {
loadAndRun("dot.junit.opcodes.iget_object.d.T_iget_object_8", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read superclass' private field from subclass.
@@ -118,78 +117,71 @@
//@uses dot.junit.opcodes.iget_object.d.T_iget_object_1
loadAndRun("dot.junit.opcodes.iget_object.d.T_iget_object_12", IllegalAccessError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_object shall not work for short fields
*/
public void testVFE8() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_14", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_object shall not work for char fields
*/
public void testVFE9() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_15", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_object shall not work for int fields
*/
public void testVFE10() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_16", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_object shall not work for byte fields
*/
public void testVFE11() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_17", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_object shall not work for boolean fields
*/
public void testVFE12() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_18", VerifyError.class);
- }
-
+ }
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_object shall not work for double fields
*/
public void testVFE13() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_19", VerifyError.class);
- }
-
+ }
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_object shall not work for long fields
*/
public void testVFE14() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_20", VerifyError.class);
- }
-
+ }
+
/**
- *
- * @constraint B13
+ * @constraint B13
* @title only field of different type exists
*/
public void testVFE15() {
loadAndRun("dot.junit.opcodes.iget_object.d.T_iget_object_21", NoSuchFieldError.class);
}
-
+
/**
* @constraint B12
* @title Attempt to read inaccessible protected field.
@@ -204,14 +196,13 @@
* @title Attempt to read static field.
*/
public void testVFE17() {
- //@uses dot.junit.opcodes.iget_object.TestStubs
loadAndRun("dot.junit.opcodes.iget_object.d.T_iget_object_5",
IncompatibleClassChangeError.class);
}
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_30", VerifyError.class);
@@ -219,9 +210,18 @@
/**
* @constraint N/A
- * @title instance fields may only be accessed on already initialized instances.
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE31() {
load("dot.junit.opcodes.iget_object.d.T_iget_object_31", VerifyError.class);
}
+
+ /**
+ * @constraint N/A
+ * @title Attempt to read inaccessible protected field on uninitialized reference.
+ */
+ public void testVFE35() {
+ //@uses dot.junit.opcodes.iget_object.TestStubs
+ load("dot.junit.opcodes.iget_object.d.T_iget_object_35", VerifyError.class);
+ }
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/d/T_iget_object_35.d b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/d/T_iget_object_35.d
new file mode 100644
index 0000000..a4fc423
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/d/T_iget_object_35.d
@@ -0,0 +1,31 @@
+; Copyright (C) 2016 The Android Open Source Project
+;
+; Licensed under the Apache License, Version 2.0 (the "License");
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+
+.source T_iget_object_35.java
+.class public dot.junit.opcodes.iget_object.d.T_iget_object_35
+.super java/lang/Object
+
+.method public <init>()V
+.limit regs 1
+ invoke-direct {v0}, java/lang/Object/<init>()V
+ return-void
+.end method
+
+.method public run()Ljava/lang/Object;
+.limit regs 2
+ iget-object v0, v1, dot.junit.opcodes.iget_object.TestStubs.TestStubProtectedField Ljava/lang/Object;
+ return-object v0
+.end method
+
+
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/d/T_iget_object_35.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/d/T_iget_object_35.java
new file mode 100644
index 0000000..f7ceb9b
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_object/d/T_iget_object_35.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dot.junit.opcodes.iget_object.d;
+
+public class T_iget_object_35 {
+
+ public Object run() {
+ return null;
+ }
+}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/TestStubs.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/TestStubs.java
index 8580ec3..f299301 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/TestStubs.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/TestStubs.java
@@ -19,6 +19,6 @@
public class TestStubs {
// used by testVFE4
private short TestStubField = 50;
- // used by testVFE15
+ // used by testVFE15 and testVFE35
protected short TestStubProtectedField = 50;
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/Test_iget_short.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/Test_iget_short.java
index 566ec3f..bd77708 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/Test_iget_short.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/Test_iget_short.java
@@ -30,7 +30,7 @@
import dot.junit.opcodes.iget_short.d.T_iget_short_9;
public class Test_iget_short extends DxTestCase {
-
+
/**
* @title get short from field
*/
@@ -58,7 +58,7 @@
}
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -66,24 +66,22 @@
}
/**
- *
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_3", VerifyError.class);
}
-
+
/**
- *
- * @constraint B13
- * @title read short from long field - only field with same name but
+ * @constraint B13
+ * @title read short from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
loadAndRun("dot.junit.opcodes.iget_short.d.T_iget_short_13", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read inaccessible field.
@@ -108,7 +106,7 @@
public void testVFE6() {
loadAndRun("dot.junit.opcodes.iget_short.d.T_iget_short_8", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read superclass' private field from subclass.
@@ -117,69 +115,63 @@
//@uses dot.junit.opcodes.iget_short.d.T_iget_short_1
loadAndRun("dot.junit.opcodes.iget_short.d.T_iget_short_12", IllegalAccessError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget_short shall not work for reference fields
*/
public void testVFE8() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_14", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_short shall not work for char fields
*/
public void testVFE9() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_15", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_short shall not work for int fields
*/
public void testVFE10() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_16", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_short shall not work for byte fields
*/
public void testVFE11() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_17", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_short shall not work for boolean fields
*/
public void testVFE12() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_18", VerifyError.class);
- }
-
+ }
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_short shall not work for double fields
*/
public void testVFE13() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_19", VerifyError.class);
- }
-
+ }
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget_short shall not work for long fields
*/
public void testVFE14() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_20", VerifyError.class);
}
-
+
/**
* @constraint B12
* @title Attempt to read inaccessible protected field.
@@ -194,24 +186,32 @@
* @title Attempt to read static field.
*/
public void testVFE16() {
- //@uses dot.junit.opcodes.iget_short.TestStubs
loadAndRun("dot.junit.opcodes.iget_short.d.T_iget_short_5",
IncompatibleClassChangeError.class);
}
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_30", VerifyError.class);
}
/**
- * @constraint N/A
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint N/A
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE31() {
load("dot.junit.opcodes.iget_short.d.T_iget_short_31", VerifyError.class);
}
+
+ /**
+ * @constraint N/A
+ * @title Attempt to read inaccessible protected field on uninitialized reference.
+ */
+ public void testVFE35() {
+ //@uses dot.junit.opcodes.iget_short.TestStubs
+ load("dot.junit.opcodes.iget_short.d.T_iget_short_35", VerifyError.class);
+ }
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.d b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.d
index e806df2..f3298fb 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.d
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.d
@@ -24,14 +24,14 @@
return-void
.end method
-.method public run()V
+.method public run()S
.limit regs 3
new-instance v0, Ldot/junit/opcodes/iget_short/TestStubs;
invoke-direct {v0}, dot/junit/opcodes/iget_short/TestStubs/<init>()V
-
+
iget-short v1, v0, dot.junit.opcodes.iget_short.TestStubs.TestStubProtectedField S
- return-void
+ return v1
.end method
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.java
index 5bb7f6e..bcb8dca 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.java
@@ -18,6 +18,7 @@
public class T_iget_short_21 {
- public void run() {
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_35.d b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_35.d
new file mode 100644
index 0000000..5cde5bb
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_35.d
@@ -0,0 +1,32 @@
+; Copyright (C) 2016 The Android Open Source Project
+;
+; Licensed under the Apache License, Version 2.0 (the "License");
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+
+.source T_iget_short_35.java
+.class public dot.junit.opcodes.iget_short.d.T_iget_short_35
+.super java/lang/Object
+
+.method public <init>()V
+.limit regs 1
+ invoke-direct {v0}, java/lang/Object/<init>()V
+ return-void
+.end method
+
+.method public run()S
+.limit regs 2
+ iget-short v0, v1, dot.junit.opcodes.iget_short.TestStubs.TestStubProtectedField S
+ return v0
+.end method
+
+
+
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_35.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_35.java
new file mode 100644
index 0000000..f92f2b6
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_short/d/T_iget_short_35.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dot.junit.opcodes.iget_short.d;
+
+public class T_iget_short_35 {
+
+ public short run() {
+ return 0;
+ }
+}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/TestStubs.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/TestStubs.java
index f90a470..79e71c4 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/TestStubs.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/TestStubs.java
@@ -19,6 +19,6 @@
public class TestStubs {
// used by testVFE4
private long TestStubField = 50;
- // ussed by testVFE15
+ // ussed by testVFE15 and testVFE35
protected long TestStubProtectedField = 50;
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/Test_iget_wide.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/Test_iget_wide.java
index f82a1d3..6bb996f 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/Test_iget_wide.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/Test_iget_wide.java
@@ -31,7 +31,7 @@
import dot.junit.opcodes.iget_wide.d.T_iget_wide_9;
public class Test_iget_wide extends DxTestCase {
-
+
/**
* @title type - long
*/
@@ -63,10 +63,10 @@
*/
public void testE2() {
loadAndRun("dot.junit.opcodes.iget_wide.d.T_iget_wide_9", NullPointerException.class);
- }
+ }
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -74,24 +74,22 @@
}
/**
- *
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_3", VerifyError.class);
}
-
+
/**
- *
- * @constraint B13
- * @title read long from integer field - only field with same name but
+ * @constraint B13
+ * @title read long from integer field - only field with same name but
* different type exists
*/
public void testVFE3() {
loadAndRun("dot.junit.opcodes.iget_wide.d.T_iget_wide_13", NoSuchFieldError.class);
}
-
+
/**
* @constraint n/a
* @title Attempt to read inaccessible field.
@@ -103,7 +101,7 @@
/**
* @constraint n/a
- * @title Attempt to read field of undefined class.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
loadAndRun("dot.junit.opcodes.iget_wide.d.T_iget_wide_7", NoClassDefFoundError.class);
@@ -125,69 +123,63 @@
//@uses dot.junit.opcodes.iget_wide.d.T_iget_wide_1
loadAndRun("dot.junit.opcodes.iget_wide.d.T_iget_wide_12", IllegalAccessError.class);
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iget-wide shall not work for reference fields
*/
public void testVFE8() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_14", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget-wide shall not work for short fields
*/
public void testVFE9() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_15", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget-wide shall not work for boolean fields
*/
public void testVFE10() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_16", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget-wide shall not work for char fields
*/
public void testVFE11() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_17", VerifyError.class);
}
-
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget-wide shall not work for byte fields
*/
public void testVFE12() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_18", VerifyError.class);
- }
-
+ }
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget-wide shall not work for float fields
*/
public void testVFE13() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_19", VerifyError.class);
- }
-
+ }
+
/**
- *
- * @constraint B1
+ * @constraint B1
* @title iget-wide shall not work for int fields
*/
public void testVFE14() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_20", VerifyError.class);
}
-
+
/**
* @constraint B12
* @title Attempt to read inaccessible protected field.
@@ -202,14 +194,13 @@
* @title Attempt to read static field.
*/
public void testVFE16() {
- //@uses dot.junit.opcodes.iget_wide.TestStubs
- loadAndRun("dot.junit.opcodes.iget_wide.d.T_iget_wide_5",
+ loadAndRun("dot.junit.opcodes.iget_wide.d.T_iget_wide_5",
IncompatibleClassChangeError.class);
}
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_30", VerifyError.class);
@@ -217,9 +208,18 @@
/**
* @constraint N/A
- * @title instance fields may only be accessed on already initialized instances.
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE31() {
load("dot.junit.opcodes.iget_wide.d.T_iget_wide_31", VerifyError.class);
}
+
+ /**
+ * @constraint N/A
+ * @title Attempt to read inaccessible protected field on uninitialized reference.
+ */
+ public void testVFE35() {
+ //@uses dot.junit.opcodes.iget_wide.TestStubs
+ load("dot.junit.opcodes.iget_wide.d.T_iget_wide_35", VerifyError.class);
+ }
}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_35.d b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_35.d
new file mode 100644
index 0000000..505b06e
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_35.d
@@ -0,0 +1,31 @@
+; Copyright (C) 2016 The Android Open Source Project
+;
+; Licensed under the Apache License, Version 2.0 (the "License");
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+
+.source T_iget_wide_35.java
+.class public dot.junit.opcodes.iget_wide.d.T_iget_wide_35
+.super java/lang/Object
+
+.method public <init>()V
+.limit regs 1
+ invoke-direct {v0}, java/lang/Object/<init>()V
+ return-void
+.end method
+
+.method public run()J
+.limit regs 2
+ iget-wide v0, v1, dot.junit.opcodes.iget_wide.TestStubs.TestStubProtectedField J
+ return-wide v0
+.end method
+
+
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_35.java b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_35.java
new file mode 100644
index 0000000..5a8fc86
--- /dev/null
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_35.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dot.junit.opcodes.iget_wide.d;
+
+public class T_iget_wide_35 {
+
+ public long run() {
+ return -99;
+ }
+}