Dejan Mircevski
c002213d95
Negative test for GroupOperation.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
9d0c813547
Negative test for LinkageType.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
d7b0f83bd1
Negative test for BuiltIn.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
10fa49cd4b
Negative test for AccessQualifier.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
212ba355a6
Negative test for FuncParamAttr.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
374616d98f
Negative test for Decoration.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
c0eb225044
Negative test for FPRoundingMode.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
355cc0c678
Negative test for FPFastMathMode.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
971b344150
Negative test for ImageFormat.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
d062f8b097
Make compilation input strings const.
...
Also rerun clang-format.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
57c4398759
Negative test for SamplerFilterMode.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
1e128260cb
Negative test for SamplerAddressingMode.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
63af6fd409
Negative test for ImageOperands.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
2fd3792c3a
Negative test for Dim.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
52ff534040
Test OpTypeForwardPointer.
2015-10-26 12:55:33 -04:00
Andrew Woloszyn
537e77663d
Added tracking to types and validated certain instructions.
...
We need to know how to generate correct SPIRV for cases like
OpConstant %int64 42 since the current parser will encode the 42 as a
32-bit value incorrectly.
This change is the first of a pair. This one tracks types, and makes
sure that OpConstant and OpSpecConstant are only ever called with
Integer or Float types, and OpSwitch is only called with integer
generating values.
2015-10-26 12:55:33 -04:00
David Neto
9db3a53897
Remove spv_opcode_flags_t and flags fields.
...
The flags fields in both spv_opcode_desc_t and spv_operand_desc_t
are redundant with the capabilities mask field in the same
structure.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
725cc2a2df
Negative test for ExecutionMode.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
865034263d
Negative test for AddressingModel, MemoryModel.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
2d6796d45d
Negative test for ExecutionModel.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
d2c81cf34a
Negative test for SourceLanguage.
...
Also, use "class" instead of "type" in the coverage CSV.
2015-10-26 12:55:33 -04:00
David Neto
f6b865110c
Accept long UTF-8 Literal Strings
2015-10-26 12:55:33 -04:00
David Neto
b5dc8fcd5d
Support strings with up to 65535 chars, and null.
...
Move the definition of spv_instruction_t to an internal
header file, since it now depends on C++ and is not
used by the external interface.
Use a std::vector<uint32_t> in spv_instruction_t
instead of a fixed size array.
2015-10-26 12:55:33 -04:00
David Neto
1b9d70a317
Test capabilities for enums sections 3.21-3.31
...
Fixes dependencies among capabilities. (The table should store
the mask of capabilites, not the capability enum.)
Remove the old spot check test for capabilities of enums.
2015-10-26 12:55:33 -04:00
David Neto
ddda85a5c5
Fix capabilities for enums in Rev32, sec 3.3-3.20
2015-10-26 12:55:33 -04:00
David Neto
3d2bf53294
Move AutoText and EnumCase into spvtest namespace
...
Also fix using declaration order.
Also put a few tests into the anonymous namespace.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
78f6a4a649
Test operand-table capabilities.
2015-10-26 12:55:33 -04:00
David Neto
e3296f0945
Add TODO for fixing endianness testing.
...
Currently it uses a union, a write to one field, and read from
another of a different type.
Moves the endianness-determining macro close to the variable
it references.
2015-10-26 12:55:33 -04:00
David Neto
287fdb0eb0
Test SPV_CAPABILITY_AS_MASK macro
2015-10-26 12:55:33 -04:00
David Neto
0cd7352d7d
Use 3-arg MakeInstruction to reduce logic in tests
...
Avoids open-coded vector inserts and two variables in various
tests. Should improve readability.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
924997dc7f
Test opcode table capability entries.
2015-10-26 12:55:33 -04:00
David Neto
ff5dce48a1
Add assembler test for OpEnqueueKernel.
...
Adds a form of spvtest::MakeInstruction which takes two vectors
of operands. That leads to simpler test code.
We can clean up some other test code, in another CL.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
114206e0bc
Clarify !<integer> parsing.
...
Implement some outstanding feedback from
Ic29c5a4a8178a62a5a1acad13d02f19cc1307097:
- use "token" instead of "word" when referring to assembly text
- specify how the numbers are parsed
Add a test for negative numbers.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
14c4b10d44
Detect overflow in !<integer>.
2015-10-26 12:55:33 -04:00
David Neto
8bed0cea13
Add a .csv showing test coverage for operand class
...
It shows which spv::OperandClass values are used in
the syntax table in source/opcode.inc, and what tests
exercise those operand types.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
897bff924a
Simplify (and test) the alternate-parsing pattern.
2015-10-26 12:55:33 -04:00
David Neto
42bfd4bfab
Assembly test for OpSwitch
...
Removes old weak and fragile tests for OpSwitch.
Adds spvtest::TextToBinaryTest::CompileWithFormatFailure
2015-10-26 12:55:33 -04:00
David Neto
e77a7dd821
Assembly failure cases for OpMemoryBarrier
...
Fully tests OperandMemorySemantics from the syntax table.
2015-10-26 12:55:33 -04:00
David Neto
cb3db4327d
Assembler failing cases for OpCapability
2015-10-26 12:55:33 -04:00
Andrew Woloszyn
71fc05587b
Refactored dynamic and static state out of text processing.
...
This reduces the number of arguments required to be passed
to every single function. This is in preparation for adding
id tracking.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
903f9d6b70
Implement alternate-parsing mode for !<integer>.
2015-10-26 12:55:33 -04:00
David Neto
c348d18486
Test bad 2nd target to OpGroupMemberDecorate
2015-10-26 12:55:33 -04:00
David Neto
454f51fa4d
Assembly test for OpGroupMemberDecorate
...
Provides test coverage for OperandVariableIdLiteral
from the syntax table in the file 'opcode.inc'.
2015-10-26 12:55:33 -04:00
Dejan Mircevski
1b6f1960a8
Uncomment some !<integer> tests.
2015-10-26 12:55:33 -04:00
David Neto
d83179af7e
Cleanup: Use EnumCase in OpDecorateSimpleTest
2015-10-26 12:55:33 -04:00
David Neto
ab778dc1dc
Cleanup: Use EnumCase for ExecutionMode test
2015-10-26 12:55:33 -04:00
David Neto
54b2ea1088
Assembler test for optional operands of OpSource
...
These are the first tests to cover OperandOptionalId
and OperandOptionalLiteralString from the grammar in
opcode.inc
2015-10-26 12:55:33 -04:00
David Neto
f1b6471670
Dissasembler test showing reordering of masks
2015-10-26 12:55:33 -04:00
David Neto
b14a727a30
Execution scope, memory semantics operands are IDs
...
They shouldn't be parsed or printed as masks.
2015-10-26 12:55:33 -04:00
David Neto
619db2612e
Disassembler support for mask expressions.
2015-10-26 12:55:33 -04:00