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

Function TEST_F

test/opt/wrap_opkill_test.cpp:25–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using WrapOpKillTest = PassTest<::testing::Test>;
24
25TEST_F(WrapOpKillTest, SingleOpKill) {
26 const std::string text = R"(
27; CHECK: OpEntryPoint Fragment [[main:%\w+]]
28; CHECK: [[main]] = OpFunction
29; CHECK: OpFunctionCall %void [[orig_kill:%\w+]]
30; CHECK: [[orig_kill]] = OpFunction
31; CHECK-NEXT: OpLabel
32; CHECK-NEXT: OpFunctionCall %void [[new_kill:%\w+]]
33; CHECK-NEXT: OpReturn
34; CHECK: [[new_kill]] = OpFunction
35; CHECK-NEXT: OpLabel
36; CHECK-NEXT: OpKill
37; CHECK-NEXT: OpFunctionEnd
38 OpCapability Shader
39 %1 = OpExtInstImport "GLSL.std.450"
40 OpMemoryModel Logical GLSL450
41 OpEntryPoint Fragment %main "main"
42 OpExecutionMode %main OriginUpperLeft
43 OpSource GLSL 330
44 OpName %main "main"
45 %void = OpTypeVoid
46 %5 = OpTypeFunction %void
47 %bool = OpTypeBool
48 %true = OpConstantTrue %bool
49 %main = OpFunction %void None %5
50 %8 = OpLabel
51 OpBranch %9
52 %9 = OpLabel
53 OpLoopMerge %10 %11 None
54 OpBranch %12
55 %12 = OpLabel
56 OpBranchConditional %true %13 %10
57 %13 = OpLabel
58 OpBranch %11
59 %11 = OpLabel
60 %14 = OpFunctionCall %void %kill_
61 OpBranch %9
62 %10 = OpLabel
63 OpReturn
64 OpFunctionEnd
65 %kill_ = OpFunction %void None %5
66 %15 = OpLabel
67 OpKill
68 OpFunctionEnd
69 )";
70
71 SinglePassRunAndMatch<WrapOpKill>(text, true);
72}
73
74TEST_F(WrapOpKillTest, MultipleOpKillInSameFunc) {
75 const std::string text = R"(

Callers

nothing calls this directly

Calls 1

GetTestMessageConsumerFunction · 0.85

Tested by

no test coverage detected