Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: test/cctest/asmjs/test-asm-typer.cc

Issue 2172603002: [wasm] ASM-2-WASM. Enforces switch default clause appearing last. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/asmjs/asm-typer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cstring> 5 #include <cstring>
6 #include <functional> 6 #include <functional>
7 #include <iostream> 7 #include <iostream>
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/asmjs/asm-typer.h" 10 #include "src/asmjs/asm-typer.h"
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 const char* error_message; 852 const char* error_message;
853 } kTests[] = { 853 } kTests[] = {
854 {"if (fround(1));", "If condition must be type int"}, 854 {"if (fround(1));", "If condition must be type int"},
855 {"return;", "Type mismatch in return statement"}, 855 {"return;", "Type mismatch in return statement"},
856 {"return +1.0;", "Type mismatch in return statement"}, 856 {"return +1.0;", "Type mismatch in return statement"},
857 {"return +d()", "Type mismatch in return statement"}, 857 {"return +d()", "Type mismatch in return statement"},
858 {"while (fround(1));", "While condition must be type int"}, 858 {"while (fround(1));", "While condition must be type int"},
859 {"do {} while (fround(1));", "Do {} While condition must be type int"}, 859 {"do {} while (fround(1));", "Do {} While condition must be type int"},
860 {"for (;fround(1););", "For condition must be type int"}, 860 {"for (;fround(1););", "For condition must be type int"},
861 {"switch(flocal){ case 0: return 0; }", "Switch tag must be signed"}, 861 {"switch(flocal){ case 0: return 0; }", "Switch tag must be signed"},
862 {"switch(slocal){ default: case 0: return 0; }",
863 "Switch default must appear last"},
862 {"switch(slocal){ case 1: case 1: return 0; }", "Duplicated case label"}, 864 {"switch(slocal){ case 1: case 1: return 0; }", "Duplicated case label"},
863 {"switch(slocal){ case 1: case 0: break; case 1: return 0; }", 865 {"switch(slocal){ case 1: case 0: break; case 1: return 0; }",
864 "Duplicated case label"}, 866 "Duplicated case label"},
865 {"switch(slocal){ case 1.0: return 0; }", 867 {"switch(slocal){ case 1.0: return 0; }",
866 "Case label must be a 32-bit signed integer"}, 868 "Case label must be a 32-bit signed integer"},
867 {"switch(slocal){ case 1.0: return 0; }", 869 {"switch(slocal){ case 1.0: return 0; }",
868 "Case label must be a 32-bit signed integer"}, 870 "Case label must be a 32-bit signed integer"},
869 {"switch(slocal){ case -100000: case 2147483647: return 0; }", 871 {"switch(slocal){ case -100000: case 2147483647: return 0; }",
870 "Out-of-bounds case"}, 872 "Out-of-bounds case"},
871 {"switch(slocal){ case 2147483648: return 0; }", 873 {"switch(slocal){ case 2147483648: return 0; }",
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1791 const auto* test = kTests + ii; 1793 const auto* test = kTests + ii;
1792 if (!ValidationOf(Module(test->module)) 1794 if (!ValidationOf(Module(test->module))
1793 ->FailsWithMessage(test->error_message)) { 1795 ->FailsWithMessage(test->error_message)) {
1794 std::cerr << "Test:\n" << test->module; 1796 std::cerr << "Test:\n" << test->module;
1795 CHECK(false); 1797 CHECK(false);
1796 } 1798 }
1797 } 1799 }
1798 } 1800 }
1799 1801
1800 } // namespace 1802 } // namespace
OLDNEW
« no previous file with comments | « src/asmjs/asm-typer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698