mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-22 11:40:05 +00:00
Assembly failure cases for OpMemoryBarrier
Fully tests OperandMemorySemantics from the syntax table.
This commit is contained in:
parent
cb3db4327d
commit
e77a7dd821
@ -42,13 +42,37 @@ using ::testing::Eq;
|
||||
|
||||
using OpMemoryBarrier = spvtest::TextToBinaryTest;
|
||||
|
||||
TEST_F(OpMemoryBarrier, Sample) {
|
||||
TEST_F(OpMemoryBarrier, Good) {
|
||||
std::string input = "OpMemoryBarrier %1 %2\n";
|
||||
EXPECT_THAT(CompiledInstructions(input),
|
||||
Eq(MakeInstruction(spv::OpMemoryBarrier, {1, 2})));
|
||||
EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input));
|
||||
}
|
||||
|
||||
TEST_F(OpMemoryBarrier, BadMissingScopeId) {
|
||||
std::string input = "OpMemoryBarrier\n";
|
||||
EXPECT_THAT(CompileFailure(input),
|
||||
Eq("Expected operand, found end of stream."));
|
||||
}
|
||||
|
||||
TEST_F(OpMemoryBarrier, BadInvalidScopeId) {
|
||||
std::string input = "OpMemoryBarrier 99\n";
|
||||
EXPECT_THAT(CompileFailure(input),
|
||||
Eq("Expected id to start with %."));
|
||||
}
|
||||
|
||||
TEST_F(OpMemoryBarrier, BadMissingMemorySemanticsId) {
|
||||
std::string input = "OpMemoryBarrier %scope\n";
|
||||
EXPECT_THAT(CompileFailure(input),
|
||||
Eq("Expected operand, found end of stream."));
|
||||
}
|
||||
|
||||
TEST_F(OpMemoryBarrier, BadInvalidMemorySemanticsId) {
|
||||
std::string input = "OpMemoryBarrier %scope 14\n";
|
||||
EXPECT_THAT(CompileFailure(input),
|
||||
Eq("Expected id to start with %."));
|
||||
}
|
||||
|
||||
// TODO(dneto): OpControlBarrier
|
||||
// TODO(dneto): OpAsyncGroupCopy
|
||||
// TODO(dneto): OpWaitGroupEvents
|
||||
|
Loading…
Reference in New Issue
Block a user