diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/800-smali/expected.txt | 1 | ||||
-rw-r--r-- | test/800-smali/smali/b_21645819.smali | 9 | ||||
-rw-r--r-- | test/800-smali/src/Main.java | 2 | ||||
-rw-r--r-- | test/800-smali/src/pkg/ProtectedClass.java | 20 | ||||
-rw-r--r-- | test/Android.run-test.mk | 15 | ||||
-rwxr-xr-x | test/run-test | 19 |
6 files changed, 62 insertions, 4 deletions
diff --git a/test/800-smali/expected.txt b/test/800-smali/expected.txt index 80b4f57..2196a88 100644 --- a/test/800-smali/expected.txt +++ b/test/800-smali/expected.txt @@ -22,4 +22,5 @@ b/21902684 b/21863767 b/21886894 b/22080519 +b/21645819 Done! diff --git a/test/800-smali/smali/b_21645819.smali b/test/800-smali/smali/b_21645819.smali new file mode 100644 index 0000000..195d662 --- /dev/null +++ b/test/800-smali/smali/b_21645819.smali @@ -0,0 +1,9 @@ +.class public LB21645819; +.super Ljava/lang/Object; + +# The method declares a parameter of an inaccessible class. This should not abort/kill us. + +.method public static run(Lpkg/ProtectedClass;)V +.registers 10 + return-void +.end method
\ No newline at end of file diff --git a/test/800-smali/src/Main.java b/test/800-smali/src/Main.java index 337d0d9..e6f065e 100644 --- a/test/800-smali/src/Main.java +++ b/test/800-smali/src/Main.java @@ -91,6 +91,8 @@ public class Main { null)); testCases.add(new TestCase("b/22080519", "B22080519", "run", null, new NullPointerException(), null)); + testCases.add(new TestCase("b/21645819", "B21645819", "run", new Object[] { null }, + null, null)); } public void runTests() { diff --git a/test/800-smali/src/pkg/ProtectedClass.java b/test/800-smali/src/pkg/ProtectedClass.java new file mode 100644 index 0000000..b262155 --- /dev/null +++ b/test/800-smali/src/pkg/ProtectedClass.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2014 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 pkg; + +class ProtectedClass { +} diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk index c19133c..89ed4c5 100644 --- a/test/Android.run-test.mk +++ b/test/Android.run-test.mk @@ -101,6 +101,9 @@ TRACE_TYPES := ntrace ifeq ($(ART_TEST_TRACE),true) TRACE_TYPES += trace endif +ifeq ($(ART_TEST_TRACE_STREAM),true) + TRACE_TYPES += stream +endif GC_TYPES := cms ifeq ($(ART_TEST_GC_STRESS),true) GC_TYPES += gcstress @@ -310,9 +313,9 @@ TEST_ART_BROKEN_TRACING_RUN_TESTS := \ 137-cfi \ 802-deoptimization -ifneq (,$(filter trace,$(TRACE_TYPES))) +ifneq (,$(filter trace stream,$(TRACE_TYPES))) ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \ - $(COMPILER_TYPES),$(RELOCATE_TYPES),trace,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \ + $(COMPILER_TYPES),$(RELOCATE_TYPES),trace stream,$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \ $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES)) endif @@ -692,7 +695,13 @@ define define-test-art-run-test ifeq ($(6),ntrace) test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_TRACE_RULES else - $$(error found $(6) expected $(TRACE_TYPES)) + ifeq ($(6),stream) + # Group streaming under normal tracing rules. + test_groups += ART_RUN_TEST_$$(uc_host_or_target)_TRACE_RULES + run_test_options += --trace --stream + else + $$(error found $(6) expected $(TRACE_TYPES)) + endif endif endif ifeq ($(7),gcverify) diff --git a/test/run-test b/test/run-test index dc60eda..3f17861 100755 --- a/test/run-test +++ b/test/run-test @@ -92,6 +92,7 @@ usage="no" build_only="no" suffix64="" trace="false" +trace_stream="false" basic_verify="false" gc_verify="false" gc_stress="false" @@ -267,6 +268,9 @@ while true; do elif [ "x$1" = "x--trace" ]; then trace="true" shift + elif [ "x$1" = "x--stream" ]; then + trace_stream="true" + shift elif [ "x$1" = "x--always-clean" ]; then always_clean="yes" shift @@ -303,7 +307,19 @@ if [ "$gc_stress" = "true" ]; then run_args="${run_args} --runtime-option -Xgc:SS --runtime-option -Xms2m --runtime-option -Xmx2m" fi if [ "$trace" = "true" ]; then - run_args="${run_args} --runtime-option -Xmethod-trace --runtime-option -Xmethod-trace-file:${DEX_LOCATION}/trace.bin --runtime-option -Xmethod-trace-file-size:2000000" + run_args="${run_args} --runtime-option -Xmethod-trace --runtime-option -Xmethod-trace-file-size:2000000" + if [ "$trace_stream" = "true" ]; then + # Streaming mode uses the file size as the buffer size. So output gets really large. Drop + # the ability to analyze the file and just write to /dev/null. + run_args="${run_args} --runtime-option -Xmethod-trace-file:/dev/null" + # Enable streaming mode. + run_args="${run_args} --runtime-option -Xmethod-trace-stream" + else + run_args="${run_args} --runtime-option -Xmethod-trace-file:${DEX_LOCATION}/trace.bin" + fi +elif [ "$trace_stream" = "true" ]; then + echo "Cannot use --stream without --trace." + exit 1 fi # Most interesting target architecture variables are Makefile variables, not environment variables. @@ -469,6 +485,7 @@ if [ "$usage" = "yes" ]; then "files." echo " --64 Run the test in 64-bit mode" echo " --trace Run with method tracing" + echo " --stream Run method tracing in streaming mode (requires --trace)" echo " --gcstress Run with gc stress testing" echo " --gcverify Run with gc verification" echo " --always-clean Delete the test files even if the test fails." |