Merge "OldSystemTest: Add test for System.load for non absolute paths."
diff --git a/luni/src/test/java/libcore/java/lang/OldSystemTest.java b/luni/src/test/java/libcore/java/lang/OldSystemTest.java
index 6c12250..bffe852 100644
--- a/luni/src/test/java/libcore/java/lang/OldSystemTest.java
+++ b/luni/src/test/java/libcore/java/lang/OldSystemTest.java
@@ -330,6 +330,16 @@
         String libPath = (String) m.invoke(cl, "c");
         assertNotNull(libPath);
         System.load(new File(libPath).getAbsolutePath());
+
+        // A negative test for a library that exists but isn't specified as an absolute path.
+        // In other words, a name for which System.loadLibrary(libname) would suceed and
+        // System.load(libname) would fail.
+        String libName = new File(libPath).getName();
+        try {
+            System.load(libName);
+            fail();
+        } catch (UnsatisfiedLinkError expected) {
+        }
     }
 
     public void test_loadLibrary() {