Add regression test for NPE into isClassNameConstant
Bug: 64881691
Change-Id: Ibfe633cd891a7b3024d266c277ce6d2736732e9b
diff --git a/src/test/examples/regress_64881691/Regress.java b/src/test/examples/regress_64881691/Regress.java
new file mode 100644
index 0000000..f99a394
--- /dev/null
+++ b/src/test/examples/regress_64881691/Regress.java
@@ -0,0 +1,20 @@
+// 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 regress_64881691;
+
+class A {
+}
+
+class B {
+}
+
+public class Regress {
+
+ private static Object o = null;
+ private static final String NAME = (o != null ? A.class : B.class).getSimpleName();
+
+ public static void main(String[] args) throws NoSuchMethodException {
+ System.out.println(NAME);
+ }
+}
diff --git a/src/test/java/com/android/tools/r8/R8RunExamplesTest.java b/src/test/java/com/android/tools/r8/R8RunExamplesTest.java
index 5e265aa..febff20 100644
--- a/src/test/java/com/android/tools/r8/R8RunExamplesTest.java
+++ b/src/test/java/com/android/tools/r8/R8RunExamplesTest.java
@@ -103,6 +103,7 @@
"regress_37875803.Regress",
"regress_37955340.Regress",
"regress_62300145.Regress",
+ "regress_64881691.Regress",
"memberrebinding2.Memberrebinding",
"memberrebinding3.Memberrebinding",
"minification.Minification",