summaryrefslogtreecommitdiff
path: root/test/1956-pop-frame-jit-calling
diff options
context:
space:
mode:
Diffstat (limited to 'test/1956-pop-frame-jit-calling')
-rwxr-xr-xtest/1956-pop-frame-jit-calling/check27
-rw-r--r--test/1956-pop-frame-jit-calling/expected-stdout.jvm.txt87
-rw-r--r--test/1956-pop-frame-jit-calling/jvm-expected.patch36
-rwxr-xr-xtest/1956-pop-frame-jit-calling/run26
-rw-r--r--test/1956-pop-frame-jit-calling/run.py36
5 files changed, 123 insertions, 89 deletions
diff --git a/test/1956-pop-frame-jit-calling/check b/test/1956-pop-frame-jit-calling/check
deleted file mode 100755
index e25838a3b2..0000000000
--- a/test/1956-pop-frame-jit-calling/check
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2018 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.
-
-# Inputs:
-# $1: Test's expected standard output
-# $2: Test's actual standard output
-# $3: Test's expected standard error
-# $4: Test's actual standard error
-
-# The RI has restrictions and bugs around some PopFrame behavior that ART lacks.
-# See b/116003018. Some configurations cannot handle the class load events in
-# quite the right way so they are disabled there too.
-./default-check "$@" || \
- (patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null && ./default-check "$@")
diff --git a/test/1956-pop-frame-jit-calling/expected-stdout.jvm.txt b/test/1956-pop-frame-jit-calling/expected-stdout.jvm.txt
new file mode 100644
index 0000000000..dafc6b4c92
--- /dev/null
+++ b/test/1956-pop-frame-jit-calling/expected-stdout.jvm.txt
@@ -0,0 +1,87 @@
+Test stopped using breakpoint
+Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+result is StandardTestObject { cnt: 2 } base-call count: 1
+Test stopped using breakpoint with declared synchronized function
+Single call with PopFrame on SynchronizedFunctionTestObject { cnt: 0 } base-call-count: 0
+result is SynchronizedFunctionTestObject { cnt: 2 } base-call count: 1
+Test stopped using breakpoint with synchronized block
+Single call with PopFrame on SynchronizedTestObject { cnt: 0 } base-call-count: 0
+result is SynchronizedTestObject { cnt: 2 } base-call count: 1
+Test stopped on single step
+Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+result is StandardTestObject { cnt: 2 } base-call count: 1
+Test stopped on field access
+Single call with PopFrame on FieldBasedTestObject { cnt: 0, TARGET_FIELD: 0 } base-call-count: 0
+result is FieldBasedTestObject { cnt: 2, TARGET_FIELD: 10 } base-call count: 1
+Test stopped on field modification
+Single call with PopFrame on FieldBasedTestObject { cnt: 0, TARGET_FIELD: 0 } base-call-count: 0
+result is FieldBasedTestObject { cnt: 2, TARGET_FIELD: 10 } base-call count: 1
+Test stopped during Method Exit of doNothing
+Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+result is StandardTestObject { cnt: 1 } base-call count: 1
+Test stopped during Method Enter of doNothing
+Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+result is StandardTestObject { cnt: 1 } base-call count: 1
+Test stopped during Method Exit of calledFunction
+Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+result is StandardTestObject { cnt: 2 } base-call count: 1
+Test stopped during Method Enter of calledFunction
+Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+result is StandardTestObject { cnt: 1 } base-call count: 1
+Test stopped during Method Exit due to exception thrown in same function
+Single call with PopFrame on ExceptionOnceObject { cnt: 0, throwInSub: false } base-call-count: 0
+result is ExceptionOnceObject { cnt: 2, throwInSub: false } base-call count: 1
+Test stopped during Method Exit due to exception thrown in subroutine
+Single call with PopFrame on ExceptionOnceObject { cnt: 0, throwInSub: true } base-call-count: 0
+result is ExceptionOnceObject { cnt: 2, throwInSub: true } base-call count: 1
+Test stopped during ExceptionCatch event of calledFunction (catch in called function, throw in called function)
+Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0
+art.Test1953$ExceptionThrowTestObject$TestError caught in same function.
+result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1
+Test stopped during ExceptionCatch event of calledFunction (catch in called function, throw in subroutine)
+Single call with PopFrame on ExceptionCatchTestObject { cnt: 0 } base-call-count: 0
+art.Test1953$ExceptionCatchTestObject$TestError caught in called function.
+result is ExceptionCatchTestObject { cnt: 2 } base-call count: 1
+Test stopped during Exception event of calledFunction (catch in calling function)
+Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0
+art.Test1953$ExceptionThrowTestObject$TestError thrown and caught!
+result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1
+Test stopped during Exception event of calledFunction (catch in called function)
+Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0
+art.Test1953$ExceptionThrowTestObject$TestError caught in same function.
+result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1
+Test stopped during Exception event of calledFunction (catch in parent of calling function)
+Single call with PopFrame on ExceptionThrowFarTestObject { cnt: 0 } base-call-count: 0
+art.Test1953$ExceptionThrowFarTestObject$TestError thrown and caught!
+result is ExceptionThrowFarTestObject { cnt: 2 } base-call count: 1
+Test stopped during Exception event of calledFunction (catch in called function)
+Single call with PopFrame on ExceptionThrowFarTestObject { cnt: 0 } base-call-count: 0
+art.Test1953$ExceptionThrowFarTestObject$TestError caught in same function.
+result is ExceptionThrowFarTestObject { cnt: 2 } base-call count: 1
+Test stopped during random Suspend.
+Single call with PopFrame on SuspendSuddenlyObject { cnt: 0 } base-call-count: 0
+result is SuspendSuddenlyObject { cnt: 2 } base-call count: 1
+Test redefining frame being popped.
+Single call with PopFrame on RedefineTestObject { states: [] current: ORIGINAL } base-call-count: 0
+result is RedefineTestObject { states: [ORIGINAL, REDEFINED] current: REDEFINED } base-call count: 1
+Test stopped during a native method fails
+Single call with PopFrame on NativeCalledObject { cnt: 0 } base-call-count: 0
+Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+ art.Test1953.popFrame(Native Method)
+ art.Test1953.runTestOn(Test1953.java)
+ art.Test1953.runTestOn(Test1953.java)
+ art.Test1953.runTests(Test1953.java)
+ <Additional frames hidden>
+result is NativeCalledObject { cnt: 1 } base-call count: 1
+Test stopped in a method called by native fails
+Single call with PopFrame on NativeCallerObject { cnt: 0 } base-call-count: 0
+Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
+ art.Test1953.popFrame(Native Method)
+ art.Test1953.runTestOn(Test1953.java)
+ art.Test1953.runTestOn(Test1953.java)
+ art.Test1953.runTests(Test1953.java)
+ <Additional frames hidden>
+result is NativeCallerObject { cnt: 1 } base-call count: 1
+Test stopped with monitor in enclosing frame.
+Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
+result is StandardTestObject { cnt: 2 } base-call count: 1
diff --git a/test/1956-pop-frame-jit-calling/jvm-expected.patch b/test/1956-pop-frame-jit-calling/jvm-expected.patch
deleted file mode 100644
index 6539d56b27..0000000000
--- a/test/1956-pop-frame-jit-calling/jvm-expected.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-37,50d36
-< Test stopped during notifyFramePop without exception on pop of calledFunction
-< Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
-< result is StandardTestObject { cnt: 2 } base-call count: 1
-< Test stopped during notifyFramePop without exception on pop of doNothing
-< Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0
-< result is StandardTestObject { cnt: 1 } base-call count: 1
-< Test stopped during notifyFramePop with exception on pop of calledFunction
-< Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0
-< art.Test1953$ExceptionThrowTestObject$TestError thrown and caught!
-< result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1
-< Test stopped during notifyFramePop with exception on pop of doThrow
-< Single call with PopFrame on ExceptionCatchTestObject { cnt: 0 } base-call-count: 0
-< art.Test1953$ExceptionCatchTestObject$TestError caught in called function.
-< result is ExceptionCatchTestObject { cnt: 1 } base-call count: 1
-75,94d60
-< Test stopped during a ClassLoad event.
-< Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 0} base-call-count: 0
-< Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
-< art.Test1953.popFrame(Native Method)
-< art.Test1953.runTestOn(Test1953.java)
-< art.Test1953.runTestOn(Test1953.java)
-< art.Test1953.runTests(Test1953.java)
-< <Additional frames hidden>
-< TC0.foo == 1
-< result is ClassLoadObject { cnt: 1, curClass: 1} base-call count: 1
-< Test stopped during a ClassPrepare event.
-< Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 1} base-call-count: 0
-< Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME
-< art.Test1953.popFrame(Native Method)
-< art.Test1953.runTestOn(Test1953.java)
-< art.Test1953.runTestOn(Test1953.java)
-< art.Test1953.runTests(Test1953.java)
-< <Additional frames hidden>
-< TC1.foo == 2
-< result is ClassLoadObject { cnt: 1, curClass: 2} base-call count: 1
diff --git a/test/1956-pop-frame-jit-calling/run b/test/1956-pop-frame-jit-calling/run
deleted file mode 100755
index 2984461057..0000000000
--- a/test/1956-pop-frame-jit-calling/run
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2017 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.
-
-# On RI we need to turn class-load tests off since those events are buggy around
-# pop-frame (see b/116003018).
-ARGS=""
-if [[ "$TEST_RUNTIME" == "jvm" ]]; then
- ARGS="--args DISABLE_CLASS_LOAD_TESTS"
-fi
-
-# The jitthreshold prevents the jit from compiling anything except those which
-# we explicitly request.
-./default-run "$@" --android-runtime-option -Xjitthreshold:1000 --jvmti $ARGS
diff --git a/test/1956-pop-frame-jit-calling/run.py b/test/1956-pop-frame-jit-calling/run.py
new file mode 100644
index 0000000000..44fe18e0ef
--- /dev/null
+++ b/test/1956-pop-frame-jit-calling/run.py
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Copyright 2017 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 run(ctx, args):
+ # On RI we need to turn class-load tests off since those events are buggy around
+ # pop-frame (see b/116003018).
+ test_args = ["DISABLE_CLASS_LOAD_TESTS"] if args.jvm else []
+
+ # The jitthreshold prevents the jit from compiling anything except those which
+ # we explicitly request.
+ ctx.default_run(
+ args,
+ android_runtime_option=["-Xjitthreshold:1000"],
+ jvmti=True,
+ test_args=test_args)
+
+ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks.
+ # See b/116003018. Some configurations cannot handle the class load events in
+ # quite the right way so they are disabled there too.
+ if (args.jvm or not args.prebuild or
+ (args.jvmti_redefine_stress and args.host)):
+ ctx.expected_stdout = ctx.expected_stdout.with_suffix(".jvm.txt")