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

Function TEST_P

test/opt/fold_test.cpp:188–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 ::testing::TestWithParam<InstructionFoldingCase<uint32_t>>;
187
188TEST_P(IntegerInstructionFoldingTest, Case) {
189 const auto& tc = GetParam();
190
191 std::unique_ptr<IRContext> context;
192 Instruction* inst;
193 std::tie(context, inst) =
194 FoldInstruction(tc.test_body, tc.id_to_fold, SPV_ENV_UNIVERSAL_1_1);
195 CheckForExpectedScalarConstant(
196 inst, tc.expected_result, [](const analysis::Constant* c) {
197 return c->AsScalarConstant()->GetU32BitValue();
198 });
199}
200
201// Returns a common SPIR-V header for all of the test that follow.
202#define INT_0_ID 100

Callers

nothing calls this directly

Calls 15

FoldInstructionFunction · 0.85
GetInstructionToFoldFunction · 0.85
GetU32BitValueMethod · 0.80
GetU64BitValueMethod · 0.80
GetU32Method · 0.80
GetS32Method · 0.80
GetU64Method · 0.80
GetDoubleMethod · 0.80
GetFloatMethod · 0.80

Tested by

no test coverage detected