Exemplo n.º 1
0
        public void Rtlne_AddArgsToFn()
        {
            var hArg1 = m.Int16(3);
            var hArg2 = m.Int16(4);
            var hArg3 = m.Int16(5);
            var fn    = m.MapToHandle(
                new ProcedureConstant(
                    PrimitiveType.Ptr32,
                    new ExternalProcedure("RightTriangle", new FunctionType())));

            m.AddArg(hArg1);
            m.AddArg(hArg2);
            m.AddArg(hArg3);
            m.SideEffect(m.Fn(fn));

            m.FinishCluster(InstrClass.Linear, 0x00111100, 4);
            var rtlc = m.ExtractCluster();
            var sExp =
                @"00111100(4):
RightTriangle(3, 4, 5)
";

            AssertInstructions(sExp, rtlc);
        }
Exemplo n.º 2
0
        public HExpr CreateTemporary(BaseType size)
        {
            var id = frame.CreateTemporary(Interop.DataTypes[size]);

            return(m.MapToHandle(id));
        }