blob: 8bb03d39879dcccad1e5a4e2cb5df915de45ee17 [file] [log] [blame]
buzbee109bd6a2011-09-06 13:58:41 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17class Invoke {
18
19 int virI_I(int a) {
20 return a + 123;
21 }
22
23 int virI_II(int a, int b) {
24 return a + b + 321;
25 }
26
27 int virI_III(int a, int b, int c) {
28 return a + b + c + 432;
29 }
30
31 int virI_IIII(int a, int b, int c, int d) {
32 return a + b + c + d + 919;
33 }
34
35 int virI_IIIII(int a, int b, int c, int d, int e) {
36 return a + b + c + d + e + 1010;
37 }
38
39 int virI_IIIIII(int a, int b, int c, int d, int e, int f) {
40 return a + b + c + d + e + f + 2020;
41 }
42
43 static int statI_I(int a) {
44 return a + 123;
45 }
46
47 static int statI_II(int a, int b) {
48 return a + b + 321;
49 }
50
51 static int statI_III(int a, int b, int c) {
52 return a + b + c + 432;
53 }
54
55 static int statI_IIII(int a, int b, int c, int d) {
56 return a + b + c + d + 919;
57 }
58
59 static int statI_IIIII(int a, int b, int c, int d, int e) {
60 return a + b + c + d + e + 1010;
61 }
62
63 static int statI_IIIIII(int a, int b, int c, int d, int e, int f) {
64 return a + b + c + d + e + f + 2020;
65 }
66
67 static int test0(int a) {
68 Invoke foo = new Invoke();
69
70 return foo.virI_I(a) +
71 foo.virI_II(a, 1) +
72 foo.virI_III(a, 1, 2) +
73 foo.virI_IIII(a, 1, 2, 3) +
74 foo.virI_IIIII(a, 1, 2, 3, 4) +
75 foo.virI_IIIIII(a, 1, 2, 3, 4, 5) +
76 statI_I(a) +
77 statI_II(a, 1) +
78 statI_III(a, 1, 2) +
79 statI_IIII(a, 1, 2, 3) +
80 statI_IIIII(a, 1, 2, 3, 4) +
81 statI_IIIIII(a, 1, 2, 3, 4, 5);
82 }
83
84 public static void main(String[] args) {
85 int res = test0(912);
86 if (res == 20664) {
87 System.out.println("test0 PASSED");
88 } else {
89 System.out.println("test0 FAILED: " + res);
90 }
91 }
92}