Add expected errors to every test file.

This was (crudely) automated with shell scripts:
http://go/paste/5484300603490304

Change-Id: Ic9e1c93112772d303d1158eb26d995f27b439eba
Bug: skia:12665
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505637
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2022-02-08 12:19:26 -05:00 committed by SkCQ
parent 28991c1a34
commit a456175a07
227 changed files with 1365 additions and 15 deletions
resources/sksl/errors
ArraySplitDimensions.skslArraySplitDimensionsInFuncBody.skslArraySplitDimensionsInFuncDecl.skslArraySplitDimensionsInStruct.skslArrayTooManyDimensions.skslArrayTooManyDimensionsInFuncBody.skslArrayTooManyDimensionsInFuncDecl.skslArrayTooManyDimensionsInStruct.skslArrayTypeTooManyDimensions.skslArrayTypeTooManyDimensionsInFuncBody.skslArrayTypeTooManyDimensionsInFuncDecl.skslArrayTypeTooManyDimensionsInStruct.skslArrayUnspecifiedDimensions.skslAssignmentTypeMismatch.skslBadCaps.skslBadConstInitializers.skslBadFieldAccess.skslBadIndex.skslBadModifiers.skslBadOctal.skslBinaryInvalidType.skslBinaryTypeCoercion.skslBinaryTypeMismatch.skslBitShiftFloat.skslBitShiftFloatMatrix.skslBitShiftFloatVector.skslBooleanArithmetic.skslBreakOutsideLoop.skslCallNonFunction.skslCanExitWithoutReturningValue.skslComparisonDimensional.skslConstructorArgumentCount.skslConstructorTypeMismatch.skslContinueOutsideLoop.skslDivideByZero.skslDoTypeMismatch.skslDuplicateFunction.skslDuplicateOutput.skslDuplicateSymbol.skslEmptyArray.skslEmptyStruct.skslErrorsInDeadCode.skslFloatRemainder.skslForInitStmt.skslForTypeMismatch.skslFunctionParameterOfVoid.skslGenericArgumentMismatch.skslIfTypeMismatch.skslInVarWithInitializerExpression.skslIncompleteExpression.skslIncompleteFunctionCall.skslInterfaceBlockMemberReservedName.skslInterfaceBlockReservedName.skslInterfaceBlockScope.skslInterfaceBlockStorageModifiers.skslInterfaceBlockWithNoMembers.skslIntrinsicInGlobalVariable.skslInvalidAssignment.skslInvalidOutParams.skslInvalidToken.skslInvalidUnary.skslLayoutInFunctions.skslLayoutInInterfaceBlock.skslLayoutInStruct.skslLayoutRepeatedQualifiers.skslMatrixIndexOutOfRange.skslMatrixInlinedIndexOutOfRange.skslMatrixToVectorCast3x3.skslMatrixToVectorCastBoolean.skslMatrixToVectorCastInteger.skslMatrixToVectorCastTooSmall.skslMismatchedNumbers.skslModifiersInStruct.skslMultipleFields.skslMultipleFieldsInInterfaceBlocks.skslNoES3ModifierInUserCode.skslOpaqueTypeAssignment.skslOpaqueTypeConstruction.skslOpaqueTypeInArray.skslOpaqueTypeInInterfaceBlock.skslOpaqueTypeInStruct.skslOpenArray.skslOssfuzz26700.skslOssfuzz27614.skslOssfuzz27650.skslOssfuzz27663.skslOssfuzz28050.skslOssfuzz29444.skslOssfuzz29845.skslOssfuzz29849.skslOssfuzz31410.skslOssfuzz31469.skslOssfuzz32156.skslOssfuzz32587.skslOssfuzz32851.skslOssfuzz36850.skslOssfuzz37457.skslOssfuzz37465.skslOssfuzz37469.skslOssfuzz37620.sksl

View File

@ -1 +1,5 @@
float[2] x[2];
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
void func() { float[2] x[2]; }
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
void func(float[2] x[2]) {}
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
struct S { float[2] x[2]; };
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
float x[2][2];
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
void main() { float x[2][2]; }
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
void func(float x[2][2]) {}
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
struct S { float x[2][2]; };
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
float[2][2] x;
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
void main() { float[2][2] x; }
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
void func(float[2][2] x) {}
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -1 +1,5 @@
struct S { float[2][2] x; };
/*%%*
multi-dimensional arrays are not supported
*%%*/

View File

@ -3,3 +3,10 @@ in int arrFloat[1.];
in int arrBool[true];
int unsized_in_expression() { return int[](0)[0]; }
/*%%*
expected array dimension
array size must be an integer
array size must be an integer
missing index in '[]'
*%%*/

View File

@ -6,3 +6,13 @@ void type_ref_in_comma_expr() { int x = (bool4, 1); }
int function_ref_in_global_variable = mix;
float3x3 type_ref_in_global_variable = float3x3;
/*%%*
expected 'int', but found 'float'
type mismatch: '=' cannot operate on 'int', 'float'
type mismatch: '*=' cannot operate on 'int3', 'float'
expected '(' to begin function call
expected '(' to begin constructor invocation
expected '(' to begin function call
expected '(' to begin constructor invocation
*%%*/

View File

@ -1 +1,5 @@
bool b = sk_Caps.bugFreeDriver;
/*%%*
unknown capability flag 'bugFreeDriver'
*%%*/

View File

@ -20,3 +20,13 @@ void from_non_const_local() { float x = u; const float y = x; }
void from_non_const_expression() { const float x = u + u; }
void from_mixed_expression() { const float x = c + u; }
void from_non_const_struct_field() { const float x = s.f; }
/*%%*
'const' variable initializer must be a constant expression
'const' variable initializer must be a constant expression
'const' variable initializer must be a constant expression
'const' variable initializer must be a constant expression
'const' variable initializer must be a constant expression
'const' variable initializer must be a constant expression
'const' variable initializer must be a constant expression
*%%*/

View File

@ -5,3 +5,11 @@ void not_a_function() { S s; s.f(); }
void not_a_bvec() { S s; s.f = bool3(true); }
void not_a_struct() { S s; s.f.missing; }
void not_an_array() { S s; s.f[0]; }
/*%%*
type 'S' does not have a field named 'missing'
not a function
type mismatch: '=' cannot operate on 'float', 'bool3'
invalid swizzle component 'm'
expected array, but found 'float'
*%%*/

View File

@ -1,2 +1,7 @@
void int_not_array() { int x = 2[0]; }
void index_float2_twice() { float2 x = float2(0); int y = x[0][0]; }
/*%%*
expected array, but found 'int'
expected array, but found 'float'
*%%*/

View File

@ -4,3 +4,24 @@ void func2(const in out uniform flat noperspective sk_has_side_effects
inline noinline float test) {}
const in out uniform flat noperspective sk_has_side_effects inline noinline float var;
/*%%*
'const' is not permitted here
'in' is not permitted here
'out' is not permitted here
'uniform' is not permitted here
'flat' is not permitted here
'noperspective' is not permitted here
functions cannot be both 'inline' and 'noinline'
'uniform' is not permitted here
'flat' is not permitted here
'noperspective' is not permitted here
'sk_has_side_effects' is not permitted here
'inline' is not permitted here
'noinline' is not permitted here
'in uniform' variables not permitted
'sk_has_side_effects' is not permitted here
'inline' is not permitted here
'noinline' is not permitted here
'const' variables must be initialized
*%%*/

View File

@ -1,2 +1,7 @@
int i1 = 08;
int i2 = 012349;
/*%%*
'08' is not a valid octal number
expected expression, but found '08'
*%%*/

View File

@ -53,3 +53,18 @@ void arrayRight() {
void arrayBoth() {
float x = array * array;
}
/*%%*
type mismatch: '*' cannot operate on '<INVALID>', 'int'
type mismatch: '*' cannot operate on 'int', '<INVALID>'
type mismatch: '*' cannot operate on '<INVALID>', '<INVALID>'
type mismatch: '*' cannot operate on 'S', 'int'
type mismatch: '*' cannot operate on 'int', 'S'
type mismatch: '*' cannot operate on 'S', 'S'
type mismatch: '*' cannot operate on 'sampler2D', 'int'
type mismatch: '*' cannot operate on 'int', 'sampler2D'
type mismatch: '*' cannot operate on 'sampler2D', 'sampler2D'
type mismatch: '*' cannot operate on 'int[1]', 'int'
type mismatch: '*' cannot operate on 'int', 'int[1]'
type mismatch: '*' cannot operate on 'int[1]', 'int[1]'
*%%*/

View File

@ -53,3 +53,26 @@ void matrix_times_matrix_disallowed_3() { H4x4 *= F4x4; }
void dimensions_ok_1() { F4x4 *= F4x4; }
void dimensions_ok_2() { F4 *= F4x4; }
void dimensions_disallowed_1() { F4x4 *= F4; }
/*%%*
type mismatch: '=' cannot operate on 'half', 'float'
type mismatch: '=' cannot operate on 'half', 'float'
type mismatch: '*=' cannot operate on 'half', 'float'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '*=' cannot operate on 'half4', 'float4'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '*=' cannot operate on 'half4', 'float'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '=' cannot operate on 'half4', 'float4'
type mismatch: '*=' cannot operate on 'half4', 'float4x4'
type mismatch: '=' cannot operate on 'half4x4', 'float4x4'
type mismatch: '=' cannot operate on 'half4x4', 'float4x4'
type mismatch: '*=' cannot operate on 'half4x4', 'float4x4'
type mismatch: '*=' cannot operate on 'float4x4', 'float4'
*%%*/

View File

@ -6,3 +6,13 @@ void float2_neq_int() { bool x = float2(0) != 0; }
void float2_lt_float2() { bool x = float2(0) < float2(1); }
void float2_lt_float() { bool x = float2(0) < 0.0; }
void float_lt_float2() { bool x = 0.0 < float2(0); }
/*%%*
type mismatch: '*' cannot operate on 'int', 'bool'
type mismatch: '||' cannot operate on 'int', 'float'
type mismatch: '==' cannot operate on 'float2', 'int'
type mismatch: '!=' cannot operate on 'float2', 'int'
type mismatch: '<' cannot operate on 'float2', 'float2'
type mismatch: '<' cannot operate on 'float2', 'float'
type mismatch: '<' cannot operate on 'float', 'float2'
*%%*/

View File

@ -13,3 +13,16 @@ void shl() { x = x << 1; }
void and() { x = x & 1; }
void or() { x = x | 1; }
void xor() { x = x ^ 1; }
/*%%*
type mismatch: '>>=' cannot operate on 'float', 'int'
type mismatch: '<<=' cannot operate on 'float', 'int'
type mismatch: '&=' cannot operate on 'float', 'int'
type mismatch: '|=' cannot operate on 'float', 'int'
type mismatch: '^=' cannot operate on 'float', 'int'
type mismatch: '>>' cannot operate on 'float', 'int'
type mismatch: '<<' cannot operate on 'float', 'int'
type mismatch: '&' cannot operate on 'float', 'int'
type mismatch: '|' cannot operate on 'float', 'int'
type mismatch: '^' cannot operate on 'float', 'int'
*%%*/

View File

@ -13,3 +13,16 @@ void shl() { x = x << 1; }
void and() { x = x & 1; }
void or() { x = x | 1; }
void xor() { x = x ^ 1; }
/*%%*
type mismatch: '>>=' cannot operate on 'float2x2', 'int'
type mismatch: '<<=' cannot operate on 'float2x2', 'int'
type mismatch: '&=' cannot operate on 'float2x2', 'int'
type mismatch: '|=' cannot operate on 'float2x2', 'int'
type mismatch: '^=' cannot operate on 'float2x2', 'int'
type mismatch: '>>' cannot operate on 'float2x2', 'int'
type mismatch: '<<' cannot operate on 'float2x2', 'int'
type mismatch: '&' cannot operate on 'float2x2', 'int'
type mismatch: '|' cannot operate on 'float2x2', 'int'
type mismatch: '^' cannot operate on 'float2x2', 'int'
*%%*/

View File

@ -13,3 +13,16 @@ void shl() { x = x << 1; }
void and() { x = x & 1; }
void or() { x = x | 1; }
void xor() { x = x ^ 1; }
/*%%*
type mismatch: '>>=' cannot operate on 'float2', 'int'
type mismatch: '<<=' cannot operate on 'float2', 'int'
type mismatch: '&=' cannot operate on 'float2', 'int'
type mismatch: '|=' cannot operate on 'float2', 'int'
type mismatch: '^=' cannot operate on 'float2', 'int'
type mismatch: '>>' cannot operate on 'float2', 'int'
type mismatch: '<<' cannot operate on 'float2', 'int'
type mismatch: '&' cannot operate on 'float2', 'int'
type mismatch: '|' cannot operate on 'float2', 'int'
type mismatch: '^' cannot operate on 'float2', 'int'
*%%*/

View File

@ -24,3 +24,31 @@ bool2 bitnot_boolean_vec() { return ~bool2(false, false); }
bool2 bitand_boolean_vec() { return bool2(false, false) & bool2(true, true); }
bool2 bitor_boolean_vec() { return bool2(false, false) | bool2(true, true); }
bool2 bitxor_boolean_vec() { return bool2(false, false) ^ bool2(true, true); }
/*%%*
type mismatch: '+' cannot operate on 'bool', 'bool'
type mismatch: '-' cannot operate on 'bool', 'bool'
type mismatch: '*' cannot operate on 'bool', 'bool'
type mismatch: '/' cannot operate on 'bool', 'bool'
type mismatch: '%' cannot operate on 'bool', 'bool'
type mismatch: '<<' cannot operate on 'bool', 'bool'
type mismatch: '>>' cannot operate on 'bool', 'bool'
'-' cannot operate on 'bool'
'~' cannot operate on 'bool'
type mismatch: '&' cannot operate on 'bool', 'bool'
type mismatch: '|' cannot operate on 'bool', 'bool'
type mismatch: '^' cannot operate on 'bool', 'bool'
type mismatch: '+' cannot operate on 'bool2', 'bool2'
type mismatch: '-' cannot operate on 'bool2', 'bool2'
type mismatch: '*' cannot operate on 'bool2', 'bool2'
type mismatch: '/' cannot operate on 'bool2', 'bool2'
type mismatch: '%' cannot operate on 'bool2', 'bool2'
type mismatch: '<<' cannot operate on 'bool2', 'bool2'
type mismatch: '>>' cannot operate on 'bool2', 'bool2'
'!' cannot operate on 'bool2'
'-' cannot operate on 'bool2'
'~' cannot operate on 'bool2'
type mismatch: '&' cannot operate on 'bool2', 'bool2'
type mismatch: '|' cannot operate on 'bool2', 'bool2'
type mismatch: '^' cannot operate on 'bool2', 'bool2'
*%%*/

View File

@ -1 +1,5 @@
void outside_while() { while(true) {} if (true) break; }
/*%%*
break statement must be inside a loop or switch
*%%*/

View File

@ -2,3 +2,7 @@ void main() {
float x = 3;
x();
}
/*%%*
not a function
*%%*/

View File

@ -93,3 +93,27 @@ int switch_with_conditional_break_then_fallthrough() {
default: return 2;
}
}
/*%%*
function 'if_only' can exit without returning a value
function 'return_on_if_but_not_else' can exit without returning a value
function 'return_on_else_but_not_if' can exit without returning a value
function 'for_with_conditional_return' can exit without returning a value
function 'for_with_conditional_break' can exit without returning a value
function 'for_with_conditional_continue' can exit without returning a value
function 'do_with_conditional_return' can exit without returning a value
function 'do_with_conditional_break' can exit without returning a value
function 'do_with_conditional_continue' can exit without returning a value
function 'bad_if_else_chain' can exit without returning a value
function 'switch_empty' can exit without returning a value
function 'switch_with_no_default' can exit without returning a value
function 'switch_with_break' can exit without returning a value
continue statement cannot be used in a switch
function 'switch_with_continue' can exit without returning a value
function 'switch_with_fallthrough_off_bottom' can exit without returning a value
function 'switch_with_conditional_break' can exit without returning a value
continue statement cannot be used in a switch
function 'switch_with_conditional_continue' can exit without returning a value
function 'switch_with_conditional_if_then_return' can exit without returning a value
function 'switch_with_conditional_break_then_fallthrough' can exit without returning a value
*%%*/

View File

@ -19,3 +19,21 @@ bool different_vectors() {
float3 v3;
return v2 == v3 || v2 != v3;
}
/*%%*
type mismatch: '==' cannot operate on 'float2', 'float'
type mismatch: '==' cannot operate on 'float2', 'float2x2'
type mismatch: '==' cannot operate on 'float2x2', 'float'
type mismatch: '==' cannot operate on 'float', 'float2'
type mismatch: '==' cannot operate on 'float2x2', 'float2'
type mismatch: '==' cannot operate on 'float', 'float2x2'
type mismatch: '!=' cannot operate on 'float2', 'float'
type mismatch: '!=' cannot operate on 'float2', 'float2x2'
type mismatch: '!=' cannot operate on 'float2x2', 'float'
type mismatch: '!=' cannot operate on 'float', 'float2'
type mismatch: '!=' cannot operate on 'float2x2', 'float2'
type mismatch: '!=' cannot operate on 'float', 'float2x2'
type mismatch: '==' cannot operate on 'float2x2', 'float3x3'
type mismatch: '!=' cannot operate on 'float2x2', 'float3x3'
type mismatch: '==' cannot operate on 'float2', 'float3'
type mismatch: '!=' cannot operate on 'float2', 'float3'
*%%*/

View File

@ -1,3 +1,9 @@
void construct_float3_from_float_float() { float3 x = float3(1.0, 2.0); }
void construct_float3_from_float_float_float_float() { float3 x = float3(1.0, 2.0, 3.0, 4.0); }
void construct_bool_from_int3() { bool x = bool(int3(77)); }
/*%%*
invalid arguments to 'float3' constructor (expected 3 scalars, but found 2)
invalid arguments to 'float3' constructor (expected 3 scalars, but found 4)
'int3' is not a valid parameter to 'bool' constructor
*%%*/

View File

@ -8,3 +8,12 @@ void construct_float2_from_struct() { float2 x = float2(foo); }
void construct_float2x2_from_struct() { float2x2 x = float2x2(foo); }
void construct_float2x2_from_type() { float2x2 x = float2x2(int); }
void construct_float2x2_from_function() { float2x2 x = float2x2(sqrt); }
/*%%*
expected 'int', but found 'float2x2'
'Foo' is not a valid parameter to 'float' constructor
'Foo' is not a valid parameter to 'float2' constructor
'Foo' is not a valid parameter to 'float2x2' constructor
'<INVALID>' is not a valid parameter to 'float2x2' constructor
'<INVALID>' is not a valid parameter to 'float2x2' constructor
*%%*/

View File

@ -1,2 +1,7 @@
void outside_for() { for (;;) {} continue; }
void inside_switch() { switch (1) { default: continue; } }
/*%%*
continue statement must be inside a loop
continue statement must be inside a loop
*%%*/

View File

@ -2,3 +2,10 @@ int a = 1 / 0;
float b = 1 / 0;
float c = 1.0 / 0.0;
float d = -67.0 / (3.0 - 3);
/*%%*
division by zero
division by zero
division by zero
division by zero
*%%*/

View File

@ -1,3 +1,7 @@
void main() {
do {} while (float2(1));
}
/*%%*
expected 'bool', but found 'float2'
*%%*/

View File

@ -1,2 +1,6 @@
void main() {}
void main() {}
/*%%*
duplicate definition of void main()
*%%*/

View File

@ -1 +1,5 @@
layout (location=0, index=0) out half4 duplicateOutput;
/*%%*
out location=0, index=0 is reserved for sk_FragColor
*%%*/

View File

@ -5,3 +5,9 @@ int main;
void main() {
int y,y;
}
/*%%*
symbol 'x' was already defined
symbol 'main' was already defined
symbol 'y' was already defined
*%%*/

View File

@ -1,2 +1,7 @@
int disallowed_zero[0];
int disallowed_negative[-1];
/*%%*
array size must be positive
array size must be positive
*%%*/

View File

@ -1 +1,5 @@
struct S { };
/*%%*
struct 'S' must contain at least one field
*%%*/

View File

@ -4,3 +4,10 @@ void error_in_dead_else_body() { if (true) {} else x = 5; }
void error_in_dead_if_body() { if (false) x = 5; }
void error_in_dead_ternary_true_expr() { true ? 5 : x; }
void error_in_dead_ternary_false_expr() { false ? x : 5; }
/*%%*
unknown identifier 'x'
unknown identifier 'x'
unknown identifier 'x'
unknown identifier 'x'
*%%*/

View File

@ -5,3 +5,8 @@ float y;
void rem() { x = x % y; }
void rem_eq() { x %= y; }
/*%%*
type mismatch: '%' cannot operate on 'float', 'float'
type mismatch: '%=' cannot operate on 'float', 'float'
*%%*/

View File

@ -8,3 +8,7 @@ void test_init_stmt_continue() { for (continue;; ) {} }
void test_init_stmt_discard() { for (discard;; ) {} }
void test_init_stmt_type() { for (void;; ) {} }
void test_init_stmt_deep() { for (for(for(for(;;);;);;);;) {} }
/*%%*
expected expression, but found 'for'
*%%*/

View File

@ -1,3 +1,7 @@
void main() {
for (int x = 0; x; x++) {}
}
/*%%*
expected 'bool', but found 'int'
*%%*/

View File

@ -1 +1,5 @@
void func(void x) {}
/*%%*
expected ')', but found 'x'
*%%*/

View File

@ -1,3 +1,8 @@
void sin_int_int() { float x = sin(1, 2); }
void sin_bool() { float x = sin(true); }
/*%%*
no match for sin(int, int)
no match for sin(bool)
*%%*/

View File

@ -1,3 +1,7 @@
void main() {
if (3) {}
}
/*%%*
expected 'bool', but found 'int'
*%%*/

View File

@ -1 +1,5 @@
in float x = 1;
/*%%*
'in' variables cannot use initializer expressions
*%%*/

View File

@ -2,3 +2,8 @@ half4 main(float2 xy) {
int;
return half4(0);
}
/*%%*
expected '(' to begin constructor invocation
expected a type, but found 'return'
*%%*/

View File

@ -2,3 +2,8 @@ half4 main(float2 xy) {
mix;
return half4(0);
}
/*%%*
expected '(' to begin function call
expected a type, but found 'return'
*%%*/

View File

@ -5,3 +5,7 @@ IB {
float4 main() {
return ib.float.xxxx;
}
/*%%*
expected an identifier, but found type 'float'
*%%*/

View File

@ -5,3 +5,7 @@ IB {
float4 main() {
return float.f.xxxx;
}
/*%%*
expected ';', but found 'float'
*%%*/

View File

@ -1,3 +1,7 @@
uniform testBlock {
float x;
} test[x];
/*%%*
unknown identifier 'x'
*%%*/

View File

@ -1 +1,5 @@
uniform foo { out int x; };
/*%%*
'out' is not permitted here
*%%*/

View File

@ -1,2 +1,7 @@
const S {};
testBlock {} x[2];
/*%%*
interface block 'S' must contain at least one member
interface block 'testBlock' must contain at least one member
*%%*/

View File

@ -1,2 +1,6 @@
half4 c = blend_src_over(half4(1), half4(0));
void f() {}
/*%%*
global variable initializer must be a constant expression
*%%*/

View File

@ -21,3 +21,19 @@ void assign_to_unary_plus() { float x; +x = 0; } // TODO(skbu
void assign_to_const_param(const int x) { x = 0; }
void assign_to_const_array_param(const int x[1]) { x[0] = 0; }
void assign_to_const_struct_param(const S s) { s.f = 0; }
/*%%*
cannot assign to this expression
cannot modify immutable variable 'u'
cannot modify immutable variable 'x'
cannot assign to this expression
cannot write to the same swizzle field more than once
cannot modify immutable variable 'l'
cannot modify immutable variable 'r'
cannot modify immutable variable 'l'
cannot assign to this expression
cannot assign to this expression
cannot modify immutable variable 'x'
cannot modify immutable variable 'x'
cannot modify immutable variable 's'
*%%*/

View File

@ -4,3 +4,9 @@ void inc4(out float4 x) { x += half4(1); }
void test_a() { inc1(0); }
void test_b() { inc4(float4(0)); }
void test_c() { inc1(sqrt(1)); }
/*%%*
cannot assign to this expression
cannot assign to this expression
cannot assign to this expression
*%%*/

View File

@ -1,2 +1,6 @@
💩
void main() {}
/*%%*
invalid token
*%%*/

View File

@ -7,3 +7,13 @@ void postdecrement_vector() { float3 x = float3(1); x--; }
void not_integer() { int x = !12; }
void positive_struct() { Foo x = +bar; }
void negative_struct() { Foo x = -bar; }
/*%%*
'++' cannot operate on 'float4x4'
'--' cannot operate on 'float3'
'++' cannot operate on 'float4x4'
'--' cannot operate on 'float3'
'!' cannot operate on 'int'
'+' cannot operate on 'Foo'
'-' cannot operate on 'Foo'
*%%*/

View File

@ -25,3 +25,28 @@ layout (
set = 1,
builtin = 1,
input_attachment_index = 1) float x) {}
/*%%*
layout qualifier 'origin_upper_left' is not permitted here
layout qualifier 'push_constant' is not permitted here
layout qualifier 'blend_support_all_equations' is not permitted here
layout qualifier 'color' is not permitted here
layout qualifier 'location' is not permitted here
layout qualifier 'offset' is not permitted here
layout qualifier 'binding' is not permitted here
layout qualifier 'index' is not permitted here
layout qualifier 'set' is not permitted here
layout qualifier 'builtin' is not permitted here
layout qualifier 'input_attachment_index' is not permitted here
layout qualifier 'origin_upper_left' is not permitted here
layout qualifier 'push_constant' is not permitted here
layout qualifier 'blend_support_all_equations' is not permitted here
layout qualifier 'color' is not permitted here
layout qualifier 'location' is not permitted here
layout qualifier 'offset' is not permitted here
layout qualifier 'binding' is not permitted here
layout qualifier 'index' is not permitted here
layout qualifier 'set' is not permitted here
layout qualifier 'builtin' is not permitted here
layout qualifier 'input_attachment_index' is not permitted here
*%%*/

View File

@ -4,3 +4,8 @@ t {
layout(binding=1) A y; // Not allowed
layout(set=0) A z; // Not allowed
};
/*%%*
layout qualifier 'binding' is not permitted here
layout qualifier 'set' is not permitted here
*%%*/

View File

@ -8,3 +8,7 @@ A a;
void main(){
a.x++;
}
/*%%*
layout qualifier 'binding' is not permitted on a struct field
layout qualifier 'set' is not permitted on a struct field
*%%*/

View File

@ -23,3 +23,20 @@ layout (
builtin = 2,
input_attachment_index = 2
) float x;
/*%%*
layout qualifier 'origin_upper_left' appears more than once
layout qualifier 'push_constant' appears more than once
layout qualifier 'blend_support_all_equations' appears more than once
layout qualifier 'color' appears more than once
layout qualifier 'location' appears more than once
layout qualifier 'offset' appears more than once
layout qualifier 'binding' appears more than once
layout qualifier 'index' appears more than once
layout qualifier 'set' appears more than once
layout qualifier 'builtin' appears more than once
layout qualifier 'input_attachment_index' appears more than once
'layout(color)' is only permitted in runtime effects
'layout(color)' is only permitted on 'uniform' variables
'layout(color)' is not permitted on variables of type 'float'
*%%*/

View File

@ -29,3 +29,22 @@ void half4_2_constidx() { half3x3 m; const int INDEX = 2; h
void half4_3_constidx() { half3x3 m; const int INDEX = 3; half3 v = m[INDEX]; }
void half4_4_constidx() { half3x3 m; const int INDEX = 4; half3 v = m[INDEX]; }
void half4_huge_constidx() { half3x3 m; const int INDEX = 1000000000; half3 v = m[INDEX]; }
/*%%*
index -1 out of range for 'half2x4'
index 2 out of range for 'half2x4'
index 3 out of range for 'half2x4'
index 4 out of range for 'half2x4'
index 1000000000 out of range for 'half2x4'
index -1 out of range for 'half3x3'
index 3 out of range for 'half3x3'
index 4 out of range for 'half3x3'
index 1000000000 out of range for 'half3x3'
index -1 out of range for 'half4x2'
index 4 out of range for 'half4x2'
index 1000000000 out of range for 'half4x2'
index -1 out of range for 'half3x3'
index 3 out of range for 'half3x3'
index 4 out of range for 'half3x3'
index 1000000000 out of range for 'half3x3'
*%%*/

View File

@ -11,3 +11,8 @@ half4 main(float2 coords) {
float3 undefined = indexMatrix(-1) + indexMatrix(3);
return colorGreen;
}
/*%%*
index -1 out of range for 'float3x3'
index 3 out of range for 'float3x3'
*%%*/

View File

@ -5,3 +5,10 @@ half testScalar = half (testMatrix3x3);
half2 testVec2 = half2(testMatrix3x3);
half3 testVec3 = half3(testMatrix3x3);
half4 testVec4 = half4(testMatrix3x3);
/*%%*
'half3x3' is not a valid parameter to 'half' constructor; use '[0][0]' instead
'half3x3' is not a valid parameter to 'half2' constructor
'half3x3' is not a valid parameter to 'half3' constructor
'half3x3' is not a valid parameter to 'half4' constructor
*%%*/

View File

@ -5,3 +5,9 @@ bool testScalar = bool (testMatrix2x2);
bool2 testVec2 = bool2(testMatrix2x2);
bool3 testVec3 = bool3(testMatrix2x2);
bool4 testVec4 = bool4(testMatrix2x2); // not an error
/*%%*
'half2x2' is not a valid parameter to 'bool' constructor
'half2x2' is not a valid parameter to 'bool2' constructor
'half2x2' is not a valid parameter to 'bool3' constructor
*%%*/

View File

@ -5,3 +5,9 @@ int testScalar = int (testMatrix2x2);
int2 testVec2 = int2(testMatrix2x2);
int3 testVec3 = int3(testMatrix2x2);
int4 testVec4 = int4(testMatrix2x2); // not an error
/*%%*
'half2x2' is not a valid parameter to 'int' constructor
'half2x2' is not a valid parameter to 'int2' constructor
'half2x2' is not a valid parameter to 'int3' constructor
*%%*/

View File

@ -5,3 +5,9 @@ half testScalar = half (testMatrix2x2);
half2 testVec2 = half2(testMatrix2x2);
half3 testVec3 = half3(testMatrix2x2);
half4 testVec4 = half4(testMatrix2x2); // not an error
/*%%*
'half2x2' is not a valid parameter to 'half' constructor; use '[0][0]' instead
'half2x2' is not a valid parameter to 'half2' constructor
'half2x2' is not a valid parameter to 'half3' constructor
*%%*/

View File

@ -73,3 +73,56 @@ void u_plus_i_disallowed() { u + i; }
void u_minus_i_disallowed() { u - i; }
void u_mul_i_disallowed() { u * i; }
void u_div_i_disallowed() { u / i; }
/*%%*
type mismatch: '=' cannot operate on 'int', 'float'
type mismatch: '=' cannot operate on 'uint', 'float'
type mismatch: '=' cannot operate on 'int', 'uint'
type mismatch: '=' cannot operate on 'int', 'float'
type mismatch: '=' cannot operate on 'float', 'int'
function 'f_eq_i_disallowed' can exit without returning a value
type mismatch: '=' cannot operate on 'float', 'uint'
function 'f_eq_u_disallowed' can exit without returning a value
type mismatch: '=' cannot operate on 'uint', 'int'
type mismatch: '=' cannot operate on 'uint', 'float'
type mismatch: '+' cannot operate on 'int', 'float'
type mismatch: '-' cannot operate on 'int', 'float'
type mismatch: '*' cannot operate on 'int', 'float'
type mismatch: '/' cannot operate on 'int', 'float'
type mismatch: '+' cannot operate on 'float', 'int'
type mismatch: '-' cannot operate on 'float', 'int'
type mismatch: '*' cannot operate on 'float', 'int'
type mismatch: '/' cannot operate on 'float', 'int'
type mismatch: '+' cannot operate on 'uint', 'float'
type mismatch: '-' cannot operate on 'uint', 'float'
type mismatch: '*' cannot operate on 'uint', 'float'
type mismatch: '/' cannot operate on 'uint', 'float'
type mismatch: '+' cannot operate on 'float', 'uint'
type mismatch: '-' cannot operate on 'float', 'uint'
type mismatch: '*' cannot operate on 'float', 'uint'
type mismatch: '/' cannot operate on 'float', 'uint'
type mismatch: '+' cannot operate on 'int', 'float'
type mismatch: '-' cannot operate on 'int', 'float'
type mismatch: '*' cannot operate on 'int', 'float'
type mismatch: '/' cannot operate on 'int', 'float'
type mismatch: '+' cannot operate on 'float', 'int'
type mismatch: '-' cannot operate on 'float', 'int'
type mismatch: '*' cannot operate on 'float', 'int'
type mismatch: '/' cannot operate on 'float', 'int'
type mismatch: '+' cannot operate on 'uint', 'float'
type mismatch: '-' cannot operate on 'uint', 'float'
type mismatch: '*' cannot operate on 'uint', 'float'
type mismatch: '/' cannot operate on 'uint', 'float'
type mismatch: '+' cannot operate on 'float', 'uint'
type mismatch: '-' cannot operate on 'float', 'uint'
type mismatch: '*' cannot operate on 'float', 'uint'
type mismatch: '/' cannot operate on 'float', 'uint'
type mismatch: '+' cannot operate on 'int', 'uint'
type mismatch: '-' cannot operate on 'int', 'uint'
type mismatch: '*' cannot operate on 'int', 'uint'
type mismatch: '/' cannot operate on 'int', 'uint'
type mismatch: '+' cannot operate on 'uint', 'int'
type mismatch: '-' cannot operate on 'uint', 'int'
type mismatch: '*' cannot operate on 'uint', 'int'
type mismatch: '/' cannot operate on 'uint', 'int'
*%%*/

View File

@ -5,3 +5,11 @@ struct S {
noperspective float4 d;
inout bool e;
};
/*%%*
modifier 'const' is not permitted on a struct field
modifier 'uniform' is not permitted on a struct field
modifier 'flat' is not permitted on a struct field
modifier 'noperspective' is not permitted on a struct field
modifier 'inout' is not permitted on a struct field
*%%*/

View File

@ -3,3 +3,7 @@ struct Varyings {
float var;
};
/*%%*
field 'var' was already defined in the same struct ('Varyings')
*%%*/

View File

@ -5,3 +5,8 @@ IB {
IB1 { float f; };
IB2 { float f; };
/*%%*
field 'f' was already defined in the same interface block ('IB')
symbol 'f' was already defined
*%%*/

View File

@ -1,2 +1,6 @@
$es3 void fn() {}
/*%%*
'$es3' is not permitted here
*%%*/

View File

@ -4,3 +4,11 @@ sampler c = a;
void declare() { sampler d; }
void initialize() { sampler e = a; }
void assign() { a = b; }
/*%%*
opaque type 'sampler' cannot use initializer expressions
variables of type 'sampler' must be global
variables of type 'sampler' must be global
opaque type 'sampler' cannot use initializer expressions
assignments to opaque type 'sampler' are not permitted
*%%*/

View File

@ -3,3 +3,7 @@ void func(sampler s) {}
void main() {
func(sampler(a));
}
/*%%*
cannot construct 'sampler'
*%%*/

View File

@ -2,3 +2,10 @@ in sampler a[1];
in sampler[1] b;
void fnC() { sampler c[1]; }
void fnD() { sampler[1] d; }
/*%%*
opaque type 'sampler' may not be used in an array
opaque type 'sampler' may not be used in an array
opaque type 'sampler' may not be used in an array
opaque type 'sampler' may not be used in an array
*%%*/

View File

@ -1 +1,5 @@
Bad { sampler x; };
/*%%*
variables of type 'sampler' must be global
*%%*/

View File

@ -1,3 +1,7 @@
struct Bad { sampler x; };
uniform Bad b;
void main() {}
/*%%*
opaque type 'sampler' is not permitted in a struct
*%%*/

View File

@ -1,3 +1,9 @@
void main(inout float4 color) {
color.r[ = ( color.g );
}
/*%%*
shader 'main' must be main() or main(float2)
unknown identifier 'color'
expected expression, but found '='
*%%*/

View File

@ -1,2 +1,6 @@
q { int y; };
G { int q=_; };
/*%%*
expected ';', but found '='
*%%*/

View File

@ -1 +1,5 @@
void main() { 0.5 - 0 * ~0 - half2(0) + 1; }
/*%%*
type mismatch: '-' cannot operate on 'float', 'int'
*%%*/

View File

@ -1 +1,6 @@
void main() { int i=9E7; 2+int4(i); }
/*%%*
expected 'int', but found 'float'
unknown identifier 'i'
*%%*/

View File

@ -1 +1,6 @@
void main() { sk_FragColor = float4(1) / - -half4(0); }
/*%%*
division by zero
type mismatch: '=' cannot operate on 'half4', 'float4'
*%%*/

View File

@ -2,3 +2,7 @@ float an() { return 2; }
void wna() { an(), float[1](); }
void na() { wna(); }
void main() { na(), na(); }
/*%%*
invalid arguments to 'float[1]' constructor (expected 1 elements, but found 0)
*%%*/

View File

@ -2,3 +2,8 @@ float an() { return 2; }
void wna() { an(), float[1](), float[1](); }
void na() { wna(); }
void main() { na(), na(); }
/*%%*
invalid arguments to 'float[1]' constructor (expected 1 elements, but found 0)
invalid arguments to 'float[1]' constructor (expected 1 elements, but found 0)
*%%*/

View File

@ -1,3 +1,8 @@
struct Test {
l();
void m();
/*%%*
no type named 'l'
expected a type, but found '('
*%%*/

View File

@ -2,3 +2,7 @@ void main() {
if (2 < 2) int a;
a;
}
/*%%*
variable 'a' must be created in a scope
*%%*/

View File

@ -1,3 +1,7 @@
void main() {
sk_FragColor+=(0), 1.*~2;
}
/*%%*
type mismatch: '*' cannot operate on 'float', 'int'
*%%*/

View File

@ -1,3 +1,7 @@
half n() {}
void S() { -n(); }
void l() { S(); }
/*%%*
function 'n' can exit without returning a value
*%%*/

View File

@ -1 +1,5 @@
int s[3456*3456*928*48*8*4*544*8*8*544*8*48*8*4*544*184-51488*48*544*5888*48*8*54*544*54*544*5888*48*8*54*544*54];
/*%%*
array size must be an integer
*%%*/

View File

@ -1,2 +1,7 @@
const float x=1, _=x1;
half x=x*8;
/*%%*
unknown identifier 'x1'
expected 'half', but found 'float'
*%%*/

View File

@ -1 +1,6 @@
int v=6/int2(bool2(0));
/*%%*
division by zero
expected 'int', but found 'int2'
*%%*/

View File

@ -1,2 +1,5 @@
T { int x; } f[];
void main() { sk_FragCoord; }
/*%%*
*%%*/

View File

@ -1 +1,5 @@
float a[b];
/*%%*
unknown identifier 'b'
*%%*/

View File

@ -1 +1,5 @@
float f(const float x) { 5+x; }
/*%%*
function 'f' can exit without returning a value
*%%*/

View File

@ -1 +1,3 @@
k{int z;}m[];void main(){}
/*%%*
*%%*/

View File

@ -1 +1,5 @@
void n() { for(;;exp); }
/*%%*
expected '(' to begin function call
*%%*/

Some files were not shown because too many files have changed in this diff Show More