skia2/resources/sksl/runtime_errors/LoopInitializerErrors.rts
John Stiles 6dda78ac7b Add SkSL error tests for runtime_errors directory.
This enables the SkSL error testing logic for runtime effects. The core
logic is identical, only the ProgramKind differs.

(Error creation scripts: http://go/paste/6413797460803584 with some
light post-processing)

Change-Id: I877205b3cc1014b50ccccf6037a2f4034c07543e
Bug: skia:12665
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506538
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-10 14:24:39 +00:00

28 lines
899 B
Plaintext

// Expect 8 errors
void no_initializer() { int i = 0; for ( ; i < 1; i++) {} }
void init_not_decl() { int i; for (i = 0; i < 1; i++) {} }
void index_no_init() { for (int i; i < 1; i++) {} }
void bool_index() { for (bool i = false; i != true; i = !i) {} }
void vec_index() { for (float2 i = float2(0); i.x < 1; i.x++) {} }
void array_index() { for (int i[2] = int[2](0, 0); i[0] < 1; ++i[0]) {} }
uniform int u;
void uniform_init() { for (int i = u; i < 1; ++i) {} }
void param_init(int p) { for (int i = p; i < 1; ++i) {} }
/*%%*
missing init declaration
invalid init declaration
missing loop index initializer
invalid type for loop index
invalid type for loop index
construction of array type 'int[2]' is not supported
unknown identifier 'i'
unknown identifier 'i'
loop index initializer must be a constant expression
loop index initializer must be a constant expression
*%%*/