OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [stub.java] - Blame information for rev 781

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
// Class stub
2
// Generated on Fri Feb  4 20:23:47 PST 2000
3
// A somewhat thorough test of function invocator generated stubs.
4
 
5
class stub {
6
 
7
    String ok;
8
 
9
    void OK () {System.out.println (ok);}
10
    void OK (int i) {System.out.println (ok+" "+i);}
11
    static void testOK () {System.out.println ("OK");}
12
    static void testOK (int i) {System.out.println ("OK "+i); }
13
 
14
    // STATIC   PRIVATE         R_VALUE         ARGS
15
    // No       No              No              No
16
                                void    t1      () {OK();}
17
    // Yes      No              No              No
18
       static                   void    t2      () {testOK();}
19
    // No       Yes             No              No
20
                private         void    t3      () {OK();}
21
    // Yes      Yes             No              No
22
       static   private         void    t4      () {testOK();}
23
    // No       No              Yes             No
24
                                int     t5      () {return 5;}
25
    // Yes      No              Yes             No
26
       static                   int     t6      () {return 6;}
27
    // No       Yes             Yes             No
28
                private         int     t7      () {return 7;}
29
    // Yes      Yes             Yes             No
30
       static   private         int     t8      () {return 8;}
31
 
32
    // No       No              No              Yes
33
                                void    t9      (int i) {OK(i);}
34
    // Yes      No              No              Yes
35
       static                   void    t10     (int i) {testOK(i);}
36
    // No       Yes             No              Yes
37
                private         void    t11     (int i) {OK(i);}
38
    // Yes      Yes             No              Yes
39
       static   private         void    t12     (int i) {testOK(i);}
40
    // No       No              Yes             Yes
41
                                int     t13     (int i) {return i*2;}
42
    // Yes      No              Yes             Yes
43
       static                   int     t14     (int i) {return i*3;}
44
    // No       Yes             Yes             Yes
45
                private         int     t15     (int i) {return i*4;}
46
    // Yes      Yes             Yes             Yes
47
       static   private         int     t16     (int i) {return i*5;}
48
 
49
    void foo ()
50
    {
51
        this.new bar ().test ();
52
    }
53
    class bar {
54
        void test () {
55
            ok = "OK";
56
            t1 ();
57
            t2 ();
58
            t3 ();
59
            t4 ();
60
            System.out.println (t5());
61
            System.out.println (t6());
62
            System.out.println (t7());
63
            System.out.println (t8());
64
            t9 (9);
65
            t10 (10);
66
            t11 (11);
67
            t12 (12);
68
            System.out.println (t13(13));
69
            System.out.println (t14(14));
70
            System.out.println (t15(15));
71
            System.out.println (t16(16));
72
            this.new baz ().test ();
73
        }
74
        class baz {
75
            void test () {
76
                ok = "OKOK";
77
                t1 ();
78
                t2 ();
79
                t3 ();
80
                t4 ();
81
                System.out.println (t5());
82
                System.out.println (t6());
83
                System.out.println (t7());
84
                System.out.println (t8());
85
                t9 (9);
86
                t10 (10);
87
                t11 (11);
88
                t12 (12);
89
                System.out.println (t13(13));
90
                System.out.println (t14(14));
91
                System.out.println (t15(15));
92
                System.out.println (t16(16));
93
            }
94
        }
95
    }
96
    public static void main (String[] arg)
97
    {
98
        System.out.println ("Testing class `stub'...");
99
        new stub ().foo ();
100
    }
101
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.