Extend inlining to allow invokes.
Also extend the oracle to hand package private and protected access modifiers
correctly.
Bug:
Change-Id: I1b592660842d4d81dd508e69f7c5641860f11633
diff --git a/src/test/examples/inlining/InlineConstructorFinalField.java b/src/test/examples/inlining/InlineConstructorFinalField.java
new file mode 100644
index 0000000..093a2ac
--- /dev/null
+++ b/src/test/examples/inlining/InlineConstructorFinalField.java
@@ -0,0 +1,23 @@
+// Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+package inlining;
+
+public class InlineConstructorFinalField {
+
+ public final int number;
+
+ @CheckDiscarded
+ InlineConstructorFinalField(int value) {
+ number = value;
+ }
+
+ // This will not be inlined, as it sets a final field.
+ InlineConstructorFinalField() {
+ this(42);
+ }
+
+ public String toString() {
+ return "value: " + number;
+ }
+}