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

Function TEST

test/opt/optimizer_test.cpp:40–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40TEST(Optimizer, CanRunNullPassWithDistinctInputOutputVectors) {
41 SpirvTools tools(SPV_ENV_UNIVERSAL_1_0);
42 std::vector<uint32_t> binary_in;
43 tools.Assemble(Header() + "OpName %foo \"foo\"\n%foo = OpTypeVoid",
44 &binary_in);
45
46 Optimizer opt(SPV_ENV_UNIVERSAL_1_0);
47 opt.RegisterPass(CreateNullPass());
48 std::vector<uint32_t> binary_out;
49 opt.Run(binary_in.data(), binary_in.size(), &binary_out);
50
51 std::string disassembly;
52 tools.Disassemble(binary_out.data(), binary_out.size(), &disassembly);
53 EXPECT_THAT(disassembly,
54 Eq(Header() + "OpName %foo \"foo\"\n%foo = OpTypeVoid\n"));
55}
56
57TEST(Optimizer, CanRunTransformingPassWithDistinctInputOutputVectors) {
58 SpirvTools tools(SPV_ENV_UNIVERSAL_1_0);

Callers

nothing calls this directly

Calls 15

CreateNullPassFunction · 0.85
CreateStripDebugInfoPassFunction · 0.85
CreateAggressiveDCEPassFunction · 0.85
FlagHasValidFormMethod · 0.80
RegisterPassFromFlagMethod · 0.80
HeaderFunction · 0.70
AssembleMethod · 0.45
RunMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected