return 5;
}
+ static Simple s_v;
+ static int test_5_pass_static_struct () {
+ s_v = get_simple (1);
+ if (receive_simple (7, s_v, 9) != 0)
+ return 0;
+ return 5;
+ }
+
// Test alignment of small structs
static Small get_small (byte v) {
return 5;
}
+ // 64-bits, 32-bit aligned
+ struct struct1 {
+ public int a;
+ public int b;
+ };
+
+ static int check_struct1(struct1 x) {
+ if (x.a != 1)
+ return 1;
+ if (x.b != 2)
+ return 2;
+ return 0;
+ }
+
+ static int pass_struct1(int a, int b, struct1 x) {
+ if (a != 3)
+ return 3;
+ if (b != 4)
+ return 4;
+ return check_struct1(x);
+ }
+
+ static int pass_struct1(int a, struct1 x) {
+ if (a != 3)
+ return 3;
+ return check_struct1(x);
+ }
+
+ static int pass_struct1(struct1 x) {
+ return check_struct1(x);
+ }
+
+ static int test_0_struct1_args () {
+ int r;
+ struct1 x;
+
+ x.a = 1;
+ x.b = 2;
+ if ((r = check_struct1(x)) != 0)
+ return r;
+ if ((r = pass_struct1(x)) != 0)
+ return r + 10;
+ if ((r = pass_struct1(3, x)) != 0)
+ return r + 20;
+ if ((r = pass_struct1(3, 4, x)) != 0)
+ return r + 30;
+ return 0;
+ }
+
+ // 64-bits, 64-bit aligned
+ struct struct2 {
+ public long a;
+ };
+
+ static int check_struct2(struct2 x) {
+ if (x.a != 1)
+ return 1;
+ return 0;
+ }
+
+ static int pass_struct2(int a, int b, int c, struct2 x) {
+ if (a != 3)
+ return 3;
+ if (b != 4)
+ return 4;
+ if (c != 5)
+ return 5;
+ return check_struct2(x);
+ }
+
+ static int pass_struct2(int a, int b, struct2 x) {
+ if (a != 3)
+ return 3;
+ if (b != 4)
+ return 4;
+ return check_struct2(x);
+ }
+
+ static int pass_struct2(int a, struct2 x) {
+ if (a != 3)
+ return 3;
+ return check_struct2(x);
+ }
+
+ static int pass_struct2(struct2 x) {
+ return check_struct2(x);
+ }
+
+ static int test_0_struct2_args () {
+ int r;
+ struct2 x;
+
+ x.a = 1;
+ if ((r = check_struct2(x)) != 0)
+ return r;
+ if ((r = pass_struct2(x)) != 0)
+ return r + 10;
+ if ((r = pass_struct2(3, x)) != 0)
+ return r + 20;
+ if ((r = pass_struct2(3, 4, x)) != 0)
+ return r + 30;
+ if ((r = pass_struct2(3, 4, 5, x)) != 0)
+ return r + 40;
+ return 0;
+ }
+
+ // 128 bits
+ struct Struct3 {
+ public long i, j, k, l;
+ }
+
+ static int pass_struct3 (int i, int j, int k, int l, int m, int n, int o, int p, Struct3 s, int q) {
+ if (s.i + s.j + s.k + s.l != 10)
+ return 1;
+ else
+ return 0;
+ }
+
+ static int test_0_struct3_args () {
+ Struct3 s = new Struct3 ();
+ s.i = 1;
+ s.j = 2;
+ s.k = 3;
+ s.l = 4;
+
+ return pass_struct3 (1, 2, 3, 4, 5, 6, 7, 8, s, 9);
+ }
+
struct AStruct {
public int i;
return 0;
}
+ class Foo2 {
+ public virtual int foo () {
+ return 0;
+ }
+ }
+
+ sealed class Bar2 : Foo2 {
+ public override int foo () {
+ return 0;
+ }
+ }
+
+ static int test_0_abcrem_check_this_removal () {
+ Bar2 b = new Bar2 ();
+
+ // The check_this generated here by the JIT should be removed
+ b.foo ();
+
+ return 0;
+ }
+
+ static int invoke_twice (Bar2 b) {
+ b.foo ();
+ // The check_this generated here by the JIT should be removed
+ b.foo ();
+
+ return 0;
+ }
+
+ static int test_0_abcrem_check_this_removal2 () {
+ Bar2 b = new Bar2 ();
+
+ invoke_twice (b);
+
+ return 0;
+ }
+
/* #346563 */
static int test_0_array_access_64_bit () {
int[] arr2 = new int [10];
return 2;
return 0;
}
+
+ class R4Holder {
+ public static float pi = 3.14f;
+
+ public float float_field;
+ }
+
+ static int test_0_ldsfld_soft_float () {
+ if (R4Holder.pi == 3.14f)
+ return 0;
+ else
+ return 1;
+ }
+
+ static int test_0_ldfld_stfld_soft_float () {
+ R4Holder h = new R4Holder ();
+ h.float_field = 3.14f;
+
+ if (h.float_field == 3.14f)
+ return 0;
+ else
+ return 1;
+ }
+
+ class R4HolderRemote : MarshalByRefObject {
+ public static float pi = 3.14f;
+
+ public float float_field;
+ }
+
+ static int test_0_ldfld_stfld_soft_float_remote () {
+ R4HolderRemote h = new R4HolderRemote ();
+ h.float_field = 3.14f;
+
+ if (h.float_field == 3.14f)
+ return 0;
+ else
+ return 1;
+ }
+
+ static int test_0_locals_soft_float () {
+ float f = 0.0f;
+
+ f = 3.14f;
+
+ if (f == 3.14f)
+ return 0;
+ else
+ return 1;
+ }
}