public void StructFieldAccess(bool reference, bool dereference) { cx.AddType(MyStructDef); var thisP = ParameterExpression.Create(OptionallyReference(MyStruct, reference), "this"); var target = dereference ? Expression.Dereference(thisP) : thisP; var body = Expression.FieldAccess(MyStruct_IntField, target) .ReferenceAssign(Expression.Constant(0)); cx.AddTestExpr(body, thisP); check.CheckOutput(cx, $"ref={reference}&deref={dereference}"); }
public void ArgumentPassing() { cx.AddTestExpr(p1, p1); check.CheckOutput(cx); }
public void ArrayInitializer() { cx.AddTestExpr(ExpressionFactory.MakeArray(TypeSignature.Boolean)); var boolArray = ExpressionFactory.MakeArray(TypeSignature.Boolean, Expression.Constant(true), Expression.Constant(false)); cx.AddTestExpr(boolArray); check.CheckOutput(cx); check.CheckString(boolArray.ToString()); }