1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_tests.py
3 //
4 // Copyright (c) 2022 Google LLC.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 //
10 // http://www.apache.org/licenses/LICENSE-2.0
11 //
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
17
18 #include "../diff_test_utils.h"
19
20 #include "gtest/gtest.h"
21
22 namespace spvtools {
23 namespace diff {
24 namespace {
25
26 // Test where src and dst have the true and false blocks of an if reordered.
27 constexpr char kSrc[] = R"( OpCapability Shader
28 %1 = OpExtInstImport "GLSL.std.450"
29 OpMemoryModel Logical GLSL450
30 OpEntryPoint Fragment %4 "main" %8 %44
31 OpExecutionMode %4 OriginUpperLeft
32 OpSource ESSL 310
33 OpName %4 "main"
34 OpName %8 "v"
35 OpName %44 "color"
36 OpDecorate %8 RelaxedPrecision
37 OpDecorate %8 Location 0
38 OpDecorate %9 RelaxedPrecision
39 OpDecorate %18 RelaxedPrecision
40 OpDecorate %19 RelaxedPrecision
41 OpDecorate %20 RelaxedPrecision
42 OpDecorate %23 RelaxedPrecision
43 OpDecorate %24 RelaxedPrecision
44 OpDecorate %25 RelaxedPrecision
45 OpDecorate %26 RelaxedPrecision
46 OpDecorate %27 RelaxedPrecision
47 OpDecorate %28 RelaxedPrecision
48 OpDecorate %29 RelaxedPrecision
49 OpDecorate %30 RelaxedPrecision
50 OpDecorate %31 RelaxedPrecision
51 OpDecorate %33 RelaxedPrecision
52 OpDecorate %34 RelaxedPrecision
53 OpDecorate %35 RelaxedPrecision
54 OpDecorate %36 RelaxedPrecision
55 OpDecorate %37 RelaxedPrecision
56 OpDecorate %39 RelaxedPrecision
57 OpDecorate %40 RelaxedPrecision
58 OpDecorate %41 RelaxedPrecision
59 OpDecorate %42 RelaxedPrecision
60 OpDecorate %44 RelaxedPrecision
61 OpDecorate %44 Location 0
62 OpDecorate %45 RelaxedPrecision
63 %2 = OpTypeVoid
64 %3 = OpTypeFunction %2
65 %6 = OpTypeFloat 32
66 %7 = OpTypePointer Input %6
67 %8 = OpVariable %7 Input
68 %10 = OpConstant %6 0
69 %11 = OpTypeBool
70 %15 = OpTypeVector %6 4
71 %16 = OpTypePointer Function %15
72 %21 = OpConstant %6 -0.5
73 %22 = OpConstant %6 -0.300000012
74 %38 = OpConstant %6 0.5
75 %43 = OpTypePointer Output %15
76 %44 = OpVariable %43 Output
77 %4 = OpFunction %2 None %3
78 %5 = OpLabel
79 %9 = OpLoad %6 %8
80 %12 = OpFOrdLessThanEqual %11 %9 %10
81 OpSelectionMerge %14 None
82 OpBranchConditional %12 %13 %32
83 %13 = OpLabel
84 %18 = OpLoad %6 %8
85 %19 = OpExtInst %6 %1 Log %18
86 %20 = OpLoad %6 %8
87 %23 = OpExtInst %6 %1 FClamp %20 %21 %22
88 %24 = OpFMul %6 %19 %23
89 %25 = OpLoad %6 %8
90 %26 = OpExtInst %6 %1 Sin %25
91 %27 = OpLoad %6 %8
92 %28 = OpExtInst %6 %1 Cos %27
93 %29 = OpLoad %6 %8
94 %30 = OpExtInst %6 %1 Exp %29
95 %31 = OpCompositeConstruct %15 %24 %26 %28 %30
96 OpBranch %14
97 %32 = OpLabel
98 %33 = OpLoad %6 %8
99 %34 = OpExtInst %6 %1 Sqrt %33
100 %35 = OpLoad %6 %8
101 %36 = OpExtInst %6 %1 FSign %35
102 %37 = OpLoad %6 %8
103 %39 = OpExtInst %6 %1 FMax %37 %38
104 %40 = OpLoad %6 %8
105 %41 = OpExtInst %6 %1 Floor %40
106 %42 = OpCompositeConstruct %15 %34 %36 %39 %41
107 OpBranch %14
108 %14 = OpLabel
109 %45 = OpPhi %15 %31 %13 %42 %32
110 OpStore %44 %45
111 OpReturn
112 OpFunctionEnd)";
113 constexpr char kDst[] = R"( OpCapability Shader
114 %1 = OpExtInstImport "GLSL.std.450"
115 OpMemoryModel Logical GLSL450
116 OpEntryPoint Fragment %4 "main" %8 %44
117 OpExecutionMode %4 OriginUpperLeft
118 OpSource ESSL 310
119 OpName %4 "main"
120 OpName %8 "v"
121 OpName %44 "color"
122 OpDecorate %8 RelaxedPrecision
123 OpDecorate %8 Location 0
124 OpDecorate %9 RelaxedPrecision
125 OpDecorate %18 RelaxedPrecision
126 OpDecorate %19 RelaxedPrecision
127 OpDecorate %20 RelaxedPrecision
128 OpDecorate %21 RelaxedPrecision
129 OpDecorate %22 RelaxedPrecision
130 OpDecorate %24 RelaxedPrecision
131 OpDecorate %25 RelaxedPrecision
132 OpDecorate %26 RelaxedPrecision
133 OpDecorate %27 RelaxedPrecision
134 OpDecorate %29 RelaxedPrecision
135 OpDecorate %30 RelaxedPrecision
136 OpDecorate %31 RelaxedPrecision
137 OpDecorate %34 RelaxedPrecision
138 OpDecorate %35 RelaxedPrecision
139 OpDecorate %36 RelaxedPrecision
140 OpDecorate %37 RelaxedPrecision
141 OpDecorate %38 RelaxedPrecision
142 OpDecorate %39 RelaxedPrecision
143 OpDecorate %40 RelaxedPrecision
144 OpDecorate %41 RelaxedPrecision
145 OpDecorate %42 RelaxedPrecision
146 OpDecorate %44 RelaxedPrecision
147 OpDecorate %44 Location 0
148 OpDecorate %45 RelaxedPrecision
149 %2 = OpTypeVoid
150 %3 = OpTypeFunction %2
151 %6 = OpTypeFloat 32
152 %7 = OpTypePointer Input %6
153 %8 = OpVariable %7 Input
154 %10 = OpConstant %6 0
155 %11 = OpTypeBool
156 %15 = OpTypeVector %6 4
157 %16 = OpTypePointer Function %15
158 %23 = OpConstant %6 0.5
159 %32 = OpConstant %6 -0.5
160 %33 = OpConstant %6 -0.300000012
161 %43 = OpTypePointer Output %15
162 %44 = OpVariable %43 Output
163 %4 = OpFunction %2 None %3
164 %5 = OpLabel
165 %9 = OpLoad %6 %8
166 %12 = OpFOrdLessThanEqual %11 %9 %10
167 OpSelectionMerge %14 None
168 OpBranchConditional %12 %28 %13
169 %13 = OpLabel
170 %18 = OpLoad %6 %8
171 %19 = OpExtInst %6 %1 Sqrt %18
172 %20 = OpLoad %6 %8
173 %21 = OpExtInst %6 %1 FSign %20
174 %22 = OpLoad %6 %8
175 %24 = OpExtInst %6 %1 FMax %22 %23
176 %25 = OpLoad %6 %8
177 %26 = OpExtInst %6 %1 Floor %25
178 %27 = OpCompositeConstruct %15 %19 %21 %24 %26
179 OpBranch %14
180 %28 = OpLabel
181 %29 = OpLoad %6 %8
182 %30 = OpExtInst %6 %1 Log %29
183 %31 = OpLoad %6 %8
184 %34 = OpExtInst %6 %1 FClamp %31 %32 %33
185 %35 = OpFMul %6 %30 %34
186 %36 = OpLoad %6 %8
187 %37 = OpExtInst %6 %1 Sin %36
188 %38 = OpLoad %6 %8
189 %39 = OpExtInst %6 %1 Cos %38
190 %40 = OpLoad %6 %8
191 %41 = OpExtInst %6 %1 Exp %40
192 %42 = OpCompositeConstruct %15 %35 %37 %39 %41
193 OpBranch %14
194 %14 = OpLabel
195 %45 = OpPhi %15 %27 %13 %42 %28
196 OpStore %44 %45
197 OpReturn
198 OpFunctionEnd
199
200 )";
201
TEST(DiffTest,ReorderedIfBlocks)202 TEST(DiffTest, ReorderedIfBlocks) {
203 constexpr char kDiff[] = R"( ; SPIR-V
204 ; Version: 1.6
205 ; Generator: Khronos SPIR-V Tools Assembler; 0
206 ; Bound: 46
207 ; Schema: 0
208 OpCapability Shader
209 %1 = OpExtInstImport "GLSL.std.450"
210 OpMemoryModel Logical GLSL450
211 OpEntryPoint Fragment %4 "main" %8 %44
212 OpExecutionMode %4 OriginUpperLeft
213 OpSource ESSL 310
214 OpName %4 "main"
215 OpName %8 "v"
216 OpName %44 "color"
217 OpDecorate %8 RelaxedPrecision
218 OpDecorate %8 Location 0
219 OpDecorate %9 RelaxedPrecision
220 OpDecorate %18 RelaxedPrecision
221 OpDecorate %19 RelaxedPrecision
222 OpDecorate %20 RelaxedPrecision
223 OpDecorate %23 RelaxedPrecision
224 OpDecorate %24 RelaxedPrecision
225 OpDecorate %25 RelaxedPrecision
226 OpDecorate %26 RelaxedPrecision
227 OpDecorate %27 RelaxedPrecision
228 OpDecorate %28 RelaxedPrecision
229 OpDecorate %29 RelaxedPrecision
230 OpDecorate %30 RelaxedPrecision
231 OpDecorate %31 RelaxedPrecision
232 OpDecorate %33 RelaxedPrecision
233 OpDecorate %34 RelaxedPrecision
234 OpDecorate %35 RelaxedPrecision
235 OpDecorate %36 RelaxedPrecision
236 OpDecorate %37 RelaxedPrecision
237 OpDecorate %39 RelaxedPrecision
238 OpDecorate %40 RelaxedPrecision
239 OpDecorate %41 RelaxedPrecision
240 OpDecorate %42 RelaxedPrecision
241 OpDecorate %44 RelaxedPrecision
242 OpDecorate %44 Location 0
243 OpDecorate %45 RelaxedPrecision
244 %2 = OpTypeVoid
245 %3 = OpTypeFunction %2
246 %6 = OpTypeFloat 32
247 %7 = OpTypePointer Input %6
248 %8 = OpVariable %7 Input
249 %10 = OpConstant %6 0
250 %11 = OpTypeBool
251 %15 = OpTypeVector %6 4
252 %16 = OpTypePointer Function %15
253 %21 = OpConstant %6 -0.5
254 %22 = OpConstant %6 -0.300000012
255 %38 = OpConstant %6 0.5
256 %43 = OpTypePointer Output %15
257 %44 = OpVariable %43 Output
258 %4 = OpFunction %2 None %3
259 %5 = OpLabel
260 %9 = OpLoad %6 %8
261 %12 = OpFOrdLessThanEqual %11 %9 %10
262 OpSelectionMerge %14 None
263 OpBranchConditional %12 %13 %32
264 %32 = OpLabel
265 %33 = OpLoad %6 %8
266 %34 = OpExtInst %6 %1 Sqrt %33
267 %35 = OpLoad %6 %8
268 %36 = OpExtInst %6 %1 FSign %35
269 %37 = OpLoad %6 %8
270 %39 = OpExtInst %6 %1 FMax %37 %38
271 %40 = OpLoad %6 %8
272 %41 = OpExtInst %6 %1 Floor %40
273 %42 = OpCompositeConstruct %15 %34 %36 %39 %41
274 OpBranch %14
275 %13 = OpLabel
276 %18 = OpLoad %6 %8
277 %19 = OpExtInst %6 %1 Log %18
278 %20 = OpLoad %6 %8
279 %23 = OpExtInst %6 %1 FClamp %20 %21 %22
280 %24 = OpFMul %6 %19 %23
281 %25 = OpLoad %6 %8
282 %26 = OpExtInst %6 %1 Sin %25
283 %27 = OpLoad %6 %8
284 %28 = OpExtInst %6 %1 Cos %27
285 %29 = OpLoad %6 %8
286 %30 = OpExtInst %6 %1 Exp %29
287 %31 = OpCompositeConstruct %15 %24 %26 %28 %30
288 OpBranch %14
289 %14 = OpLabel
290 -%45 = OpPhi %15 %31 %13 %42 %32
291 +%45 = OpPhi %15 %42 %32 %31 %13
292 OpStore %44 %45
293 OpReturn
294 OpFunctionEnd
295 )";
296 Options options;
297 DoStringDiffTest(kSrc, kDst, kDiff, options);
298 }
299
TEST(DiffTest,ReorderedIfBlocksNoDebug)300 TEST(DiffTest, ReorderedIfBlocksNoDebug) {
301 constexpr char kSrcNoDebug[] = R"( OpCapability Shader
302 %1 = OpExtInstImport "GLSL.std.450"
303 OpMemoryModel Logical GLSL450
304 OpEntryPoint Fragment %4 "main" %8 %44
305 OpExecutionMode %4 OriginUpperLeft
306 OpSource ESSL 310
307 OpDecorate %8 RelaxedPrecision
308 OpDecorate %8 Location 0
309 OpDecorate %9 RelaxedPrecision
310 OpDecorate %18 RelaxedPrecision
311 OpDecorate %19 RelaxedPrecision
312 OpDecorate %20 RelaxedPrecision
313 OpDecorate %23 RelaxedPrecision
314 OpDecorate %24 RelaxedPrecision
315 OpDecorate %25 RelaxedPrecision
316 OpDecorate %26 RelaxedPrecision
317 OpDecorate %27 RelaxedPrecision
318 OpDecorate %28 RelaxedPrecision
319 OpDecorate %29 RelaxedPrecision
320 OpDecorate %30 RelaxedPrecision
321 OpDecorate %31 RelaxedPrecision
322 OpDecorate %33 RelaxedPrecision
323 OpDecorate %34 RelaxedPrecision
324 OpDecorate %35 RelaxedPrecision
325 OpDecorate %36 RelaxedPrecision
326 OpDecorate %37 RelaxedPrecision
327 OpDecorate %39 RelaxedPrecision
328 OpDecorate %40 RelaxedPrecision
329 OpDecorate %41 RelaxedPrecision
330 OpDecorate %42 RelaxedPrecision
331 OpDecorate %44 RelaxedPrecision
332 OpDecorate %44 Location 0
333 OpDecorate %45 RelaxedPrecision
334 %2 = OpTypeVoid
335 %3 = OpTypeFunction %2
336 %6 = OpTypeFloat 32
337 %7 = OpTypePointer Input %6
338 %8 = OpVariable %7 Input
339 %10 = OpConstant %6 0
340 %11 = OpTypeBool
341 %15 = OpTypeVector %6 4
342 %16 = OpTypePointer Function %15
343 %21 = OpConstant %6 -0.5
344 %22 = OpConstant %6 -0.300000012
345 %38 = OpConstant %6 0.5
346 %43 = OpTypePointer Output %15
347 %44 = OpVariable %43 Output
348 %4 = OpFunction %2 None %3
349 %5 = OpLabel
350 %9 = OpLoad %6 %8
351 %12 = OpFOrdLessThanEqual %11 %9 %10
352 OpSelectionMerge %14 None
353 OpBranchConditional %12 %13 %32
354 %13 = OpLabel
355 %18 = OpLoad %6 %8
356 %19 = OpExtInst %6 %1 Log %18
357 %20 = OpLoad %6 %8
358 %23 = OpExtInst %6 %1 FClamp %20 %21 %22
359 %24 = OpFMul %6 %19 %23
360 %25 = OpLoad %6 %8
361 %26 = OpExtInst %6 %1 Sin %25
362 %27 = OpLoad %6 %8
363 %28 = OpExtInst %6 %1 Cos %27
364 %29 = OpLoad %6 %8
365 %30 = OpExtInst %6 %1 Exp %29
366 %31 = OpCompositeConstruct %15 %24 %26 %28 %30
367 OpBranch %14
368 %32 = OpLabel
369 %33 = OpLoad %6 %8
370 %34 = OpExtInst %6 %1 Sqrt %33
371 %35 = OpLoad %6 %8
372 %36 = OpExtInst %6 %1 FSign %35
373 %37 = OpLoad %6 %8
374 %39 = OpExtInst %6 %1 FMax %37 %38
375 %40 = OpLoad %6 %8
376 %41 = OpExtInst %6 %1 Floor %40
377 %42 = OpCompositeConstruct %15 %34 %36 %39 %41
378 OpBranch %14
379 %14 = OpLabel
380 %45 = OpPhi %15 %31 %13 %42 %32
381 OpStore %44 %45
382 OpReturn
383 OpFunctionEnd
384 )";
385 constexpr char kDstNoDebug[] = R"( OpCapability Shader
386 %1 = OpExtInstImport "GLSL.std.450"
387 OpMemoryModel Logical GLSL450
388 OpEntryPoint Fragment %4 "main" %8 %44
389 OpExecutionMode %4 OriginUpperLeft
390 OpSource ESSL 310
391 OpDecorate %8 RelaxedPrecision
392 OpDecorate %8 Location 0
393 OpDecorate %9 RelaxedPrecision
394 OpDecorate %18 RelaxedPrecision
395 OpDecorate %19 RelaxedPrecision
396 OpDecorate %20 RelaxedPrecision
397 OpDecorate %21 RelaxedPrecision
398 OpDecorate %22 RelaxedPrecision
399 OpDecorate %24 RelaxedPrecision
400 OpDecorate %25 RelaxedPrecision
401 OpDecorate %26 RelaxedPrecision
402 OpDecorate %27 RelaxedPrecision
403 OpDecorate %29 RelaxedPrecision
404 OpDecorate %30 RelaxedPrecision
405 OpDecorate %31 RelaxedPrecision
406 OpDecorate %34 RelaxedPrecision
407 OpDecorate %35 RelaxedPrecision
408 OpDecorate %36 RelaxedPrecision
409 OpDecorate %37 RelaxedPrecision
410 OpDecorate %38 RelaxedPrecision
411 OpDecorate %39 RelaxedPrecision
412 OpDecorate %40 RelaxedPrecision
413 OpDecorate %41 RelaxedPrecision
414 OpDecorate %42 RelaxedPrecision
415 OpDecorate %44 RelaxedPrecision
416 OpDecorate %44 Location 0
417 OpDecorate %45 RelaxedPrecision
418 %2 = OpTypeVoid
419 %3 = OpTypeFunction %2
420 %6 = OpTypeFloat 32
421 %7 = OpTypePointer Input %6
422 %8 = OpVariable %7 Input
423 %10 = OpConstant %6 0
424 %11 = OpTypeBool
425 %15 = OpTypeVector %6 4
426 %16 = OpTypePointer Function %15
427 %23 = OpConstant %6 0.5
428 %32 = OpConstant %6 -0.5
429 %33 = OpConstant %6 -0.300000012
430 %43 = OpTypePointer Output %15
431 %44 = OpVariable %43 Output
432 %4 = OpFunction %2 None %3
433 %5 = OpLabel
434 %9 = OpLoad %6 %8
435 %12 = OpFOrdLessThanEqual %11 %9 %10
436 OpSelectionMerge %14 None
437 OpBranchConditional %12 %28 %13
438 %13 = OpLabel
439 %18 = OpLoad %6 %8
440 %19 = OpExtInst %6 %1 Sqrt %18
441 %20 = OpLoad %6 %8
442 %21 = OpExtInst %6 %1 FSign %20
443 %22 = OpLoad %6 %8
444 %24 = OpExtInst %6 %1 FMax %22 %23
445 %25 = OpLoad %6 %8
446 %26 = OpExtInst %6 %1 Floor %25
447 %27 = OpCompositeConstruct %15 %19 %21 %24 %26
448 OpBranch %14
449 %28 = OpLabel
450 %29 = OpLoad %6 %8
451 %30 = OpExtInst %6 %1 Log %29
452 %31 = OpLoad %6 %8
453 %34 = OpExtInst %6 %1 FClamp %31 %32 %33
454 %35 = OpFMul %6 %30 %34
455 %36 = OpLoad %6 %8
456 %37 = OpExtInst %6 %1 Sin %36
457 %38 = OpLoad %6 %8
458 %39 = OpExtInst %6 %1 Cos %38
459 %40 = OpLoad %6 %8
460 %41 = OpExtInst %6 %1 Exp %40
461 %42 = OpCompositeConstruct %15 %35 %37 %39 %41
462 OpBranch %14
463 %14 = OpLabel
464 %45 = OpPhi %15 %27 %13 %42 %28
465 OpStore %44 %45
466 OpReturn
467 OpFunctionEnd
468
469 )";
470 constexpr char kDiff[] = R"( ; SPIR-V
471 ; Version: 1.6
472 ; Generator: Khronos SPIR-V Tools Assembler; 0
473 ; Bound: 46
474 ; Schema: 0
475 OpCapability Shader
476 %1 = OpExtInstImport "GLSL.std.450"
477 OpMemoryModel Logical GLSL450
478 OpEntryPoint Fragment %4 "main" %8 %44
479 OpExecutionMode %4 OriginUpperLeft
480 OpSource ESSL 310
481 OpDecorate %8 RelaxedPrecision
482 OpDecorate %8 Location 0
483 OpDecorate %9 RelaxedPrecision
484 OpDecorate %18 RelaxedPrecision
485 OpDecorate %19 RelaxedPrecision
486 OpDecorate %20 RelaxedPrecision
487 OpDecorate %23 RelaxedPrecision
488 OpDecorate %24 RelaxedPrecision
489 OpDecorate %25 RelaxedPrecision
490 OpDecorate %26 RelaxedPrecision
491 OpDecorate %27 RelaxedPrecision
492 OpDecorate %28 RelaxedPrecision
493 OpDecorate %29 RelaxedPrecision
494 OpDecorate %30 RelaxedPrecision
495 OpDecorate %31 RelaxedPrecision
496 OpDecorate %33 RelaxedPrecision
497 OpDecorate %34 RelaxedPrecision
498 OpDecorate %35 RelaxedPrecision
499 OpDecorate %36 RelaxedPrecision
500 OpDecorate %37 RelaxedPrecision
501 OpDecorate %39 RelaxedPrecision
502 OpDecorate %40 RelaxedPrecision
503 OpDecorate %41 RelaxedPrecision
504 OpDecorate %42 RelaxedPrecision
505 OpDecorate %44 RelaxedPrecision
506 OpDecorate %44 Location 0
507 OpDecorate %45 RelaxedPrecision
508 %2 = OpTypeVoid
509 %3 = OpTypeFunction %2
510 %6 = OpTypeFloat 32
511 %7 = OpTypePointer Input %6
512 %8 = OpVariable %7 Input
513 %10 = OpConstant %6 0
514 %11 = OpTypeBool
515 %15 = OpTypeVector %6 4
516 %16 = OpTypePointer Function %15
517 %21 = OpConstant %6 -0.5
518 %22 = OpConstant %6 -0.300000012
519 %38 = OpConstant %6 0.5
520 %43 = OpTypePointer Output %15
521 %44 = OpVariable %43 Output
522 %4 = OpFunction %2 None %3
523 %5 = OpLabel
524 %9 = OpLoad %6 %8
525 %12 = OpFOrdLessThanEqual %11 %9 %10
526 OpSelectionMerge %14 None
527 OpBranchConditional %12 %13 %32
528 %32 = OpLabel
529 %33 = OpLoad %6 %8
530 %34 = OpExtInst %6 %1 Sqrt %33
531 %35 = OpLoad %6 %8
532 %36 = OpExtInst %6 %1 FSign %35
533 %37 = OpLoad %6 %8
534 %39 = OpExtInst %6 %1 FMax %37 %38
535 %40 = OpLoad %6 %8
536 %41 = OpExtInst %6 %1 Floor %40
537 %42 = OpCompositeConstruct %15 %34 %36 %39 %41
538 OpBranch %14
539 %13 = OpLabel
540 %18 = OpLoad %6 %8
541 %19 = OpExtInst %6 %1 Log %18
542 %20 = OpLoad %6 %8
543 %23 = OpExtInst %6 %1 FClamp %20 %21 %22
544 %24 = OpFMul %6 %19 %23
545 %25 = OpLoad %6 %8
546 %26 = OpExtInst %6 %1 Sin %25
547 %27 = OpLoad %6 %8
548 %28 = OpExtInst %6 %1 Cos %27
549 %29 = OpLoad %6 %8
550 %30 = OpExtInst %6 %1 Exp %29
551 %31 = OpCompositeConstruct %15 %24 %26 %28 %30
552 OpBranch %14
553 %14 = OpLabel
554 -%45 = OpPhi %15 %31 %13 %42 %32
555 +%45 = OpPhi %15 %42 %32 %31 %13
556 OpStore %44 %45
557 OpReturn
558 OpFunctionEnd
559 )";
560 Options options;
561 DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options);
562 }
563
564 } // namespace
565 } // namespace diff
566 } // namespace spvtools
567