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

Side by Side Diff: tests/SkSLErrorTest.cpp

Issue 2494523002: Revert of added constant folding & branch elimination to skslc (Closed)
Patch Set: Created 4 years, 1 month 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/sksl/SkSLIRGenerator.cpp ('k') | tests/SkSLGLSLTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkSLCompiler.h" 8 #include "SkSLCompiler.h"
9 9
10 #include "Test.h" 10 #include "Test.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 test_failure(r, 345 test_failure(r,
346 "void foo() { while(true) {} if (true) break; }", 346 "void foo() { while(true) {} if (true) break; }",
347 "error: 1: break statement must be inside a loop\n1 error\n"); 347 "error: 1: break statement must be inside a loop\n1 error\n");
348 } 348 }
349 349
350 DEF_TEST(SkSLContinueOutsideLoop, r) { 350 DEF_TEST(SkSLContinueOutsideLoop, r) {
351 test_failure(r, 351 test_failure(r,
352 "void foo() { for(;;); continue; }", 352 "void foo() { for(;;); continue; }",
353 "error: 1: continue statement must be inside a loop\n1 error\n" ); 353 "error: 1: continue statement must be inside a loop\n1 error\n" );
354 } 354 }
355
356 DEF_TEST(SkSLStaticIfError, r) {
357 // ensure eliminated branch of static if / ternary is still checked for erro rs
358 test_failure(r,
359 "void foo() { if (true); else x = 5; }",
360 "error: 1: unknown identifier 'x'\n1 error\n");
361 test_failure(r,
362 "void foo() { if (false) x = 5; }",
363 "error: 1: unknown identifier 'x'\n1 error\n");
364 test_failure(r,
365 "void foo() { true ? 5 : x; }",
366 "error: 1: unknown identifier 'x'\n1 error\n");
367 test_failure(r,
368 "void foo() { false ? x : 5; }",
369 "error: 1: unknown identifier 'x'\n1 error\n");
370 }
OLDNEW
« no previous file with comments | « src/sksl/SkSLIRGenerator.cpp ('k') | tests/SkSLGLSLTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698