예제 #1
0
        public void SimpleOr_ParseCheck()
        {
            LOr or = new LOr(_valueResult, _valueOp1, _valueOp2);

            Assert.AreEqual($"{_valueResult.Identifier} = or {_valueResult.ParseType()} {_valueOp1.ValueOrIdentifier}, {_valueOp2.ValueOrIdentifier}",
                            LHelper.Trim(or.ParseInstruction()));
        }
예제 #2
0
        public void SimpleOr_WithConstant_ParseCheck()
        {
            LValueRef op2 = new LValueRef(LType.Int32Type(), "12");
            LOr       or  = new LOr(_valueResult, _valueOp1, op2);

            Assert.AreEqual($"{_valueResult.Identifier} = or {_valueResult.ParseType()} {_valueOp1.ValueOrIdentifier}, {op2.ValueOrIdentifier}",
                            LHelper.Trim(or.ParseInstruction()));
        }
예제 #3
0
        public void SimpleOr_Op2FromDifferentType_Expected_Exception()
        {
            LOr or;

            Assert.Throws <Exception>(() =>
                                      or = new LOr(_valueResult, _valueOp1, new LValueRef(LType.Int128Type(), "%op2"))
                                      );
        }
예제 #4
0
        public void SimpleOr_FloatingPointResultType_Expected_Exception()
        {
            LOr or;

            Assert.Throws <Exception>(() =>
                                      or = new LOr(new LValueRef(LType.F32Type(), "%result"), _valueOp1, _valueOp2)
                                      );
        }
예제 #5
0
        public void SimpleOr_ResultFromDifferentType_Expected_Exception()
        {
            LOr or;

            Assert.Throws <Exception>(() =>
                                      or = new LOr(new LValueRef(LType.Int128Type(), "%result"), _valueOp1, _valueOp2)
                                      );
        }