1 // Copyright (c) 2017 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #include <memory>
16 #include <string>
17 #include <vector>
18
19 #include "gmock/gmock.h"
20 #include "source/opt/dominator_analysis.h"
21 #include "source/opt/pass.h"
22 #include "test/opt/assembly_builder.h"
23 #include "test/opt/function_utils.h"
24 #include "test/opt/pass_fixture.h"
25 #include "test/opt/pass_utils.h"
26
27 namespace spvtools {
28 namespace opt {
29 namespace {
30
31 using ::testing::UnorderedElementsAre;
32
33 using PassClassTest = PassTest<::testing::Test>;
34
35 /*
36 Generated from the following GLSL
37 #version 440 core
38 layout(location = 0) out vec4 v;
39 layout(location = 1) in vec4 in_val;
40 void main() {
41 for (int i = 0; i < in_val.x; ++i) {
42 for (int j = 0; j < in_val.y; j++) {
43 }
44 }
45 for (int i = 0; i < in_val.x; ++i) {
46 for (int j = 0; j < in_val.y; j++) {
47 }
48 break;
49 }
50 int i = 0;
51 while (i < in_val.x) {
52 ++i;
53 for (int j = 0; j < 1; j++) {
54 for (int k = 0; k < 1; k++) {
55 }
56 break;
57 }
58 }
59 i = 0;
60 while (i < in_val.x) {
61 ++i;
62 continue;
63 for (int j = 0; j < 1; j++) {
64 for (int k = 0; k < 1; k++) {
65 }
66 break;
67 }
68 }
69 v = vec4(1,1,1,1);
70 }
71 */
TEST_F(PassClassTest,BasicVisitFromEntryPoint)72 TEST_F(PassClassTest, BasicVisitFromEntryPoint) {
73 const std::string text = R"(
74 OpCapability Shader
75 %1 = OpExtInstImport "GLSL.std.450"
76 OpMemoryModel Logical GLSL450
77 OpEntryPoint Fragment %4 "main" %20 %141
78 OpExecutionMode %4 OriginUpperLeft
79 OpSource GLSL 440
80 OpName %4 "main"
81 OpName %8 "i"
82 OpName %20 "in_val"
83 OpName %28 "j"
84 OpName %45 "i"
85 OpName %56 "j"
86 OpName %72 "i"
87 OpName %85 "j"
88 OpName %93 "k"
89 OpName %119 "j"
90 OpName %127 "k"
91 OpName %141 "v"
92 OpDecorate %20 Location 1
93 OpDecorate %141 Location 0
94 %2 = OpTypeVoid
95 %3 = OpTypeFunction %2
96 %6 = OpTypeInt 32 1
97 %7 = OpTypePointer Function %6
98 %9 = OpConstant %6 0
99 %16 = OpTypeFloat 32
100 %18 = OpTypeVector %16 4
101 %19 = OpTypePointer Input %18
102 %20 = OpVariable %19 Input
103 %21 = OpTypeInt 32 0
104 %22 = OpConstant %21 0
105 %23 = OpTypePointer Input %16
106 %26 = OpTypeBool
107 %36 = OpConstant %21 1
108 %41 = OpConstant %6 1
109 %140 = OpTypePointer Output %18
110 %141 = OpVariable %140 Output
111 %142 = OpConstant %16 1
112 %143 = OpConstantComposite %18 %142 %142 %142 %142
113 %4 = OpFunction %2 None %3
114 %5 = OpLabel
115 %8 = OpVariable %7 Function
116 %28 = OpVariable %7 Function
117 %45 = OpVariable %7 Function
118 %56 = OpVariable %7 Function
119 %72 = OpVariable %7 Function
120 %85 = OpVariable %7 Function
121 %93 = OpVariable %7 Function
122 %119 = OpVariable %7 Function
123 %127 = OpVariable %7 Function
124 OpStore %8 %9
125 OpBranch %10
126 %10 = OpLabel
127 OpLoopMerge %12 %13 None
128 OpBranch %14
129 %14 = OpLabel
130 %15 = OpLoad %6 %8
131 %17 = OpConvertSToF %16 %15
132 %24 = OpAccessChain %23 %20 %22
133 %25 = OpLoad %16 %24
134 %27 = OpFOrdLessThan %26 %17 %25
135 OpBranchConditional %27 %11 %12
136 %11 = OpLabel
137 OpStore %28 %9
138 OpBranch %29
139 %29 = OpLabel
140 OpLoopMerge %31 %32 None
141 OpBranch %33
142 %33 = OpLabel
143 %34 = OpLoad %6 %28
144 %35 = OpConvertSToF %16 %34
145 %37 = OpAccessChain %23 %20 %36
146 %38 = OpLoad %16 %37
147 %39 = OpFOrdLessThan %26 %35 %38
148 OpBranchConditional %39 %30 %31
149 %30 = OpLabel
150 OpBranch %32
151 %32 = OpLabel
152 %40 = OpLoad %6 %28
153 %42 = OpIAdd %6 %40 %41
154 OpStore %28 %42
155 OpBranch %29
156 %31 = OpLabel
157 OpBranch %13
158 %13 = OpLabel
159 %43 = OpLoad %6 %8
160 %44 = OpIAdd %6 %43 %41
161 OpStore %8 %44
162 OpBranch %10
163 %12 = OpLabel
164 OpStore %45 %9
165 OpBranch %46
166 %46 = OpLabel
167 OpLoopMerge %48 %49 None
168 OpBranch %50
169 %50 = OpLabel
170 %51 = OpLoad %6 %45
171 %52 = OpConvertSToF %16 %51
172 %53 = OpAccessChain %23 %20 %22
173 %54 = OpLoad %16 %53
174 %55 = OpFOrdLessThan %26 %52 %54
175 OpBranchConditional %55 %47 %48
176 %47 = OpLabel
177 OpStore %56 %9
178 OpBranch %57
179 %57 = OpLabel
180 OpLoopMerge %59 %60 None
181 OpBranch %61
182 %61 = OpLabel
183 %62 = OpLoad %6 %56
184 %63 = OpConvertSToF %16 %62
185 %64 = OpAccessChain %23 %20 %36
186 %65 = OpLoad %16 %64
187 %66 = OpFOrdLessThan %26 %63 %65
188 OpBranchConditional %66 %58 %59
189 %58 = OpLabel
190 OpBranch %60
191 %60 = OpLabel
192 %67 = OpLoad %6 %56
193 %68 = OpIAdd %6 %67 %41
194 OpStore %56 %68
195 OpBranch %57
196 %59 = OpLabel
197 OpBranch %48
198 %49 = OpLabel
199 %70 = OpLoad %6 %45
200 %71 = OpIAdd %6 %70 %41
201 OpStore %45 %71
202 OpBranch %46
203 %48 = OpLabel
204 OpStore %72 %9
205 OpBranch %73
206 %73 = OpLabel
207 OpLoopMerge %75 %76 None
208 OpBranch %77
209 %77 = OpLabel
210 %78 = OpLoad %6 %72
211 %79 = OpConvertSToF %16 %78
212 %80 = OpAccessChain %23 %20 %22
213 %81 = OpLoad %16 %80
214 %82 = OpFOrdLessThan %26 %79 %81
215 OpBranchConditional %82 %74 %75
216 %74 = OpLabel
217 %83 = OpLoad %6 %72
218 %84 = OpIAdd %6 %83 %41
219 OpStore %72 %84
220 OpStore %85 %9
221 OpBranch %86
222 %86 = OpLabel
223 OpLoopMerge %88 %89 None
224 OpBranch %90
225 %90 = OpLabel
226 %91 = OpLoad %6 %85
227 %92 = OpSLessThan %26 %91 %41
228 OpBranchConditional %92 %87 %88
229 %87 = OpLabel
230 OpStore %93 %9
231 OpBranch %94
232 %94 = OpLabel
233 OpLoopMerge %96 %97 None
234 OpBranch %98
235 %98 = OpLabel
236 %99 = OpLoad %6 %93
237 %100 = OpSLessThan %26 %99 %41
238 OpBranchConditional %100 %95 %96
239 %95 = OpLabel
240 OpBranch %97
241 %97 = OpLabel
242 %101 = OpLoad %6 %93
243 %102 = OpIAdd %6 %101 %41
244 OpStore %93 %102
245 OpBranch %94
246 %96 = OpLabel
247 OpBranch %88
248 %89 = OpLabel
249 %104 = OpLoad %6 %85
250 %105 = OpIAdd %6 %104 %41
251 OpStore %85 %105
252 OpBranch %86
253 %88 = OpLabel
254 OpBranch %76
255 %76 = OpLabel
256 OpBranch %73
257 %75 = OpLabel
258 OpStore %72 %9
259 OpBranch %106
260 %106 = OpLabel
261 OpLoopMerge %108 %109 None
262 OpBranch %110
263 %110 = OpLabel
264 %111 = OpLoad %6 %72
265 %112 = OpConvertSToF %16 %111
266 %113 = OpAccessChain %23 %20 %22
267 %114 = OpLoad %16 %113
268 %115 = OpFOrdLessThan %26 %112 %114
269 OpBranchConditional %115 %107 %108
270 %107 = OpLabel
271 %116 = OpLoad %6 %72
272 %117 = OpIAdd %6 %116 %41
273 OpStore %72 %117
274 OpBranch %109
275 %109 = OpLabel
276 OpBranch %106
277 %108 = OpLabel
278 OpStore %141 %143
279 OpReturn
280 OpFunctionEnd
281 )";
282 // clang-format on
283 std::unique_ptr<IRContext> context =
284 BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text,
285 SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
286 Module* module = context->module();
287 EXPECT_NE(nullptr, module) << "Assembling failed for shader:\n"
288 << text << std::endl;
289
290 const Function* f = spvtest::GetFunction(module, 4);
291 DominatorAnalysis* analysis = context->GetDominatorAnalysis(f);
292
293 EXPECT_TRUE(analysis->Dominates(5, 10));
294 EXPECT_TRUE(analysis->Dominates(5, 14));
295 EXPECT_TRUE(analysis->Dominates(5, 11));
296 EXPECT_TRUE(analysis->Dominates(5, 29));
297 EXPECT_TRUE(analysis->Dominates(5, 33));
298 EXPECT_TRUE(analysis->Dominates(5, 30));
299 EXPECT_TRUE(analysis->Dominates(5, 32));
300 EXPECT_TRUE(analysis->Dominates(5, 31));
301 EXPECT_TRUE(analysis->Dominates(5, 13));
302 EXPECT_TRUE(analysis->Dominates(5, 12));
303 EXPECT_TRUE(analysis->Dominates(5, 46));
304 EXPECT_TRUE(analysis->Dominates(5, 50));
305 EXPECT_TRUE(analysis->Dominates(5, 47));
306 EXPECT_TRUE(analysis->Dominates(5, 57));
307 EXPECT_TRUE(analysis->Dominates(5, 61));
308 EXPECT_TRUE(analysis->Dominates(5, 59));
309 EXPECT_TRUE(analysis->Dominates(5, 58));
310 EXPECT_TRUE(analysis->Dominates(5, 60));
311 EXPECT_TRUE(analysis->Dominates(5, 48));
312 EXPECT_TRUE(analysis->Dominates(5, 73));
313 EXPECT_TRUE(analysis->Dominates(5, 77));
314 EXPECT_TRUE(analysis->Dominates(5, 75));
315 EXPECT_TRUE(analysis->Dominates(5, 106));
316 EXPECT_TRUE(analysis->Dominates(5, 110));
317 EXPECT_TRUE(analysis->Dominates(5, 107));
318 EXPECT_TRUE(analysis->Dominates(5, 108));
319 EXPECT_TRUE(analysis->Dominates(5, 109));
320 EXPECT_TRUE(analysis->Dominates(5, 74));
321 EXPECT_TRUE(analysis->Dominates(5, 86));
322 EXPECT_TRUE(analysis->Dominates(5, 90));
323 EXPECT_TRUE(analysis->Dominates(5, 87));
324 EXPECT_TRUE(analysis->Dominates(5, 94));
325 EXPECT_TRUE(analysis->Dominates(5, 98));
326 EXPECT_TRUE(analysis->Dominates(5, 95));
327 EXPECT_TRUE(analysis->Dominates(5, 97));
328 EXPECT_TRUE(analysis->Dominates(5, 96));
329 EXPECT_TRUE(analysis->Dominates(5, 88));
330 EXPECT_TRUE(analysis->Dominates(5, 76));
331
332 EXPECT_TRUE(analysis->Dominates(10, 14));
333 EXPECT_TRUE(analysis->Dominates(10, 11));
334 EXPECT_TRUE(analysis->Dominates(10, 29));
335 EXPECT_TRUE(analysis->Dominates(10, 33));
336 EXPECT_TRUE(analysis->Dominates(10, 30));
337 EXPECT_TRUE(analysis->Dominates(10, 32));
338 EXPECT_TRUE(analysis->Dominates(10, 31));
339 EXPECT_TRUE(analysis->Dominates(10, 13));
340 EXPECT_TRUE(analysis->Dominates(10, 12));
341 EXPECT_TRUE(analysis->Dominates(10, 46));
342 EXPECT_TRUE(analysis->Dominates(10, 50));
343 EXPECT_TRUE(analysis->Dominates(10, 47));
344 EXPECT_TRUE(analysis->Dominates(10, 57));
345 EXPECT_TRUE(analysis->Dominates(10, 61));
346 EXPECT_TRUE(analysis->Dominates(10, 59));
347 EXPECT_TRUE(analysis->Dominates(10, 58));
348 EXPECT_TRUE(analysis->Dominates(10, 60));
349 EXPECT_TRUE(analysis->Dominates(10, 48));
350 EXPECT_TRUE(analysis->Dominates(10, 73));
351 EXPECT_TRUE(analysis->Dominates(10, 77));
352 EXPECT_TRUE(analysis->Dominates(10, 75));
353 EXPECT_TRUE(analysis->Dominates(10, 106));
354 EXPECT_TRUE(analysis->Dominates(10, 110));
355 EXPECT_TRUE(analysis->Dominates(10, 107));
356 EXPECT_TRUE(analysis->Dominates(10, 108));
357 EXPECT_TRUE(analysis->Dominates(10, 109));
358 EXPECT_TRUE(analysis->Dominates(10, 74));
359 EXPECT_TRUE(analysis->Dominates(10, 86));
360 EXPECT_TRUE(analysis->Dominates(10, 90));
361 EXPECT_TRUE(analysis->Dominates(10, 87));
362 EXPECT_TRUE(analysis->Dominates(10, 94));
363 EXPECT_TRUE(analysis->Dominates(10, 98));
364 EXPECT_TRUE(analysis->Dominates(10, 95));
365 EXPECT_TRUE(analysis->Dominates(10, 97));
366 EXPECT_TRUE(analysis->Dominates(10, 96));
367 EXPECT_TRUE(analysis->Dominates(10, 88));
368 EXPECT_TRUE(analysis->Dominates(10, 76));
369
370 EXPECT_TRUE(analysis->Dominates(14, 11));
371 EXPECT_TRUE(analysis->Dominates(14, 29));
372 EXPECT_TRUE(analysis->Dominates(14, 33));
373 EXPECT_TRUE(analysis->Dominates(14, 30));
374 EXPECT_TRUE(analysis->Dominates(14, 32));
375 EXPECT_TRUE(analysis->Dominates(14, 31));
376
377 EXPECT_TRUE(analysis->Dominates(11, 29));
378 EXPECT_TRUE(analysis->Dominates(11, 33));
379 EXPECT_TRUE(analysis->Dominates(11, 30));
380 EXPECT_TRUE(analysis->Dominates(11, 32));
381 EXPECT_TRUE(analysis->Dominates(11, 31));
382
383 EXPECT_TRUE(analysis->Dominates(29, 33));
384 EXPECT_TRUE(analysis->Dominates(29, 30));
385 EXPECT_TRUE(analysis->Dominates(29, 32));
386 EXPECT_TRUE(analysis->Dominates(29, 31));
387
388 EXPECT_TRUE(analysis->Dominates(33, 30));
389
390 EXPECT_TRUE(analysis->Dominates(12, 46));
391 EXPECT_TRUE(analysis->Dominates(12, 50));
392 EXPECT_TRUE(analysis->Dominates(12, 47));
393 EXPECT_TRUE(analysis->Dominates(12, 57));
394 EXPECT_TRUE(analysis->Dominates(12, 61));
395 EXPECT_TRUE(analysis->Dominates(12, 59));
396 EXPECT_TRUE(analysis->Dominates(12, 58));
397 EXPECT_TRUE(analysis->Dominates(12, 60));
398 EXPECT_TRUE(analysis->Dominates(12, 48));
399 EXPECT_TRUE(analysis->Dominates(12, 73));
400 EXPECT_TRUE(analysis->Dominates(12, 77));
401 EXPECT_TRUE(analysis->Dominates(12, 75));
402 EXPECT_TRUE(analysis->Dominates(12, 106));
403 EXPECT_TRUE(analysis->Dominates(12, 110));
404 EXPECT_TRUE(analysis->Dominates(12, 107));
405 EXPECT_TRUE(analysis->Dominates(12, 108));
406 EXPECT_TRUE(analysis->Dominates(12, 109));
407 EXPECT_TRUE(analysis->Dominates(12, 74));
408 EXPECT_TRUE(analysis->Dominates(12, 86));
409 EXPECT_TRUE(analysis->Dominates(12, 90));
410 EXPECT_TRUE(analysis->Dominates(12, 87));
411 EXPECT_TRUE(analysis->Dominates(12, 94));
412 EXPECT_TRUE(analysis->Dominates(12, 98));
413 EXPECT_TRUE(analysis->Dominates(12, 95));
414 EXPECT_TRUE(analysis->Dominates(12, 97));
415 EXPECT_TRUE(analysis->Dominates(12, 96));
416 EXPECT_TRUE(analysis->Dominates(12, 88));
417 EXPECT_TRUE(analysis->Dominates(12, 76));
418
419 EXPECT_TRUE(analysis->Dominates(46, 50));
420 EXPECT_TRUE(analysis->Dominates(46, 47));
421 EXPECT_TRUE(analysis->Dominates(46, 57));
422 EXPECT_TRUE(analysis->Dominates(46, 61));
423 EXPECT_TRUE(analysis->Dominates(46, 59));
424 EXPECT_TRUE(analysis->Dominates(46, 58));
425 EXPECT_TRUE(analysis->Dominates(46, 60));
426 EXPECT_TRUE(analysis->Dominates(46, 48));
427 EXPECT_TRUE(analysis->Dominates(46, 73));
428 EXPECT_TRUE(analysis->Dominates(46, 77));
429 EXPECT_TRUE(analysis->Dominates(46, 75));
430 EXPECT_TRUE(analysis->Dominates(46, 106));
431 EXPECT_TRUE(analysis->Dominates(46, 110));
432 EXPECT_TRUE(analysis->Dominates(46, 107));
433 EXPECT_TRUE(analysis->Dominates(46, 108));
434 EXPECT_TRUE(analysis->Dominates(46, 109));
435 EXPECT_TRUE(analysis->Dominates(46, 74));
436 EXPECT_TRUE(analysis->Dominates(46, 86));
437 EXPECT_TRUE(analysis->Dominates(46, 90));
438 EXPECT_TRUE(analysis->Dominates(46, 87));
439 EXPECT_TRUE(analysis->Dominates(46, 94));
440 EXPECT_TRUE(analysis->Dominates(46, 98));
441 EXPECT_TRUE(analysis->Dominates(46, 95));
442 EXPECT_TRUE(analysis->Dominates(46, 97));
443 EXPECT_TRUE(analysis->Dominates(46, 96));
444 EXPECT_TRUE(analysis->Dominates(46, 88));
445 EXPECT_TRUE(analysis->Dominates(46, 76));
446
447 EXPECT_TRUE(analysis->Dominates(50, 47));
448 EXPECT_TRUE(analysis->Dominates(50, 57));
449 EXPECT_TRUE(analysis->Dominates(50, 61));
450 EXPECT_TRUE(analysis->Dominates(50, 59));
451 EXPECT_TRUE(analysis->Dominates(50, 58));
452 EXPECT_TRUE(analysis->Dominates(50, 60));
453
454 EXPECT_TRUE(analysis->Dominates(47, 57));
455 EXPECT_TRUE(analysis->Dominates(47, 61));
456 EXPECT_TRUE(analysis->Dominates(47, 59));
457 EXPECT_TRUE(analysis->Dominates(47, 58));
458 EXPECT_TRUE(analysis->Dominates(47, 60));
459
460 EXPECT_TRUE(analysis->Dominates(57, 61));
461 EXPECT_TRUE(analysis->Dominates(57, 59));
462 EXPECT_TRUE(analysis->Dominates(57, 58));
463 EXPECT_TRUE(analysis->Dominates(57, 60));
464
465 EXPECT_TRUE(analysis->Dominates(61, 59));
466
467 EXPECT_TRUE(analysis->Dominates(48, 73));
468 EXPECT_TRUE(analysis->Dominates(48, 77));
469 EXPECT_TRUE(analysis->Dominates(48, 75));
470 EXPECT_TRUE(analysis->Dominates(48, 106));
471 EXPECT_TRUE(analysis->Dominates(48, 110));
472 EXPECT_TRUE(analysis->Dominates(48, 107));
473 EXPECT_TRUE(analysis->Dominates(48, 108));
474 EXPECT_TRUE(analysis->Dominates(48, 109));
475 EXPECT_TRUE(analysis->Dominates(48, 74));
476 EXPECT_TRUE(analysis->Dominates(48, 86));
477 EXPECT_TRUE(analysis->Dominates(48, 90));
478 EXPECT_TRUE(analysis->Dominates(48, 87));
479 EXPECT_TRUE(analysis->Dominates(48, 94));
480 EXPECT_TRUE(analysis->Dominates(48, 98));
481 EXPECT_TRUE(analysis->Dominates(48, 95));
482 EXPECT_TRUE(analysis->Dominates(48, 97));
483 EXPECT_TRUE(analysis->Dominates(48, 96));
484 EXPECT_TRUE(analysis->Dominates(48, 88));
485 EXPECT_TRUE(analysis->Dominates(48, 76));
486
487 EXPECT_TRUE(analysis->Dominates(73, 77));
488 EXPECT_TRUE(analysis->Dominates(73, 75));
489 EXPECT_TRUE(analysis->Dominates(73, 106));
490 EXPECT_TRUE(analysis->Dominates(73, 110));
491 EXPECT_TRUE(analysis->Dominates(73, 107));
492 EXPECT_TRUE(analysis->Dominates(73, 108));
493 EXPECT_TRUE(analysis->Dominates(73, 109));
494 EXPECT_TRUE(analysis->Dominates(73, 74));
495 EXPECT_TRUE(analysis->Dominates(73, 86));
496 EXPECT_TRUE(analysis->Dominates(73, 90));
497 EXPECT_TRUE(analysis->Dominates(73, 87));
498 EXPECT_TRUE(analysis->Dominates(73, 94));
499 EXPECT_TRUE(analysis->Dominates(73, 98));
500 EXPECT_TRUE(analysis->Dominates(73, 95));
501 EXPECT_TRUE(analysis->Dominates(73, 97));
502 EXPECT_TRUE(analysis->Dominates(73, 96));
503 EXPECT_TRUE(analysis->Dominates(73, 88));
504 EXPECT_TRUE(analysis->Dominates(73, 76));
505
506 EXPECT_TRUE(analysis->Dominates(75, 106));
507 EXPECT_TRUE(analysis->Dominates(75, 110));
508 EXPECT_TRUE(analysis->Dominates(75, 107));
509 EXPECT_TRUE(analysis->Dominates(75, 108));
510 EXPECT_TRUE(analysis->Dominates(75, 109));
511
512 EXPECT_TRUE(analysis->Dominates(106, 110));
513 EXPECT_TRUE(analysis->Dominates(106, 107));
514 EXPECT_TRUE(analysis->Dominates(106, 108));
515 EXPECT_TRUE(analysis->Dominates(106, 109));
516
517 EXPECT_TRUE(analysis->Dominates(110, 107));
518
519 EXPECT_TRUE(analysis->Dominates(77, 74));
520 EXPECT_TRUE(analysis->Dominates(77, 86));
521 EXPECT_TRUE(analysis->Dominates(77, 90));
522 EXPECT_TRUE(analysis->Dominates(77, 87));
523 EXPECT_TRUE(analysis->Dominates(77, 94));
524 EXPECT_TRUE(analysis->Dominates(77, 98));
525 EXPECT_TRUE(analysis->Dominates(77, 95));
526 EXPECT_TRUE(analysis->Dominates(77, 97));
527 EXPECT_TRUE(analysis->Dominates(77, 96));
528 EXPECT_TRUE(analysis->Dominates(77, 88));
529
530 EXPECT_TRUE(analysis->Dominates(74, 86));
531 EXPECT_TRUE(analysis->Dominates(74, 90));
532 EXPECT_TRUE(analysis->Dominates(74, 87));
533 EXPECT_TRUE(analysis->Dominates(74, 94));
534 EXPECT_TRUE(analysis->Dominates(74, 98));
535 EXPECT_TRUE(analysis->Dominates(74, 95));
536 EXPECT_TRUE(analysis->Dominates(74, 97));
537 EXPECT_TRUE(analysis->Dominates(74, 96));
538 EXPECT_TRUE(analysis->Dominates(74, 88));
539
540 EXPECT_TRUE(analysis->Dominates(86, 90));
541 EXPECT_TRUE(analysis->Dominates(86, 87));
542 EXPECT_TRUE(analysis->Dominates(86, 94));
543 EXPECT_TRUE(analysis->Dominates(86, 98));
544 EXPECT_TRUE(analysis->Dominates(86, 95));
545 EXPECT_TRUE(analysis->Dominates(86, 97));
546 EXPECT_TRUE(analysis->Dominates(86, 96));
547 EXPECT_TRUE(analysis->Dominates(86, 88));
548
549 EXPECT_TRUE(analysis->Dominates(90, 87));
550 EXPECT_TRUE(analysis->Dominates(90, 94));
551 EXPECT_TRUE(analysis->Dominates(90, 98));
552 EXPECT_TRUE(analysis->Dominates(90, 95));
553 EXPECT_TRUE(analysis->Dominates(90, 97));
554 EXPECT_TRUE(analysis->Dominates(90, 96));
555
556 EXPECT_TRUE(analysis->Dominates(87, 94));
557 EXPECT_TRUE(analysis->Dominates(87, 98));
558 EXPECT_TRUE(analysis->Dominates(87, 95));
559 EXPECT_TRUE(analysis->Dominates(87, 97));
560 EXPECT_TRUE(analysis->Dominates(87, 96));
561
562 EXPECT_TRUE(analysis->Dominates(94, 98));
563 EXPECT_TRUE(analysis->Dominates(94, 95));
564 EXPECT_TRUE(analysis->Dominates(94, 97));
565 EXPECT_TRUE(analysis->Dominates(94, 96));
566
567 EXPECT_TRUE(analysis->Dominates(98, 95));
568
569 EXPECT_TRUE(analysis->StrictlyDominates(5, 10));
570 EXPECT_TRUE(analysis->StrictlyDominates(5, 14));
571 EXPECT_TRUE(analysis->StrictlyDominates(5, 11));
572 EXPECT_TRUE(analysis->StrictlyDominates(5, 29));
573 EXPECT_TRUE(analysis->StrictlyDominates(5, 33));
574 EXPECT_TRUE(analysis->StrictlyDominates(5, 30));
575 EXPECT_TRUE(analysis->StrictlyDominates(5, 32));
576 EXPECT_TRUE(analysis->StrictlyDominates(5, 31));
577 EXPECT_TRUE(analysis->StrictlyDominates(5, 13));
578 EXPECT_TRUE(analysis->StrictlyDominates(5, 12));
579 EXPECT_TRUE(analysis->StrictlyDominates(5, 46));
580 EXPECT_TRUE(analysis->StrictlyDominates(5, 50));
581 EXPECT_TRUE(analysis->StrictlyDominates(5, 47));
582 EXPECT_TRUE(analysis->StrictlyDominates(5, 57));
583 EXPECT_TRUE(analysis->StrictlyDominates(5, 61));
584 EXPECT_TRUE(analysis->StrictlyDominates(5, 59));
585 EXPECT_TRUE(analysis->StrictlyDominates(5, 58));
586 EXPECT_TRUE(analysis->StrictlyDominates(5, 60));
587 EXPECT_TRUE(analysis->StrictlyDominates(5, 48));
588 EXPECT_TRUE(analysis->StrictlyDominates(5, 73));
589 EXPECT_TRUE(analysis->StrictlyDominates(5, 77));
590 EXPECT_TRUE(analysis->StrictlyDominates(5, 75));
591 EXPECT_TRUE(analysis->StrictlyDominates(5, 106));
592 EXPECT_TRUE(analysis->StrictlyDominates(5, 110));
593 EXPECT_TRUE(analysis->StrictlyDominates(5, 107));
594 EXPECT_TRUE(analysis->StrictlyDominates(5, 108));
595 EXPECT_TRUE(analysis->StrictlyDominates(5, 109));
596 EXPECT_TRUE(analysis->StrictlyDominates(5, 74));
597 EXPECT_TRUE(analysis->StrictlyDominates(5, 86));
598 EXPECT_TRUE(analysis->StrictlyDominates(5, 90));
599 EXPECT_TRUE(analysis->StrictlyDominates(5, 87));
600 EXPECT_TRUE(analysis->StrictlyDominates(5, 94));
601 EXPECT_TRUE(analysis->StrictlyDominates(5, 98));
602 EXPECT_TRUE(analysis->StrictlyDominates(5, 95));
603 EXPECT_TRUE(analysis->StrictlyDominates(5, 97));
604 EXPECT_TRUE(analysis->StrictlyDominates(5, 96));
605 EXPECT_TRUE(analysis->StrictlyDominates(5, 88));
606 EXPECT_TRUE(analysis->StrictlyDominates(5, 76));
607
608 EXPECT_TRUE(analysis->StrictlyDominates(10, 14));
609 EXPECT_TRUE(analysis->StrictlyDominates(10, 11));
610 EXPECT_TRUE(analysis->StrictlyDominates(10, 29));
611 EXPECT_TRUE(analysis->StrictlyDominates(10, 33));
612 EXPECT_TRUE(analysis->StrictlyDominates(10, 30));
613 EXPECT_TRUE(analysis->StrictlyDominates(10, 32));
614 EXPECT_TRUE(analysis->StrictlyDominates(10, 31));
615 EXPECT_TRUE(analysis->StrictlyDominates(10, 13));
616 EXPECT_TRUE(analysis->StrictlyDominates(10, 12));
617 EXPECT_TRUE(analysis->StrictlyDominates(10, 46));
618 EXPECT_TRUE(analysis->StrictlyDominates(10, 50));
619 EXPECT_TRUE(analysis->StrictlyDominates(10, 47));
620 EXPECT_TRUE(analysis->StrictlyDominates(10, 57));
621 EXPECT_TRUE(analysis->StrictlyDominates(10, 61));
622 EXPECT_TRUE(analysis->StrictlyDominates(10, 59));
623 EXPECT_TRUE(analysis->StrictlyDominates(10, 58));
624 EXPECT_TRUE(analysis->StrictlyDominates(10, 60));
625 EXPECT_TRUE(analysis->StrictlyDominates(10, 48));
626 EXPECT_TRUE(analysis->StrictlyDominates(10, 73));
627 EXPECT_TRUE(analysis->StrictlyDominates(10, 77));
628 EXPECT_TRUE(analysis->StrictlyDominates(10, 75));
629 EXPECT_TRUE(analysis->StrictlyDominates(10, 106));
630 EXPECT_TRUE(analysis->StrictlyDominates(10, 110));
631 EXPECT_TRUE(analysis->StrictlyDominates(10, 107));
632 EXPECT_TRUE(analysis->StrictlyDominates(10, 108));
633 EXPECT_TRUE(analysis->StrictlyDominates(10, 109));
634 EXPECT_TRUE(analysis->StrictlyDominates(10, 74));
635 EXPECT_TRUE(analysis->StrictlyDominates(10, 86));
636 EXPECT_TRUE(analysis->StrictlyDominates(10, 90));
637 EXPECT_TRUE(analysis->StrictlyDominates(10, 87));
638 EXPECT_TRUE(analysis->StrictlyDominates(10, 94));
639 EXPECT_TRUE(analysis->StrictlyDominates(10, 98));
640 EXPECT_TRUE(analysis->StrictlyDominates(10, 95));
641 EXPECT_TRUE(analysis->StrictlyDominates(10, 97));
642 EXPECT_TRUE(analysis->StrictlyDominates(10, 96));
643 EXPECT_TRUE(analysis->StrictlyDominates(10, 88));
644 EXPECT_TRUE(analysis->StrictlyDominates(10, 76));
645
646 EXPECT_TRUE(analysis->StrictlyDominates(14, 11));
647 EXPECT_TRUE(analysis->StrictlyDominates(14, 29));
648 EXPECT_TRUE(analysis->StrictlyDominates(14, 33));
649 EXPECT_TRUE(analysis->StrictlyDominates(14, 30));
650 EXPECT_TRUE(analysis->StrictlyDominates(14, 32));
651 EXPECT_TRUE(analysis->StrictlyDominates(14, 31));
652
653 EXPECT_TRUE(analysis->StrictlyDominates(11, 29));
654 EXPECT_TRUE(analysis->StrictlyDominates(11, 33));
655 EXPECT_TRUE(analysis->StrictlyDominates(11, 30));
656 EXPECT_TRUE(analysis->StrictlyDominates(11, 32));
657 EXPECT_TRUE(analysis->StrictlyDominates(11, 31));
658
659 EXPECT_TRUE(analysis->StrictlyDominates(29, 33));
660 EXPECT_TRUE(analysis->StrictlyDominates(29, 30));
661 EXPECT_TRUE(analysis->StrictlyDominates(29, 32));
662 EXPECT_TRUE(analysis->StrictlyDominates(29, 31));
663
664 EXPECT_TRUE(analysis->StrictlyDominates(33, 30));
665
666 EXPECT_TRUE(analysis->StrictlyDominates(12, 46));
667 EXPECT_TRUE(analysis->StrictlyDominates(12, 50));
668 EXPECT_TRUE(analysis->StrictlyDominates(12, 47));
669 EXPECT_TRUE(analysis->StrictlyDominates(12, 57));
670 EXPECT_TRUE(analysis->StrictlyDominates(12, 61));
671 EXPECT_TRUE(analysis->StrictlyDominates(12, 59));
672 EXPECT_TRUE(analysis->StrictlyDominates(12, 58));
673 EXPECT_TRUE(analysis->StrictlyDominates(12, 60));
674 EXPECT_TRUE(analysis->StrictlyDominates(12, 48));
675 EXPECT_TRUE(analysis->StrictlyDominates(12, 73));
676 EXPECT_TRUE(analysis->StrictlyDominates(12, 77));
677 EXPECT_TRUE(analysis->StrictlyDominates(12, 75));
678 EXPECT_TRUE(analysis->StrictlyDominates(12, 106));
679 EXPECT_TRUE(analysis->StrictlyDominates(12, 110));
680 EXPECT_TRUE(analysis->StrictlyDominates(12, 107));
681 EXPECT_TRUE(analysis->StrictlyDominates(12, 108));
682 EXPECT_TRUE(analysis->StrictlyDominates(12, 109));
683 EXPECT_TRUE(analysis->StrictlyDominates(12, 74));
684 EXPECT_TRUE(analysis->StrictlyDominates(12, 86));
685 EXPECT_TRUE(analysis->StrictlyDominates(12, 90));
686 EXPECT_TRUE(analysis->StrictlyDominates(12, 87));
687 EXPECT_TRUE(analysis->StrictlyDominates(12, 94));
688 EXPECT_TRUE(analysis->StrictlyDominates(12, 98));
689 EXPECT_TRUE(analysis->StrictlyDominates(12, 95));
690 EXPECT_TRUE(analysis->StrictlyDominates(12, 97));
691 EXPECT_TRUE(analysis->StrictlyDominates(12, 96));
692 EXPECT_TRUE(analysis->StrictlyDominates(12, 88));
693 EXPECT_TRUE(analysis->StrictlyDominates(12, 76));
694
695 EXPECT_TRUE(analysis->StrictlyDominates(46, 50));
696 EXPECT_TRUE(analysis->StrictlyDominates(46, 47));
697 EXPECT_TRUE(analysis->StrictlyDominates(46, 57));
698 EXPECT_TRUE(analysis->StrictlyDominates(46, 61));
699 EXPECT_TRUE(analysis->StrictlyDominates(46, 59));
700 EXPECT_TRUE(analysis->StrictlyDominates(46, 58));
701 EXPECT_TRUE(analysis->StrictlyDominates(46, 60));
702 EXPECT_TRUE(analysis->StrictlyDominates(46, 48));
703 EXPECT_TRUE(analysis->StrictlyDominates(46, 73));
704 EXPECT_TRUE(analysis->StrictlyDominates(46, 77));
705 EXPECT_TRUE(analysis->StrictlyDominates(46, 75));
706 EXPECT_TRUE(analysis->StrictlyDominates(46, 106));
707 EXPECT_TRUE(analysis->StrictlyDominates(46, 110));
708 EXPECT_TRUE(analysis->StrictlyDominates(46, 107));
709 EXPECT_TRUE(analysis->StrictlyDominates(46, 108));
710 EXPECT_TRUE(analysis->StrictlyDominates(46, 109));
711 EXPECT_TRUE(analysis->StrictlyDominates(46, 74));
712 EXPECT_TRUE(analysis->StrictlyDominates(46, 86));
713 EXPECT_TRUE(analysis->StrictlyDominates(46, 90));
714 EXPECT_TRUE(analysis->StrictlyDominates(46, 87));
715 EXPECT_TRUE(analysis->StrictlyDominates(46, 94));
716 EXPECT_TRUE(analysis->StrictlyDominates(46, 98));
717 EXPECT_TRUE(analysis->StrictlyDominates(46, 95));
718 EXPECT_TRUE(analysis->StrictlyDominates(46, 97));
719 EXPECT_TRUE(analysis->StrictlyDominates(46, 96));
720 EXPECT_TRUE(analysis->StrictlyDominates(46, 88));
721 EXPECT_TRUE(analysis->StrictlyDominates(46, 76));
722
723 EXPECT_TRUE(analysis->StrictlyDominates(50, 47));
724 EXPECT_TRUE(analysis->StrictlyDominates(50, 57));
725 EXPECT_TRUE(analysis->StrictlyDominates(50, 61));
726 EXPECT_TRUE(analysis->StrictlyDominates(50, 59));
727 EXPECT_TRUE(analysis->StrictlyDominates(50, 58));
728 EXPECT_TRUE(analysis->StrictlyDominates(50, 60));
729
730 EXPECT_TRUE(analysis->StrictlyDominates(47, 57));
731 EXPECT_TRUE(analysis->StrictlyDominates(47, 61));
732 EXPECT_TRUE(analysis->StrictlyDominates(47, 59));
733 EXPECT_TRUE(analysis->StrictlyDominates(47, 58));
734 EXPECT_TRUE(analysis->StrictlyDominates(47, 60));
735
736 EXPECT_TRUE(analysis->StrictlyDominates(57, 61));
737 EXPECT_TRUE(analysis->StrictlyDominates(57, 59));
738 EXPECT_TRUE(analysis->StrictlyDominates(57, 58));
739 EXPECT_TRUE(analysis->StrictlyDominates(57, 60));
740
741 EXPECT_TRUE(analysis->StrictlyDominates(61, 59));
742
743 EXPECT_TRUE(analysis->StrictlyDominates(48, 73));
744 EXPECT_TRUE(analysis->StrictlyDominates(48, 77));
745 EXPECT_TRUE(analysis->StrictlyDominates(48, 75));
746 EXPECT_TRUE(analysis->StrictlyDominates(48, 106));
747 EXPECT_TRUE(analysis->StrictlyDominates(48, 110));
748 EXPECT_TRUE(analysis->StrictlyDominates(48, 107));
749 EXPECT_TRUE(analysis->StrictlyDominates(48, 108));
750 EXPECT_TRUE(analysis->StrictlyDominates(48, 109));
751 EXPECT_TRUE(analysis->StrictlyDominates(48, 74));
752 EXPECT_TRUE(analysis->StrictlyDominates(48, 86));
753 EXPECT_TRUE(analysis->StrictlyDominates(48, 90));
754 EXPECT_TRUE(analysis->StrictlyDominates(48, 87));
755 EXPECT_TRUE(analysis->StrictlyDominates(48, 94));
756 EXPECT_TRUE(analysis->StrictlyDominates(48, 98));
757 EXPECT_TRUE(analysis->StrictlyDominates(48, 95));
758 EXPECT_TRUE(analysis->StrictlyDominates(48, 97));
759 EXPECT_TRUE(analysis->StrictlyDominates(48, 96));
760 EXPECT_TRUE(analysis->StrictlyDominates(48, 88));
761 EXPECT_TRUE(analysis->StrictlyDominates(48, 76));
762
763 EXPECT_TRUE(analysis->StrictlyDominates(73, 77));
764 EXPECT_TRUE(analysis->StrictlyDominates(73, 75));
765 EXPECT_TRUE(analysis->StrictlyDominates(73, 106));
766 EXPECT_TRUE(analysis->StrictlyDominates(73, 110));
767 EXPECT_TRUE(analysis->StrictlyDominates(73, 107));
768 EXPECT_TRUE(analysis->StrictlyDominates(73, 108));
769 EXPECT_TRUE(analysis->StrictlyDominates(73, 109));
770 EXPECT_TRUE(analysis->StrictlyDominates(73, 74));
771 EXPECT_TRUE(analysis->StrictlyDominates(73, 86));
772 EXPECT_TRUE(analysis->StrictlyDominates(73, 90));
773 EXPECT_TRUE(analysis->StrictlyDominates(73, 87));
774 EXPECT_TRUE(analysis->StrictlyDominates(73, 94));
775 EXPECT_TRUE(analysis->StrictlyDominates(73, 98));
776 EXPECT_TRUE(analysis->StrictlyDominates(73, 95));
777 EXPECT_TRUE(analysis->StrictlyDominates(73, 97));
778 EXPECT_TRUE(analysis->StrictlyDominates(73, 96));
779 EXPECT_TRUE(analysis->StrictlyDominates(73, 88));
780 EXPECT_TRUE(analysis->StrictlyDominates(73, 76));
781
782 EXPECT_TRUE(analysis->StrictlyDominates(75, 106));
783 EXPECT_TRUE(analysis->StrictlyDominates(75, 110));
784 EXPECT_TRUE(analysis->StrictlyDominates(75, 107));
785 EXPECT_TRUE(analysis->StrictlyDominates(75, 108));
786 EXPECT_TRUE(analysis->StrictlyDominates(75, 109));
787
788 EXPECT_TRUE(analysis->StrictlyDominates(106, 110));
789 EXPECT_TRUE(analysis->StrictlyDominates(106, 107));
790 EXPECT_TRUE(analysis->StrictlyDominates(106, 108));
791 EXPECT_TRUE(analysis->StrictlyDominates(106, 109));
792
793 EXPECT_TRUE(analysis->StrictlyDominates(110, 107));
794
795 EXPECT_TRUE(analysis->StrictlyDominates(77, 74));
796 EXPECT_TRUE(analysis->StrictlyDominates(77, 86));
797 EXPECT_TRUE(analysis->StrictlyDominates(77, 90));
798 EXPECT_TRUE(analysis->StrictlyDominates(77, 87));
799 EXPECT_TRUE(analysis->StrictlyDominates(77, 94));
800 EXPECT_TRUE(analysis->StrictlyDominates(77, 98));
801 EXPECT_TRUE(analysis->StrictlyDominates(77, 95));
802 EXPECT_TRUE(analysis->StrictlyDominates(77, 97));
803 EXPECT_TRUE(analysis->StrictlyDominates(77, 96));
804 EXPECT_TRUE(analysis->StrictlyDominates(77, 88));
805
806 EXPECT_TRUE(analysis->StrictlyDominates(74, 86));
807 EXPECT_TRUE(analysis->StrictlyDominates(74, 90));
808 EXPECT_TRUE(analysis->StrictlyDominates(74, 87));
809 EXPECT_TRUE(analysis->StrictlyDominates(74, 94));
810 EXPECT_TRUE(analysis->StrictlyDominates(74, 98));
811 EXPECT_TRUE(analysis->StrictlyDominates(74, 95));
812 EXPECT_TRUE(analysis->StrictlyDominates(74, 97));
813 EXPECT_TRUE(analysis->StrictlyDominates(74, 96));
814 EXPECT_TRUE(analysis->StrictlyDominates(74, 88));
815
816 EXPECT_TRUE(analysis->StrictlyDominates(86, 90));
817 EXPECT_TRUE(analysis->StrictlyDominates(86, 87));
818 EXPECT_TRUE(analysis->StrictlyDominates(86, 94));
819 EXPECT_TRUE(analysis->StrictlyDominates(86, 98));
820 EXPECT_TRUE(analysis->StrictlyDominates(86, 95));
821 EXPECT_TRUE(analysis->StrictlyDominates(86, 97));
822 EXPECT_TRUE(analysis->StrictlyDominates(86, 96));
823 EXPECT_TRUE(analysis->StrictlyDominates(86, 88));
824
825 EXPECT_TRUE(analysis->StrictlyDominates(90, 87));
826 EXPECT_TRUE(analysis->StrictlyDominates(90, 94));
827 EXPECT_TRUE(analysis->StrictlyDominates(90, 98));
828 EXPECT_TRUE(analysis->StrictlyDominates(90, 95));
829 EXPECT_TRUE(analysis->StrictlyDominates(90, 97));
830 EXPECT_TRUE(analysis->StrictlyDominates(90, 96));
831
832 EXPECT_TRUE(analysis->StrictlyDominates(87, 94));
833 EXPECT_TRUE(analysis->StrictlyDominates(87, 98));
834 EXPECT_TRUE(analysis->StrictlyDominates(87, 95));
835 EXPECT_TRUE(analysis->StrictlyDominates(87, 97));
836 EXPECT_TRUE(analysis->StrictlyDominates(87, 96));
837
838 EXPECT_TRUE(analysis->StrictlyDominates(94, 98));
839 EXPECT_TRUE(analysis->StrictlyDominates(94, 95));
840 EXPECT_TRUE(analysis->StrictlyDominates(94, 97));
841 EXPECT_TRUE(analysis->StrictlyDominates(94, 96));
842
843 EXPECT_TRUE(analysis->StrictlyDominates(98, 95));
844 }
845
846 } // namespace
847 } // namespace opt
848 } // namespace spvtools
849