public static int test_5_pass_small_struct() { Small v = get_small(1); if (receive_small(7, v, 9) != 0) { return(0); } if (receive_small(7, get_small(1), 9) != 0) { return(1); } if (receive_small_sparc_many_args(1, 2, 3, 4, 5, 6, v, 9) != 0) { return(2); } v = return_small(v); if (v.b1 != 1) { return(3); } if (v.b2 != 2) { return(4); } return(5); }
// Test alignment of small structs static Small get_small(byte v) { Small r = new Small(); r.b1 = v; r.b2 = (byte)(v + 1); return(r); }
static int receive_small(int a, Small v, int b) { if (v.b1 != 1) { return(1); } if (v.b2 != 2) { return(2); } return(0); }
static int receive_small_sparc_many_args(int a, int a2, int a3, int a4, int a5, int a6, Small v, int b) { if (v.b1 != 1) { return(1); } if (v.b2 != 2) { return(2); } return(0); }
static Small return_small(Small s) { return(s); }