MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / MakeModuleHavingStruct

Function MakeModuleHavingStruct

test/cpp_interface_test.cpp:189–196  ·  view source on GitHub ↗

Returns the assembly for a SPIR-V module with a struct declaration with the given number of members.

Source from the content-addressed store, hash-verified

187// Returns the assembly for a SPIR-V module with a struct declaration
188// with the given number of members.
189std::string MakeModuleHavingStruct(int num_members) {
190 std::stringstream os;
191 os << Header();
192 os << R"(%1 = OpTypeInt 32 0
193 %2 = OpTypeStruct)";
194 for (int i = 0; i < num_members; i++) os << " %1";
195 return os.str();
196}
197
198TEST(CppInterface, ValidateWithOptionsPass) {
199 SpirvTools t(SPV_ENV_UNIVERSAL_1_1);

Callers 1

TESTFunction · 0.85

Calls 2

HeaderFunction · 0.70
strMethod · 0.45

Tested by

no test coverage detected