From fdb7d638c17dab47984e1d325d04796bb426d9b3 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 8 Feb 2017 15:07:18 +0000 Subject: Inline methods that throw. Forked from https://android-review.googlesource.com/214292 test: 637-checker-throw-inline bug: 30933338 Change-Id: I184be82dfab0710af3f3796e9e486c7817fa9c60 --- test/609-checker-inline-interface/src/Main.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'test/609-checker-inline-interface/src/Main.java') diff --git a/test/609-checker-inline-interface/src/Main.java b/test/609-checker-inline-interface/src/Main.java index 413f2dd51d..249b7781f0 100644 --- a/test/609-checker-inline-interface/src/Main.java +++ b/test/609-checker-inline-interface/src/Main.java @@ -21,12 +21,21 @@ public final class Main implements Interface { } public void doCall() { - if (doThrow) throw new Error(""); + // We do not inline methods that always throw. + throw new Error(""); } public static void main(String[] args) { - testInlineInterfaceCall(); - testInterfaceToVirtualCall(); + try { + testInlineInterfaceCall(); + } catch (Error e) { + // Expected + } + try { + testInterfaceToVirtualCall(); + } catch (Error e) { + // Expected. + } } /// CHECK-START: void Main.testInlineInterfaceCall() inliner (before) @@ -62,7 +71,6 @@ public final class Main implements Interface { static Interface itf = new Main(); static Main m = new Main(); - static boolean doThrow = false; } interface Interface { -- cgit v1.2.3-59-g8ed1b