skia2/tests/sksl/errors
John Stiles 7591d4b5ef Replace trio of XxxxLiteral types with a single Literal type.
Throughout SkSL we've begun using doubles as a convenient way to store
any SkSL value (int, float, bool) in a single type. This idea has now
been extended to literals. Rather than having three expression kinds for
integers, floats and boolean literals, we can have just one. These can
be accessed in a type-specific way (`floatValue`, `intValue`, and
`boolValue` return the expected type, or assert if it's not the
matching type), or in a type-agnostic way (`value` will return a double
and works on any type of Literal).

This allows us to remove a complex template trick (Literal<T> is gone),
removes two redundant Expression types, and and lets us reduce our code
size in ConstantFolder, FunctionCall, etc.

Most of the conversion process was pretty straightforward:
* `IntLiteral::Make` becomes `Literal::MakeInt`
* `x.is<IntLiteral>()` becomes `x.isIntLiteral()`
* `x.as<IntLiteral>.value()` becomes `x.as<Literal>.intValue()`

Change-Id: Ic328533611e4551669c7fc9d7f9c03e34699f3f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447836
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-13 17:32:34 +00:00
..
ArgumentCountMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
ArgumentMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
ArgumentModifiers.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
ArrayConstructorElementCount.glsl Reject array constructors with the wrong number of elements. 2021-02-03 22:33:02 +00:00
ArrayIndexOutOfRange.glsl Remove support for unsized arrays 2021-08-27 22:14:16 +00:00
ArrayOfInvalidSize.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
ArrayOfVoid.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
ArrayOfVoidInStruct.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
ArrayReturnTypes.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
ArraySplitDimensions.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArraySplitDimensionsInFuncBody.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArraySplitDimensionsInFuncDecl.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArraySplitDimensionsInStruct.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArrayTooManyDimensions.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
ArrayTooManyDimensionsInFuncBody.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArrayTooManyDimensionsInFuncDecl.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArrayTooManyDimensionsInStruct.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArrayTypeTooManyDimensions.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArrayTypeTooManyDimensionsInFuncBody.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
ArrayTypeTooManyDimensionsInFuncDecl.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArrayTypeTooManyDimensionsInStruct.glsl Fix assertion when arrays are double-declared. 2021-02-12 23:49:04 +00:00
ArrayUnspecifiedDimensions.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
AssignmentTypeMismatch.glsl Fix fuzzer-discovered assertion with global variables. 2021-08-27 21:38:19 +00:00
BadCaps.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
BadConstInitializers.glsl Align SkSL const rules more closely with GLSL 2021-02-26 17:44:11 +00:00
BadFieldAccess.glsl Refactored swizzle domain testing 2021-09-03 14:50:57 +00:00
BadIndex.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
BadModifiers.glsl Remove large swaths of code related to .fp files 2021-07-08 16:53:47 +00:00
BinaryInvalidType.glsl SkSL: Ensure struct declarations contain at least one member 2021-02-12 20:57:56 +00:00
BinaryTypeCoercion.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
BinaryTypeMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
BitShiftFloat.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
BitShiftFloatMatrix.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
BitShiftFloatVector.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
BooleanArithmetic.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
BreakOutsideLoop.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
CallNonFunction.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
CanExitWithoutReturningValue.glsl Improve do-while test in CanExitWithoutReturningValue. 2021-03-17 14:50:56 +00:00
ConstructorArgumentCount.glsl Add hints to slicing-constructor error messages. 2021-07-13 14:12:23 +00:00
ConstructorTypeMismatch.glsl Add hints to slicing-constructor error messages. 2021-07-13 14:12:23 +00:00
ContinueOutsideLoop.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
DivideByZero.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
DoTypeMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
DuplicateFunction.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
DuplicateOutput.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
DuplicateSymbol.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
EmptyArray.glsl Add unit test for array of zero or negative size. 2021-04-09 14:38:47 +00:00
EmptyStruct.glsl SkSL: Ensure struct declarations contain at least one member 2021-02-12 20:57:56 +00:00
ErrorsInDeadCode.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
FloatRemainder.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
ForInitStmt.glsl Simplify for init-stmts at the IR level. 2021-04-20 14:38:36 +00:00
ForTypeMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
FunctionParameterOfVoid.glsl Allow function declarations to take (void). 2021-05-21 19:21:23 +00:00
GenericArgumentMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
IfTypeMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
InterfaceBlockScope.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
InterfaceBlockStorageModifiers.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
InterfaceBlockWithNoMembers.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
IntrinsicInGlobalVariable.glsl Fix assertion when calling a built-in function at global scope. 2021-08-27 17:05:21 +00:00
InvalidAssignment.glsl Reland "Optimize away swizzles of constant variables." 2021-04-30 13:12:18 +00:00
InvalidOutParams.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
InvalidToken.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
InvalidUnary.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
InVarWithInitializerExpression.glsl Force global initializers to be constant expressions 2021-03-15 16:54:05 +00:00
LayoutInFunctions.glsl Remove (unused) geometry shader support 2021-08-27 19:41:10 +00:00
LayoutRepeatedQualifiers.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
MatrixToVectorCast3x3.glsl Add hints to slicing-constructor error messages. 2021-07-13 14:12:23 +00:00
MatrixToVectorCastBoolean.glsl Add hints to slicing-constructor error messages. 2021-07-13 14:12:23 +00:00
MatrixToVectorCastInteger.glsl Add hints to slicing-constructor error messages. 2021-07-13 14:12:23 +00:00
MatrixToVectorCastTooSmall.glsl Add hints to slicing-constructor error messages. 2021-07-13 14:12:23 +00:00
MismatchedNumbers.glsl Generate more diagnostics from IRGenerator, when given bad code. 2021-09-07 20:13:55 +00:00
ModifiersInStruct.glsl Remove custom SkVertices data and runtime effect varying support 2021-04-19 17:49:25 +00:00
NoES3ModifierInUserCode.glsl Add $es3 modifier to SkSL. 2021-08-13 14:07:40 +00:00
OpaqueTypeAssignment.glsl Fix fuzzer-discovered assertion with global variables. 2021-08-27 21:38:19 +00:00
OpaqueTypeConstruction.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
OpaqueTypeInArray.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
OpaqueTypeInInterfaceBlock.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
OpaqueTypeInStruct.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
OpenArray.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
Ossfuzz26700.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
Ossfuzz27614.glsl Fix fuzzer-discovered error with ~ prefix on literals. 2021-02-26 17:30:26 +00:00
Ossfuzz27650.glsl Generate more diagnostics from IRGenerator, when given bad code. 2021-09-07 20:13:55 +00:00
Ossfuzz27663.glsl Convert IRGenerator::convertPrefixExpr to PrefixExpression::Make. 2021-02-26 22:34:05 +00:00
Ossfuzz28050.glsl Generate more diagnostics from IRGenerator, when given bad code. 2021-09-07 20:13:55 +00:00
Ossfuzz29444.glsl Generate more diagnostics from IRGenerator, when given bad code. 2021-09-07 20:13:55 +00:00
Ossfuzz29845.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
Ossfuzz29849.glsl Fix fuzzer-discovered error with variable scoping. 2021-01-26 17:08:59 +00:00
Ossfuzz31410.glsl Fix fuzzer-discovered error with ~ prefix on literals. 2021-02-26 17:30:26 +00:00
Ossfuzz31469.glsl Detect functions that fail to return a value, without using CFG. 2021-03-04 22:47:05 +00:00
Ossfuzz32156.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
Ossfuzz32587.glsl Replace trio of XxxxLiteral types with a single Literal type. 2021-09-13 17:32:34 +00:00
Ossfuzz32851.glsl Add regression test for oss-fuzz finding. 2021-04-05 19:39:16 +00:00
Ossfuzz36850.asm.frag SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
Ossfuzz37457.glsl Fix assertion discovered by fuzzer. 2021-08-23 14:23:46 +00:00
Ossfuzz37465.glsl Fix const function-parameter assertion discovered by fuzzer. 2021-08-23 19:28:29 +00:00
Ossfuzz37469.asm.frag SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
Ossfuzz37620.glsl Report intermediate expressions as errors in For next-exprs. 2021-08-25 17:26:21 +00:00
Ossfuzz38106.glsl Fixed DSLParser crash with invalid swizzle 2021-09-10 14:29:22 +00:00
Ossfuzz38140.glsl Fixed duplicate function definition error discovered by fuzzer 2021-09-10 17:35:52 +00:00
Ossfuzz38560.glsl Fix for-statement assertion detected by the fuzzer. 2021-09-13 13:34:48 +00:00
OverflowFloatLiteral.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
OverflowInt64Literal.glsl Add test for literals that overflow int64. 2021-06-01 17:34:23 +00:00
OverflowIntLiteral.glsl Detect out-of-range integer assignment. 2021-06-01 15:53:43 +00:00
OverflowParamArraySize.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
OverflowUintLiteral.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
PrecisionQualifiersDisallowed.glsl Honor lowp/mediump/highp precision qualifiers in IRGenerator. 2021-08-04 21:29:10 +00:00
PrivateTypes.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
PrototypeInFuncBody.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
RedeclareBasicType.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
RedeclareSamplerType.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
RedeclareStruct.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
RedeclareStructTypeWithName.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
RedeclareUserType.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
RedeclareVariable.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
ReturnDifferentType.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
ReturnFromVoid.glsl Fix assertion when returning intermediate types. 2021-08-27 16:27:15 +00:00
ReturnMissingValue.glsl Detect functions that fail to return a value, without using CFG. 2021-03-04 22:47:05 +00:00
ReturnTypeMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
SelfReferentialInitializerExpression.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
SpuriousFloat.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
StaticIfTest.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
StaticSwitchConditionalBreak.glsl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
StaticSwitchTest.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
StaticSwitchWithConditionalBreak.glsl Fix switch optimization pass. 2021-02-23 15:38:24 +00:00
StaticSwitchWithConditionalContinue.glsl Fix switch optimization pass. 2021-02-23 15:38:24 +00:00
StaticSwitchWithConditionalReturn.glsl Fix switch optimization pass. 2021-02-23 15:38:24 +00:00
StructNameWithoutIdentifier.glsl Remove ASTNode::TypeData 2021-01-28 16:56:59 +00:00
StructTooDeeplyNested.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
SwitchDuplicateCase.glsl Migrate convertSwitch to SwitchStatement::Make. 2021-02-23 19:16:40 +00:00
SwitchDuplicateDefault.glsl Add test for duplicate default switch-case. 2021-02-19 20:31:50 +00:00
SwitchTypes.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
SwizzleConstantOutput.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
SwizzleDomain.glsl Enforce consistency in swizzle domains. 2021-07-09 20:30:22 +00:00
SwizzleMatrix.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
SwizzleOnlyLiterals.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
SwizzleOutOfBounds.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
SwizzleTooManyComponents.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
TernaryMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
UndeclaredFunction.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
UndefinedFunction.asm.frag Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
UndefinedFunction.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
UndefinedSymbol.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
UniformVarWithInitializerExpression.glsl Force global initializers to be constant expressions 2021-03-15 16:54:05 +00:00
UnknownDivideByZero.glsl Added detection for non-constant-folded divide by zero errors in 2021-02-06 03:13:16 +00:00
UnscopedVariableInDoWhile.glsl Fix line numbers of several DSLParser errors 2021-09-03 22:12:22 +00:00
UnscopedVariableInElse.glsl Fix fuzzer-discovered error with variable scoping. 2021-01-26 17:08:59 +00:00
UnscopedVariableInFor.glsl Disallow unscoped for blocks which declare a variable. 2021-03-04 17:04:40 +00:00
UnscopedVariableInIf.glsl Fix fuzzer-discovered error with variable scoping. 2021-01-26 17:08:59 +00:00
UnscopedVariableInWhile.glsl Fix fuzzer-discovered error with variable scoping. 2021-01-26 17:08:59 +00:00
UnsupportedGLSLIdentifiers.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
UnusedInterfaceBlock.asm.frag Fix for fuzzer-discovered error in SPIR-V compilation. 2021-04-19 15:55:04 +00:00
UsingInvalidValue.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
VectorSlice.glsl Add hints to slicing-constructor error messages. 2021-07-13 14:12:23 +00:00
VertexEarlyReturn.glsl SkSL: Turn DSL parser off again 2021-09-07 14:21:57 +00:00
WhileTypeMismatch.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00