Esempio n. 1
0
        public void SimpleAnd_ParseCheck()
        {
            LAnd and = new LAnd(_valueResult, _valueOp1, _valueOp2);

            Assert.AreEqual($"{_valueResult.Identifier} = and {_valueResult.ParseType()} {_valueOp1.ValueOrIdentifier}, {_valueOp2.ValueOrIdentifier}",
                            LHelper.Trim(and.ParseInstruction()));
        }
Esempio n. 2
0
        public void SimpleAnd_WithConstant_ParseCheck()
        {
            LValueRef op2 = new LValueRef(LType.Int32Type(), "12");
            LAnd      and = new LAnd(_valueResult, _valueOp1, op2);

            Assert.AreEqual($"{_valueResult.Identifier} = and {_valueResult.ParseType()} {_valueOp1.ValueOrIdentifier}, {op2.ValueOrIdentifier}",
                            LHelper.Trim(and.ParseInstruction()));
        }
Esempio n. 3
0
        public void SimpleAnd_FloatingPointResultType_Expected_Exception()
        {
            LAnd and;

            Assert.Throws <Exception>(() =>
                                      and = new LAnd(new LValueRef(LType.F32Type(), "%result"), _valueOp1, _valueOp2)
                                      );
        }
Esempio n. 4
0
        public void SimpleAnd_Op2FromDifferentType_Expected_Exception()
        {
            LAnd and;

            Assert.Throws <Exception>(() =>
                                      and = new LAnd(_valueResult, _valueOp1, new LValueRef(LType.Int128Type(), "%op2"))
                                      );
        }