コード例 #1
0
        public void SimpleLoadParse_Expected_True()
        {
            LLoad load = new LLoad(_function, _alloca.PointerRef);

            Assert.AreEqual(
                $"{load.ValueRef.Identifier} = {LKeywords.Load} {LType.Int32Type().Parse()}, {load.PointerRef.ParseType()} {load.PointerRef.Identifier}",
                LHelper.Trim(load.ParseInstruction()));
        }
コード例 #2
0
        public void SimpleLoadAlignmentExceeded_Expected_Exception()
        {
            LLoad load;

            Assert.Throws <Exception>(() =>
                                      load = new LLoad(_function, _alloca.PointerRef)
            {
                Alignment = 1 << 30
            });
        }
コード例 #3
0
        public void LoadParseIsAtomicVolatile_Expected_True()
        {
            LLoad load = new LLoad(_function, _alloca.PointerRef)
            {
                IsAtomic   = true,
                IsVolatile = true
            };

            Assert.AreEqual(
                $"{load.ValueRef.Identifier} = {LKeywords.Load} {LKeywords.Atomic} {LKeywords.Volatile} {LType.Int32Type().Parse()}, {load.PointerRef.ParseType()} {load.PointerRef.Identifier}",
                LHelper.Trim(load.ParseInstruction()));
        }