Esempio n. 1
0
 public void SpecTest_br()
 {
     SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "br"), "br.json",
                        line =>
                        line == 3 ||
                        (line >= 334 && line <= 417) || // has no method source.
                        (line >= 420 && line <= 433) || // should have thrown an exception but did not.
                        (line >= 446 && line <= 455)    // should have thrown an exception but did not.
                        );
 }
Esempio n. 2
0
 public void SpecTest_elem()
 {
     SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "elem"), "elem.json",
                        line =>
                        line <= 60 ||                   // WASM broken by System.Action is not a GenericTypeDefinition.
                        (line >= 86 && line <= 134) ||  // WASM broken by System.Action is not a GenericTypeDefinition.
                        (line >= 318 && line <= 329) || // Missing import for spectest::table.
                        (line >= 353)                   // Multiple issues with loading these WASMs.
                        );
 }
Esempio n. 3
0
        public void SpecTest_traps()
        {
            var skips = new HashSet <uint>
            {
                83, // threw an unexpected exception of type InvalidProgramException.
                91, // threw an unexpected exception of type InvalidProgramException.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "traps"), "traps.json", skips.Contains);
        }
Esempio n. 4
0
 public void SpecTest_br_if()
 {
     SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "br_if"), "br_if.json",
                        line => line == 3 ||            // Stack empty.
                        (line >= 372 && line <= 478) || // has no method source.
                        (line >= 515 && line <= 521) || // should have thrown an exception but did not.
                        (line >= 540 && line <= 560) || // should have thrown an exception but did not.
                        (line >= 587 && line <= 593) || // should have thrown an exception but did not.
                        line == 618                     // should have thrown an exception but did not.
                        );
 }
Esempio n. 5
0
        public void SpecTest_call()
        {
            var skips = new HashSet <uint>
            {
                272, // Infinite loop
                273, // Infinite loop
                289, // IndexOutOfRangeException (expected to fail, but a better exception needed)
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "call"), "call.json", skips.Contains);
        }
Esempio n. 6
0
        public void SpecTest_conversions()
        {
            var skips = new HashSet <uint> {
                88, 89, 93, 133, 134, 139, 183, 187, 229, 234, 236
            };

            if (!Environment.Is64BitProcess) // 32-bit JIT operates differently as of .NET Core 3.1.
            {
                skips.UnionWith(new uint[] { 454, 455, 470, 471 });
            }
            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "conversions"), "conversions.json", skips.Contains);
        }
Esempio n. 7
0
        public void SpecTest_local_set()
        {
            var skip = new HashSet <uint>
            {
                194, // should have thrown an exception but did not.
                203, // should have thrown an exception but did not.
                212, // should have thrown an exception but did not.
                230, // should have thrown an exception but did not.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "local_set"), "local_set.json", skip.Contains);
        }
Esempio n. 8
0
        public void SpecTest_float_literals()
        {
            var skips = new HashSet <uint>
            {
                109, // Not equal: 2141192192 and 2145386496
                111, // Not equal: 2139169605 and 2143363909
                112, // Not equal: 2142257232 and 2146451536
                113, // Not equal: -5587746 and -1393442
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "float_literals"), "float_literals.json", skips.Contains);
        }
Esempio n. 9
0
        public void SpecTest_memory_grow()
        {
            var skips = new HashSet <uint>
            {
                47,  // Not equal: -1 and 0
                101, // StackSizeIncorrectException
            };

            skips.UnionWith(Enumerable.Range(259, (355 + 1) - 259).Select(i => (uint)i)); //Caused by 101 skip

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "memory_grow"), "memory_grow.json", skips.Contains);
        }
Esempio n. 10
0
        public void SpecTest_int_exprs()
        {
            HashSet <uint> skips = null;

            if (!Environment.Is64BitProcess)
            {
                skips = new HashSet <uint>
                {
                    58, 59, 77, 78,
                };
            }
            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "int_exprs"), "int_exprs.json", skips != null ? (Func <uint, bool>)skips.Contains : null);
        }
Esempio n. 11
0
        public void SpecTest_unreached_invalid()
        {
            var skips = new HashSet <uint>
            {
                490, // should have thrown an exception but did not.
                585, // should have thrown an exception but did not.
                604, // should have thrown an exception but did not.
                676, // should have thrown an exception but did not.
                690, // should have thrown an exception but did not.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "unreached-invalid"), "unreached-invalid.json", skips.Contains);
        }
Esempio n. 12
0
 public void SpecTest_br_table()
 {
     SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "br_table"), "br_table.json",
                        line => line == 3 ||              // StackTooSmallException
                        (line >= 1247 && line <= 1426) || // has no method source.
                        line == 1429 ||                   // should have thrown an exception but did not.
                        line == 1443 ||                   // should have thrown an exception but did not.
                        line == 1457 ||                   // should have thrown an exception but did not.
                        (line >= 1481 && line <= 1487) || // should have thrown an exception but did not.
                        line == 1502 ||                   // should have thrown an exception but did not.
                        line == 1521                      // should have thrown an exception but did not.
                        );
 }
Esempio n. 13
0
        public void SpecTest_i64()
        {
            var skips = new HashSet <uint> {
                106
            };

            if (!Environment.Is64BitProcess)
            {
                skips.UnionWith(Enumerable.Range(166, 47).Select(i => (uint)i)); // As of .NET Core 3.1, 32-bit mode can't bit shift by a 64-bit amount.
                skips.UnionWith(Enumerable.Range(242, 8).Select(i => (uint)i));  // As of .NET Core 3.1, 32-bit mode can't bit shift by a 64-bit amount.
            }

            SpecTestRunner.Run <IntegerMath <long> >(Path.Combine("Runtime", "SpecTestData", "i64"), "i64.json", skips.Contains);
        }
Esempio n. 14
0
        public void SpecTest_left_to_right()
        {
            HashSet <uint> skips = null;

            if (!Environment.Is64BitProcess)
            {
                skips = new HashSet <uint>
                {
                    205, // Common Language Runtime detected an invalid program.
                    206, // Common Language Runtime detected an invalid program.
                    207, // Common Language Runtime detected an invalid program.
                };
            }
            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "left-to-right"), "left-to-right.json", skips != null ? (Func <uint, bool>)skips.Contains : null);
        }
Esempio n. 15
0
        public void SpecTest_memory_size()
        {
            var skips = new HashSet <uint>
            {
                9,  // Not equal: 1 and 0
                11, // Not equal: 5 and 0
                13, // Not equal: 5 and 0
                39, // Not equal: 1 and 0
                41, // Not equal: 1 and 0
                43, // Not equal: 1 and 0
                45, // Not equal: 2 and 0
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "memory_size"), "memory_size.json", skips.Contains);
        }
Esempio n. 16
0
        public void SpecTest_endianness()
        {
            var skips = new HashSet <uint>
            {
                168, // Common Language Runtime detected an invalid program.
                169, // Common Language Runtime detected an invalid program.
                170, // Common Language Runtime detected an invalid program.
                171, // Common Language Runtime detected an invalid program.
                178, // Common Language Runtime detected an invalid program.
                179, // Common Language Runtime detected an invalid program.
                180, // Common Language Runtime detected an invalid program.
                181, // Common Language Runtime detected an invalid program.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "endianness"), "endianness.json", skips.Contains);
        }
Esempio n. 17
0
        public void SpecTest_store()
        {
            var skips = new HashSet <uint>
            {
                168, // should have thrown an exception but did not.
                178, // should have thrown an exception but did not.
                188, // should have thrown an exception but did not.
                198, // should have thrown an exception but did not.
                248, // should have thrown an exception but did not.
                258, // should have thrown an exception but did not.
                268, // should have thrown an exception but did not.
                278, // should have thrown an exception but did not.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "store"), "store.json", skips.Contains);
        }
Esempio n. 18
0
        public void SpecTest_block()
        {
            // Most commmon(/exlusive?) issue: should have thrown an exception but did not.
            var skips = new HashSet <uint>
            {
                373,
                382,
                391,
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "block"), "block.json",
                               line =>
                               line < 306 ||
                               (line >= 597 && line <= 861) || // This is imprecise due to so many failing.
                               skips.Contains(line)
                               );
        }
Esempio n. 19
0
        public void SpecTest_endianness()
        {
            var skips = new HashSet <uint>
            {
                168, // Common Language Runtime detected an invalid program.
                169, // Common Language Runtime detected an invalid program.
                170, // Common Language Runtime detected an invalid program.
                171, // Common Language Runtime detected an invalid program.
                178, // Common Language Runtime detected an invalid program.
                179, // Common Language Runtime detected an invalid program.
                180, // Common Language Runtime detected an invalid program.
                181, // Common Language Runtime detected an invalid program.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "endianness"), "endianness.json", line =>
                               skips.Contains(line) || (!Environment.Is64BitProcess && line >= 194)
                               );
        }
Esempio n. 20
0
        public void SpecTest_data()
        {
            var skips = new HashSet <uint>
            {
                78,  // MemoryAccessOutOfRangeException: Attempted to access 1 bytes of memory starting at offset 65536, which would have exceeded the allocated memory.
                83,  // MemoryAccessOutOfRangeException: Attempted to access 1 bytes of memory starting at offset 65536, which would have exceeded the allocated memory.
                89,  // MemoryAccessOutOfRangeException: Attempted to access 1 bytes of memory starting at offset 131072, which would have exceeded the allocated memory.
                94,  // Attempted to access 1 bytes of memory starting at offset 0, which would have exceeded the allocated memory.
                103, // Attempted to access 1 bytes of memory starting at offset 0, which would have exceeded the allocated memory.
                108, // Attempted to access 1 bytes of memory starting at offset 65536, which would have exceeded the allocated memory.
                113, // Attempted to access 1 bytes of memory starting at offset 0, which would have exceeded the allocated memory.
                122, // Attempted to access 1 bytes of memory starting at offset 0, which would have exceeded the allocated memory.
                186, // No exception thrown. ModuleLoadException exception was expected.
                194, // No exception thrown. ModuleLoadException exception was expected.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "data"), "data.json", skips.Contains);
        }
Esempio n. 21
0
        public void SpecTest_memory()
        {
            var skip = new HashSet <uint>
            {
                9,   // No exception thrown. ModuleLoadException exception was expected.
                11,  // Segment size of 0 is not currently supported.
                12,  // failed to look up method memsize
                13,  // Segment size of 0 is not currently supported.
                14,  // failed to look up method memsize
                49,  // No exception thrown. ModuleLoadException exception was expected.
                53,  // No exception thrown. ModuleLoadException exception was expected.
                57,  // No exception thrown. ModuleLoadException exception was expected.
                61,  // No exception thrown. ModuleLoadException exception was expected.
                65,  // No exception thrown. ModuleLoadException exception was expected.
                69,  // No exception thrown. ModuleLoadException exception was expected.
                73,  // No exception thrown. ModuleLoadException exception was expected.
                166, // Common Language Runtime detected an invalid program.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "memory"), "memory.json", skip.Contains);
        }
Esempio n. 22
0
        public void SpecTest_data()
        {
            var skips = new HashSet <uint>
            {
                5,   // 0-size data section
                27,  // compiler wants a memory section
                40,  // compiler wants a memory section
                50,  // Missing import for spectest::global_i32
                55,  // compiler wants a memory section
                61,  // Missing import for spectest::global_i32
                66,  // compiler wants a memory section
                78,  // MemoryAccessOutOfRangeException: Attempted to access 1 bytes of memory starting at offset 65536, which would have exceeded the allocated memory.
                83,  // compiler wants a memory section
                89,  // MemoryAccessOutOfRangeException: Attempted to access 1 bytes of memory starting at offset 131072, which would have exceeded the allocated memory.
                94,  // 0-size data section
                98,  // compiler wants a memory section
                103, // 0-size data section
                108, // 0-size data section
                113, // 0-size data section
                117, // compiler wants a memory section
                122, // 0-size data section
                127, // compiler wants a memory section
                132, // compiler wants a memory section
                137, // compiler wants a memory section
                143, // compiler wants a memory section
                149, // compiler wants a memory section
                154, // compiler wants a memory section
                162, // No exception thrown. ModuleLoadException exception was expected.
                170, // No exception thrown. ModuleLoadException exception was expected.
                178, // No exception thrown. ModuleLoadException exception was expected.
                211, // No exception thrown. ModuleLoadException exception was expected.
                220, // No exception thrown. ModuleLoadException exception was expected.
                235, // No exception thrown. ModuleLoadException exception was expected.
                243, // No exception thrown. ModuleLoadException exception was expected.
                251, // No exception thrown. ModuleLoadException exception was expected.
                266, // No exception thrown. ModuleLoadException exception was expected.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "data"), "data.json", skips.Contains);
        }
Esempio n. 23
0
        public void SpecTest_float_memory()
        {
            var skips = new HashSet <uint>
            {
                21,  // Not equal: 2141192192 and 2145386496
                40,  // Common Language Runtime detected an invalid program.
                41,  // Common Language Runtime detected an invalid program.
                43,  // Common Language Runtime detected an invalid program.
                44,  // Common Language Runtime detected an invalid program.
                46,  // Common Language Runtime detected an invalid program.
                47,  // Common Language Runtime detected an invalid program.
                49,  // Common Language Runtime detected an invalid program.
                50,  // Common Language Runtime detected an invalid program.
                52,  // Common Language Runtime detected an invalid program.
                53,  // Common Language Runtime detected an invalid program.
                73,  // Not equal: 2141192192 and 2145386496
                92,  // Common Language Runtime detected an invalid program.
                93,  // Common Language Runtime detected an invalid program.
                95,  // Common Language Runtime detected an invalid program.
                96,  // Common Language Runtime detected an invalid program.
                98,  // Common Language Runtime detected an invalid program.
                99,  // Common Language Runtime detected an invalid program.
                101, // Common Language Runtime detected an invalid program.
                102, // Common Language Runtime detected an invalid program.
                104, // Common Language Runtime detected an invalid program.
                105, // Common Language Runtime detected an invalid program.
                144, // Common Language Runtime detected an invalid program.
                145, // Common Language Runtime detected an invalid program.
                147, // Common Language Runtime detected an invalid program.
                148, // Common Language Runtime detected an invalid program.
                150, // Common Language Runtime detected an invalid program.
                151, // Common Language Runtime detected an invalid program.
                153, // Common Language Runtime detected an invalid program.
                154, // Common Language Runtime detected an invalid program.
                156, // Common Language Runtime detected an invalid program.
                157, // Common Language Runtime detected an invalid program.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "float_memory"), "float_memory.json", skips.Contains);
        }
Esempio n. 24
0
        public void SpecTest_float_literals()
        {
            var skips = new HashSet <uint>
            {
                109, // Not equal: 2141192192 and 2145386496
                111, // Not equal: 2139169605 and 2143363909
                112, // Not equal: 2142257232 and 2146451536
                113, // Not equal: -5587746 and -1393442
            };

            if (!Environment.Is64BitProcess)
            {
                skips.UnionWith(new uint[]
                {
                    141, // Not equal: 9219994337134247936 and 9222246136947933184
                    143, // Not equal: 9218888453225749180 and 9221140253039434428
                    144, // Not equal: 9219717281780008969 and 9221969081593694217
                    145, // Not equal: -3751748707474619 and -1499948893789371
                });
            }
            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "float_literals"), "float_literals.json", skips.Contains);
        }
Esempio n. 25
0
        public void SpecTest_float_exprs()
        {
            var skips = new HashSet <uint>
            {
                511,  // Arithmetic operation resulted in an overflow.
                519,  // Arithmetic operation resulted in an overflow.
                823,  // Common Language Runtime detected an invalid program.
                824,  // Common Language Runtime detected an invalid program.
                825,  // Common Language Runtime detected an invalid program.
                826,  // Common Language Runtime detected an invalid program.
                827,  // Common Language Runtime detected an invalid program.
                828,  // Common Language Runtime detected an invalid program.
                829,  // Common Language Runtime detected an invalid program.
                830,  // Common Language Runtime detected an invalid program.
                831,  // Common Language Runtime detected an invalid program.
                929,  // StackSizeIncorrectException
                1055, // StackSizeIncorrectException
                1430, // Common Language Runtime detected an invalid program.
                1431, // Common Language Runtime detected an invalid program.
                1432, // Common Language Runtime detected an invalid program.
                1433, // Common Language Runtime detected an invalid program.
                1434, // Common Language Runtime detected an invalid program.
                1581, // Common Language Runtime detected an invalid program.
                1582, // Common Language Runtime detected an invalid program.
                2349, // Not equal: 2143289344 and 2139095040
                2351, // Not equal: 2143289344 and 2139095040
                2353, // Not equal: 2143289344 and 2139095040
                2355, // Not equal: 9221120237041090560 and 9218868437227405312
                2357, // Not equal: 9221120237041090560 and 9218868437227405312
                2359, // Not equal: 9221120237041090560 and 9218868437227405312
            };

            skips.UnionWith(Enumerable.Range(973, (1004 + 1) - 973).Select(i => (uint)i));   //Caused by 929 skip
            skips.UnionWith(Enumerable.Range(1099, (1130 + 1) - 1099).Select(i => (uint)i)); //Caused by 1055 skip

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "float_exprs"), "float_exprs.json", skips.Contains);
        }
Esempio n. 26
0
        public void SpecTest_switch()
        {
            var skips = new HashSet <uint>
            {
                130, // Common Language Runtime detected an invalid program.
                131, // Common Language Runtime detected an invalid program.
                132, // Common Language Runtime detected an invalid program.
                133, // Common Language Runtime detected an invalid program.
                134, // Common Language Runtime detected an invalid program.
                135, // Common Language Runtime detected an invalid program.
                136, // Common Language Runtime detected an invalid program.
                138, // JIT Compiler encountered an internal limitation.
                139, // JIT Compiler encountered an internal limitation.
                140, // JIT Compiler encountered an internal limitation.
                141, // JIT Compiler encountered an internal limitation.
                142, // JIT Compiler encountered an internal limitation.
                143, // JIT Compiler encountered an internal limitation.
                144, // JIT Compiler encountered an internal limitation.
                145, // JIT Compiler encountered an internal limitation.
                146, // JIT Compiler encountered an internal limitation.
            };

            SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "switch"), "switch.json", skips.Contains);
        }
Esempio n. 27
0
 public void SpecTest_utf8_import_field()
 {
     SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "utf8-import-field"), "utf8-import-field.json");
 }
Esempio n. 28
0
 public void SpecTest_utf8_custom_section_id()
 {
     SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "utf8-custom-section-id"), "utf8-custom-section-id.json");
 }
Esempio n. 29
0
 public void SpecTest_unwind()
 {
     SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "unwind"), "unwind.json");
 }
Esempio n. 30
0
 public void SpecTest_unreachable()
 {
     SpecTestRunner.Run(Path.Combine("Runtime", "SpecTestData", "unreachable"), "unreachable.json");
 }