public void SimpleAnd_Op1FromDifferentType_Expected_Exception() { LAnd and; Assert.Throws <Exception>(() => and = new LAnd(_valueResult, new LValueRef(LType.Int128Type(), "%op1"), _valueOp2) ); }
public void SimpleXor_Op1FromDifferentType_Expected_Exception() { LXor xor; Assert.Throws <Exception>(() => xor = new LXor(_valueResult, new LValueRef(LType.Int128Type(), "%op1"), _valueOp2) ); }
public void SimpleLshr_Op1FromDifferentType_Expected_Exception() { LShl shl; Assert.Throws <Exception>(() => shl = new LShl(_valueResult, new LValueRef(LType.Int128Type(), "%op1"), _valueOp2) ); }
public void SimpleLshr_ResultFromDifferentType_Expected_Exception() { LLshr lshr; Assert.Throws <Exception>(() => lshr = new LLshr(new LValueRef(LType.Int128Type(), "%result"), _valueOp1, _valueOp2) ); }
public void SimpleFadd_ResultFromDifferentType_Expected_Exception() { LFadd fadd; Assert.Throws <Exception>(() => fadd = new LFadd(new LValueRef(LType.Int128Type(), "%result"), _valueOp1, _valueOp2) ); }
public void AllocaLiteralStruct_Expected_Ok() { var @struct = new LLiteralStruct(new LValueRef(LType.Int128Type(), ""), new LValueRef(LType.Int16Type(), "")); LAlloca alloca = new LAlloca(_function, @struct); Assert.AreEqual($"{alloca.PointerRef.Identifier} = {LKeywords.Alloca} {{ i128, i16 }}", LHelper.Trim(alloca.ParseInstruction())); Assert.AreEqual("{ i128, i16 }*", LHelper.Trim(alloca.PointerRef.ParseType())); }
public void SimpleOr_Op2FromDifferentType_Expected_Exception() { LOr or; Assert.Throws <Exception>(() => or = new LOr(_valueResult, _valueOp1, new LValueRef(LType.Int128Type(), "%op2")) ); }
public void AllocaIdentifiedStruct_Expected_Ok() { string structIdentifier = "abcTestStruct"; var @struct = new LIdentifiedStruct(structIdentifier, new LValueRef(LType.Int128Type(), ""), new LValueRef(LType.Int16Type(), "")); LAlloca alloca = new LAlloca(_function, @struct); Assert.AreEqual($"{alloca.PointerRef.Identifier} = {LKeywords.Alloca} {structIdentifier}", LHelper.Trim(alloca.ParseInstruction())); Assert.AreEqual($"{structIdentifier}*", LHelper.Trim(alloca.PointerRef.ParseType())); }