@printf "should be: 0x%08x\n" 0x1337
./$< tests/CallConv2 | grep mainresult
@printf "should be: 0x%08x\n" 0x1337
+ ./$< tests/CallConv3 | grep mainresult
+ @printf "should be: 0x%08x 0x%08x 0x%08x 0x%08x\n" 0x1000 0x300 0x30 0x7
./$< tests/Instance1 | grep mainresult
@printf "should be: 0x%08x 0x%08x\n" 0x55 0x11
./$< tests/Instance2 | grep mainresult
cArgs x = if (x' >= thisMethodArgCnt)
-- TODO(bernhard): maybe s/(-4)/(-8)/
then fromIntegral $ (-4) * (x' - thisMethodArgCnt + 1)
- else 8 + (4 * x')
+ else 4 + (thisMethodArgCnt * 4) - (4 * x')
where x' = fromIntegral x
cArgs_ :: IMM -> Word32
--- /dev/null
+package tests;
+
+public class CallConv3 {
+ public static void main(String []args) {
+ manyVars_A(0x1000, 0x300, 0x30, 0x7);
+ manyVars_B(0x1000, 0x300, 0x30, 0x7);
+ manyVars_C(0x1000, 0x300, 0x30, 0x7);
+ manyVars_D(0x1000, 0x300, 0x30, 0x7);
+ }
+
+ public static int manyVars_A(int a, int b, int c, int d) {
+ return a;
+ }
+ public static int manyVars_B(int a, int b, int c, int d) {
+ return b;
+ }
+ public static int manyVars_C(int a, int b, int c, int d) {
+ return c;
+ }
+ public static int manyVars_D(int a, int b, int c, int d) {
+ return d;
+ }
+}