Test operator overloads for SPIR-V C++ mask enums (#5021)

Updates SPIRV-Headers in DEPS
This commit is contained in:
David Neto 2022-12-16 11:17:39 -05:00 committed by GitHub
parent 5a78d798f7
commit cc81529f4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 1 deletions

2
DEPS
View File

@ -6,7 +6,7 @@ vars = {
'effcee_revision': '35912e1b7778ec2ddcff7e7188177761539e59e0', 'effcee_revision': '35912e1b7778ec2ddcff7e7188177761539e59e0',
'googletest_revision': 'd9bb8412d60b993365abb53f00b6dad9b2c01b62', 'googletest_revision': 'd9bb8412d60b993365abb53f00b6dad9b2c01b62',
're2_revision': 'd2836d1b1c34c4e330a85a1006201db474bf2c8a', 're2_revision': 'd2836d1b1c34c4e330a85a1006201db474bf2c8a',
'spirv_headers_revision': '1d31a100405cf8783ca7a31e31cdd727c9fc54c3', 'spirv_headers_revision': '34d04647d384e0aed037e7a2662a655fc39841bb',
} }
deps = { deps = {

View File

@ -322,6 +322,36 @@ TEST(CppInterface, OptimizeSameAddressForOriginalOptimizedBinary) {
EXPECT_EQ(Header(), optimized_text); EXPECT_EQ(Header(), optimized_text);
} }
TEST(SpirvHeadersCpp, BitwiseOrMemoryAccessMask) {
EXPECT_EQ(spv::MemoryAccessMask(6), spv::MemoryAccessMask::Aligned |
spv::MemoryAccessMask::Nontemporal);
}
TEST(SpirvHeadersCpp, BitwiseAndMemoryAccessMask) {
EXPECT_EQ(spv::MemoryAccessMask::Aligned,
spv::MemoryAccessMask::Aligned & spv::MemoryAccessMask(6));
EXPECT_EQ(spv::MemoryAccessMask::Nontemporal,
spv::MemoryAccessMask::Nontemporal & spv::MemoryAccessMask(6));
EXPECT_EQ(spv::MemoryAccessMask(0), spv::MemoryAccessMask::Nontemporal &
spv::MemoryAccessMask::Aligned);
}
TEST(SpirvHeadersCpp, BitwiseXorMemoryAccessMask) {
EXPECT_EQ(spv::MemoryAccessMask::Nontemporal,
spv::MemoryAccessMask::Aligned ^ spv::MemoryAccessMask(6));
EXPECT_EQ(spv::MemoryAccessMask::Aligned,
spv::MemoryAccessMask::Nontemporal ^ spv::MemoryAccessMask(6));
EXPECT_EQ(spv::MemoryAccessMask(6), spv::MemoryAccessMask::Nontemporal ^
spv::MemoryAccessMask::Aligned);
EXPECT_EQ(spv::MemoryAccessMask(0), spv::MemoryAccessMask::Nontemporal ^
spv::MemoryAccessMask::Nontemporal);
}
TEST(SpirvHeadersCpp, BitwiseNegateMemoryAccessMask) {
EXPECT_EQ(spv::MemoryAccessMask(~(uint32_t(4))),
~spv::MemoryAccessMask::Nontemporal);
}
// TODO(antiagainst): tests for SetMessageConsumer(). // TODO(antiagainst): tests for SetMessageConsumer().
} // namespace } // namespace