invokevirtual: native methods
authorBernhard Urban <lewurm@gmail.com>
Wed, 25 Apr 2012 19:24:29 +0000 (21:24 +0200)
committerBernhard Urban <lewurm@gmail.com>
Wed, 25 Apr 2012 21:53:09 +0000 (23:53 +0200)
ffi/native.c
tests/Instance5.java [new file with mode: 0644]

index d743d57ef65e0e67a343b23350f8a8c585f024bb..f335c5cf0d81cb87c8f7398ff3f0cc1308b611a7 100644 (file)
@@ -9,3 +9,8 @@ void tests_Native1__printSomething___I_V(int a)
 {
        printf("printSomething: 0x%08x\n", a);
 }
+
+void tests_Instance5__printX___I_V(int a)
+{
+       printf("printX: 0x%08x\n", a);
+}
diff --git a/tests/Instance5.java b/tests/Instance5.java
new file mode 100644 (file)
index 0000000..8c8ff84
--- /dev/null
@@ -0,0 +1,21 @@
+package tests;
+
+public class Instance5 {
+       public int x;
+       public Instance5() {
+               x = 0x11;
+       }
+
+       public static void main(String []args) {
+               Instance5 a = new Instance5();
+
+               a.setX(0x1337);
+               a.printX(a.x);
+       }
+
+       public void setX(int a) {
+               this.x = a;
+       }
+
+       public native void printX(int x);
+}