1# Copyright (C) 2018 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15.class public LTestCase; 16 17.super Ljava/lang/Object; 18 19# 20# Ensure foo() does not analyze unverified bad() always-throws property. 21# 22## CHECK-START: void TestCase.foo(java.lang.Object) inliner (after) 23## CHECK-DAG: InvokeStaticOrDirect method_name:TestCase.bar always_throws:true 24## CHECK-DAG: InvokeStaticOrDirect method_name:TestCase.bad always_throws:false 25.method public static foo(Ljava/lang/Object;)V 26 .registers 1 27 if-nez v0, :Skip1 28 invoke-static {}, LTestCase;->bar()V 29:Skip1 30 if-nez v0, :Skip2 31 invoke-static {}, LTestCase;->bad()Lwont/be/Resolvable; 32:Skip2 33 return-void 34.end method 35 36# 37# Method bar() that verifies (but is never called). 38# 39.method public static bar()V 40 .registers 1 41 new-instance v0, Ljava/lang/RuntimeException; 42 invoke-direct {v0}, Ljava/lang/RuntimeException;-><init>()V 43 throw v0 44.end method 45 46# 47# Method bad() that fails to verify (but is never called). 48# 49.method public static bad()Lwont/be/Resolvable; 50 .registers 1 51 invoke-static {}, LTestCase;->bar()Lwont/be/Resolvable; 52 move-result-object v0 53 throw v0 54.end method 55 56