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

Function TEST

test/diff/diff_files/constant_array_size_autogen.cpp:123–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121)";
122
123TEST(DiffTest, ConstantArraySize) {
124 constexpr char kDiff[] = R"( ; SPIR-V
125 ; Version: 1.6
126 ; Generator: Khronos SPIR-V Tools Assembler; 0
127-; Bound: 27
128+; Bound: 28
129 ; Schema: 0
130 OpCapability Shader
131 OpMemoryModel Logical GLSL450
132 OpEntryPoint Vertex %22 "main" %4 %19
133 OpSource GLSL 450
134 OpName %4 "_ua_position"
135 OpName %17 "gl_PerVertex"
136 OpMemberName %17 0 "gl_Position"
137 OpMemberName %17 1 "gl_PointSize"
138 OpMemberName %17 2 "gl_ClipDistance"
139 OpMemberName %17 3 "gl_CullDistance"
140 OpName %19 ""
141 OpName %22 "main"
142 OpDecorate %4 Location 0
143 OpMemberDecorate %17 1 RelaxedPrecision
144 OpMemberDecorate %17 0 BuiltIn Position
145 OpMemberDecorate %17 1 BuiltIn PointSize
146 OpMemberDecorate %17 2 BuiltIn ClipDistance
147 OpMemberDecorate %17 3 BuiltIn CullDistance
148 OpDecorate %17 Block
149 %1 = OpTypeFloat 32
150 %2 = OpTypeVector %1 4
151 %5 = OpTypeInt 32 0
152+%27 = OpTypeInt 32 1
153 %8 = OpTypeVector %5 4
154-%15 = OpConstant %5 8
155+%15 = OpConstant %27 8
156 %16 = OpTypeArray %1 %15
157 %17 = OpTypeStruct %2 %1 %16 %16
158 %20 = OpTypeVoid
159 %25 = OpConstant %5 0
160 %3 = OpTypePointer Input %2
161 %13 = OpTypePointer Output %2
162 %18 = OpTypePointer Output %17
163 %21 = OpTypeFunction %20
164 %4 = OpVariable %3 Input
165 %19 = OpVariable %18 Output
166 %22 = OpFunction %20 None %21
167 %23 = OpLabel
168 %24 = OpLoad %2 %4
169 %26 = OpAccessChain %13 %19 %25
170 OpStore %26 %24
171 OpReturn
172 OpFunctionEnd
173)";
174 Options options;
175 DoStringDiffTest(kSrc, kDst, kDiff, options);
176}
177
178TEST(DiffTest, ConstantArraySizeNoDebug) {
179 constexpr char kSrcNoDebug[] = R"(; SPIR-V

Callers

nothing calls this directly

Calls 1

DoStringDiffTestFunction · 0.85

Tested by

no test coverage detected