Ejemplo n.º 1
0
        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()));
        }
Ejemplo n.º 2
0
        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()));
        }