示例#1
0
        public void Ret_ParseCheck_i32_Value_Ok()
        {
            LValueRef valueRef = new LValueRef(LType.Int32Type(), "12");
            LRet      ret      = new LRet(valueRef);

            Assert.AreEqual($"{LKeywords.Ret} i32 12", LHelper.Trim(ret.ParseInstruction()));
        }
示例#2
0
        public void Ret_ParseCheck_i32_Identifier_Ok()
        {
            LValueRef valueRef = new LValueRef(LType.Int32Type(), _function.GetValueRefIdentifier());
            LRet      ret      = new LRet(valueRef);

            Assert.AreEqual($"{LKeywords.Ret} i32 {valueRef.ValueOrIdentifier}", LHelper.Trim(ret.ParseInstruction()));
        }
示例#3
0
        public void Ret_ParseCheck_Void_Ok()
        {
            LRet ret = new LRet(new LValueRef(LType.VoidType(), _function.GetValueRefIdentifier()));

            Assert.AreEqual($"{LKeywords.Ret} {LKeywords.Void}", LHelper.Trim(ret.ParseInstruction()));
        }