summaryrefslogtreecommitdiff
path: root/test/2280-const-method-handle-validation/build.py
diff options
context:
space:
mode:
author Almaz Mingaleev <mingaleev@google.com> 2024-08-29 12:57:14 +0000
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-09-24 10:15:56 +0000
commit63b8399f3f144769260d93a7a985233e5ac5b910 (patch)
tree2d46e0d91f2df79a80f9ed80cdcb49c08e7de9f6 /test/2280-const-method-handle-validation/build.py
parent0b8cc45c57bd0d13901e2c1d15f74c8b562fb2d2 (diff)
Add more validation for const-method-handle.
Making it closer to JVMS 4.4.8 and 5.4.3.5. The RI rejects certain constructions at the class verification stage, hence there are separate classes for MethodHandle-s targeting <init> and <clinit> methods. In these cases The RI throws ClassFormatError during class load, but currently we do validations only when actual MethodHandle object is constructed, that's is the reason why test code has ICCE | CFE in catch blocks. That will be addressed in the upcoming CLs. This should not cause any compat issues as even if some of these MethodHandle were constructed successfully, their invocation leads to runtime crashes. Bug: 297147201 Test: ./art/test/testrunner/testrunner.py --host --64 --jvm -b Change-Id: I551b04e3c00ffc8bcdeac4760d9ac4b3bb7b2aff
Diffstat (limited to 'test/2280-const-method-handle-validation/build.py')
-rw-r--r--test/2280-const-method-handle-validation/build.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/2280-const-method-handle-validation/build.py b/test/2280-const-method-handle-validation/build.py
new file mode 100644
index 0000000000..ae1a042d40
--- /dev/null
+++ b/test/2280-const-method-handle-validation/build.py
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2024 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.
+
+
+def build(ctx):
+ ctx.bash("./generate-sources")
+ # Setting javac_source and javac_target for private interface methods.
+ ctx.default_build(api_level="const-method-type",
+ javac_source_arg="17",
+ javac_target_arg="17")