Don't inline into constructors when producing class files

This can lead to verification errors when the inlined code has control flow jumping over the super constructor call

Bug: 136250031
Change-Id: I67493805967237aa95a614d510f0f88df57b3bff
diff --git a/src/test/examples/inlining/CheckDiscardedConstructor.java b/src/test/examples/inlining/CheckDiscardedConstructor.java
new file mode 100644
index 0000000..d7be28c
--- /dev/null
+++ b/src/test/examples/inlining/CheckDiscardedConstructor.java
@@ -0,0 +1,8 @@
+// Copyright (c) 2019, 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 @interface CheckDiscardedConstructor {
+
+}
diff --git a/src/test/examples/inlining/InlineConstructorFinalField.java b/src/test/examples/inlining/InlineConstructorFinalField.java
index 093a2ac..a23c3dc 100644
--- a/src/test/examples/inlining/InlineConstructorFinalField.java
+++ b/src/test/examples/inlining/InlineConstructorFinalField.java
@@ -7,7 +7,7 @@
 
   public final int number;
 
-  @CheckDiscarded
+  @CheckDiscardedConstructor
   InlineConstructorFinalField(int value) {
     number = value;
   }
diff --git a/src/test/examples/inlining/InlineConstructorOfInner.java b/src/test/examples/inlining/InlineConstructorOfInner.java
index cec7d3f..6bc8abb 100644
--- a/src/test/examples/inlining/InlineConstructorOfInner.java
+++ b/src/test/examples/inlining/InlineConstructorOfInner.java
@@ -9,7 +9,7 @@
 
     int a;
 
-    @CheckDiscarded
+    @CheckDiscardedConstructor
     Inner(int a) {
       this.a = a;
     }
diff --git a/src/test/examples/inlining/keep-rules-discard-constructor.txt b/src/test/examples/inlining/keep-rules-discard-constructor.txt
new file mode 100644
index 0000000..fab5f5d
--- /dev/null
+++ b/src/test/examples/inlining/keep-rules-discard-constructor.txt
@@ -0,0 +1,8 @@
+# Copyright (c) 2019, 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.
+
+# Check that constructors have been inlined
+-checkdiscard class * {
+  @inlining.CheckDiscardedConstructor *;
+}