예제 #1
0
        public void ConditionalBr_ParseCheck()
        {
            LValueRef      condition     = new LValueRef(LType.BoolType(), _function.GetValueRefIdentifier());
            LConditionalBr conditionalBr = new LConditionalBr(
                condition, _ifTrueLabel, _ifFalseLabel);

            Assert.AreEqual(
                $"{LKeywords.Br} i1 {condition.ValueOrIdentifier}, {LKeywords.Label} {_ifTrueLabel.Identifier}, {LKeywords.Label} {_ifFalseLabel.Identifier}",
                LHelper.Trim(conditionalBr.ParseInstruction()));
        }
예제 #2
0
        public void ConditionalBr_TypeCheck_i8_Success()
        {
            LConditionalBr conditionalBr;

            Assert.DoesNotThrow(() =>
                                conditionalBr = new LConditionalBr(
                                    new LValueRef(LType.BoolType(), _function.GetValueRefIdentifier()),
                                    _ifTrueLabel, _ifFalseLabel)
                                );
        }