示例#1
0
        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}");
        }
示例#2
0
 public void ArgumentPassing()
 {
     cx.AddTestExpr(p1, p1);
     check.CheckOutput(cx);
 }
示例#3
0
        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());
        }