diff options
author | 2017-02-08 15:07:18 +0000 | |
---|---|---|
committer | 2017-02-15 10:25:54 +0000 | |
commit | fdb7d638c17dab47984e1d325d04796bb426d9b3 (patch) | |
tree | a352c1d8e52e18551c16bfea5bb9c564695b5239 /test/609-checker-inline-interface/src/Main.java | |
parent | 8dc12b1546c7409be19a7b5dc48932011db13067 (diff) |
Inline methods that throw.
Forked from https://android-review.googlesource.com/214292
test: 637-checker-throw-inline
bug: 30933338
Change-Id: I184be82dfab0710af3f3796e9e486c7817fa9c60
Diffstat (limited to 'test/609-checker-inline-interface/src/Main.java')
-rw-r--r-- | test/609-checker-inline-interface/src/Main.java | 16 |
1 files changed, 12 insertions, 4 deletions
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 { |