Returns the assembly for a SPIR-V module with a struct declaration with the given number of members.
| 187 | // Returns the assembly for a SPIR-V module with a struct declaration |
| 188 | // with the given number of members. |
| 189 | std::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 | |
| 198 | TEST(CppInterface, ValidateWithOptionsPass) { |
| 199 | SpirvTools t(SPV_ENV_UNIVERSAL_1_1); |