2007-02-13 Andrew Haley <aph@redhat.com>
[gcc.git] / libjava / testsuite / libjava.jni / calls.java
1 // Test a bunch of different calls.
2
3 class base
4 {
5 public int int_f ()
6 {
7 return 27;
8 }
9 }
10
11 public class calls extends base
12 {
13 static
14 {
15 System.loadLibrary ("calls");
16 }
17
18 public native int docall ();
19
20 public byte byte_f ()
21 {
22 return 23;
23 }
24
25 public char char_f (int z)
26 {
27 return (char) ('a' + z);
28 }
29
30 public int int_f ()
31 {
32 return 1023;
33 }
34
35 public static long long_f (long q)
36 {
37 return q + 2023;
38 }
39
40 public static long longpb_f (byte b1, long q1, byte b2, long q2,
41 byte b3, long q3)
42 {
43 return q1 + q2 + q3 + 3023;
44 }
45
46 public void void_f ()
47 {
48 System.out.println ("void");
49 }
50
51 public static short short_f ()
52 {
53 return 2;
54 }
55
56 public double double_f ()
57 {
58 return -1.0;
59 }
60
61 public float float_f ()
62 {
63 return (float) 1.0;
64 }
65
66 public static void main (String[] args)
67 {
68 calls c = new calls ();
69 if (c.docall () != 0)
70 System.out.println ("fail");
71 }
72 }