source: trunk/gcc/libjava/testsuite/libjava.jni/calls.java

Last change on this file was 1392, checked in by bird, 21 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 958 bytes
Line 
1// Test a bunch of different calls.
2
3class base
4{
5 public int int_f ()
6 {
7 return 27;
8 }
9}
10
11public 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}
Note: See TracBrowser for help on using the repository browser.