compiler-design-eth/javali_tests/HW4_nop90/method invocation/OkMethod2.javali

36 lines
527 B
Text
Raw Normal View History

2020-01-15 22:34:57 +01:00
// call a method with many parameters and use its return value
// also Test Register use, by allocating memory
class Main {
void main() {
int a,b,c,d,e,f,g,h,x;
a = 5;
b = 5;
c = 5;
d = 5;
e = 5;
f = 5;
g = 5;
h = 5;
x = aux(a,b,c,d,e,f,g,h);
}
int aux(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8){
int[] x;
int i;
D d;
x = new int[20];
i = arg1 + arg2 + arg3 + arg4 - arg5 - arg6 + arg7 - arg8;
d = new D();
return i;
}
}
class D{
int[] x;
}