Fix 496 test.
Make sure the class requested by LoadedByMyClassLoader.bar
is not loaded yet ('Main' is already loaded), in order to
do a proper class loader lookup and not use a dex cache
version.
Change-Id: I77215ae489e6d2c50b90684951bccd0bbf8c1a53
diff --git a/test/496-checker-inlining-and-class-loader/expected.txt b/test/496-checker-inlining-and-class-loader/expected.txt
index c6fcb51..312c28f 100644
--- a/test/496-checker-inlining-and-class-loader/expected.txt
+++ b/test/496-checker-inlining-and-class-loader/expected.txt
@@ -1,4 +1,4 @@
Request for LoadedByMyClassLoader
-Request for Main
+Request for FirstSeenByMyClassLoader
In between the two calls.
In $noinline$bar
diff --git a/test/496-checker-inlining-and-class-loader/src/FirstSeenByMyClassLoader.java b/test/496-checker-inlining-and-class-loader/src/FirstSeenByMyClassLoader.java
new file mode 100644
index 0000000..e97b4e3
--- /dev/null
+++ b/test/496-checker-inlining-and-class-loader/src/FirstSeenByMyClassLoader.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class FirstSeenByMyClassLoader {
+ public static void $inline$bar() {
+ }
+
+ public static void $noinline$bar() {
+ try {
+ System.out.println("In $noinline$bar");
+ } catch (Throwable t) { /* Ignore */ }
+ }
+}
diff --git a/test/496-checker-inlining-and-class-loader/src/Main.java b/test/496-checker-inlining-and-class-loader/src/Main.java
index 4f23eec..39c031a 100644
--- a/test/496-checker-inlining-and-class-loader/src/Main.java
+++ b/test/496-checker-inlining-and-class-loader/src/Main.java
@@ -82,7 +82,7 @@
/// CHECK-START: void LoadedByMyClassLoader.bar() inliner (after)
/// CHECK: LoadClass
/// CHECK-NEXT: ClinitCheck
- /* We inlined Main.$inline$bar */
+ /* We inlined FirstSeenByMyClassLoader.$inline$bar */
/// CHECK-NEXT: LoadClass
/// CHECK-NEXT: ClinitCheck
/// CHECK-NEXT: StaticFieldGet
@@ -91,7 +91,7 @@
/// CHECK-NEXT: InvokeVirtual
/// CHECK-START: void LoadedByMyClassLoader.bar() register (before)
- /* Load and initialize Main */
+ /* Load and initialize FirstSeenByMyClassLoader */
/// CHECK: LoadClass gen_clinit_check:true
/* Load and initialize System */
/// CHECK-NEXT: LoadClass gen_clinit_check:true
@@ -100,9 +100,9 @@
/// CHECK-NEXT: NullCheck
/// CHECK-NEXT: InvokeVirtual
public static void bar() {
- Main.$inline$bar();
+ FirstSeenByMyClassLoader.$inline$bar();
System.out.println("In between the two calls.");
- Main.$noinline$bar();
+ FirstSeenByMyClassLoader.$noinline$bar();
}
}
@@ -113,13 +113,4 @@
Method m = foo.getDeclaredMethod("bar");
m.invoke(null);
}
-
- public static void $inline$bar() {
- }
-
- public static void $noinline$bar() {
- try {
- System.out.println("In $noinline$bar");
- } catch (Throwable t) { /* Ignore */ }
- }
}