public void SimpleLshr_ParseCheck() { LShl shl = new LShl(_valueResult, _valueOp1, _valueOp2); Assert.AreEqual($"{_valueResult.Identifier} = shl {_valueResult.ParseType()} {_valueOp1.ValueOrIdentifier}, {_valueOp2.ValueOrIdentifier}", LHelper.Trim(shl.ParseInstruction())); }
public void SimpleLshr_WithConstant_ParseCheck() { LValueRef op2 = new LValueRef(LType.Int32Type(), "12"); LShl shl = new LShl(_valueResult, _valueOp1, op2); Assert.AreEqual($"{_valueResult.Identifier} = shl {_valueResult.ParseType()} {_valueOp1.ValueOrIdentifier}, {op2.ValueOrIdentifier}", LHelper.Trim(shl.ParseInstruction())); }
public void SimpleLshr_FloatingPointResultType_Expected_Exception() { LShl shl; Assert.Throws <Exception>(() => shl = new LShl(new LValueRef(LType.F32Type(), "%result"), _valueOp1, _valueOp2) ); }
public void SimpleLshr_Op2FromDifferentType_Expected_Exception() { LShl shl; Assert.Throws <Exception>(() => shl = new LShl(_valueResult, _valueOp1, new LValueRef(LType.Int128Type(), "%op2")) ); }
public void SimpleLshr_NuwNsw_ParseCheck() { LShl shl = new LShl(_valueResult, _valueOp1, _valueOp2) { NoUnsignedWrap = true, NoSignedWrap = true, }; Assert.AreEqual($"{_valueResult.Identifier} = shl nuw nsw {_valueResult.ParseType()} {_valueOp1.ValueOrIdentifier}, {_valueOp2.ValueOrIdentifier}", LHelper.Trim(shl.ParseInstruction())); }