Skip to content

Commit 7f5e2e7

Browse files
committed
Fix unit tests to not have dead params.
1 parent cf56b95 commit 7f5e2e7

File tree

1 file changed

+13
-5
lines changed
  • crates/rustc_codegen_spirv/src/linker

1 file changed

+13
-5
lines changed

crates/rustc_codegen_spirv/src/linker/test.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ fn without_header_eq(mut result: Module, expected: &str) {
129129
if result != expected {
130130
println!("{}", &result);
131131
panic!(
132-
"assertion failed: `(left.contains(right))`\
132+
"assertion failed: `left == right`\
133133
\n\
134134
\n{}\
135135
\n",
136-
pretty_assertions::Comparison::new(&PrettyString(&result), &PrettyString(&expected))
136+
pretty_assertions::Comparison::new(&PrettyString(&expected), &PrettyString(&result))
137137
);
138138
}
139139
}
@@ -378,6 +378,7 @@ fn use_exported_func_param_attr() {
378378
%8 = OpFunction %5 None %7
379379
%4 = OpFunctionParameter %6
380380
%9 = OpLabel
381+
%10 = OpLoad %6 %4
381382
OpReturn
382383
OpFunctionEnd
383384
"#,
@@ -394,6 +395,7 @@ fn use_exported_func_param_attr() {
394395
%1 = OpFunction %3 None %5
395396
%2 = OpFunctionParameter %4
396397
%6 = OpLabel
398+
%7 = OpLoad %4 %2
397399
OpReturn
398400
OpFunctionEnd
399401
"#,
@@ -412,11 +414,13 @@ fn use_exported_func_param_attr() {
412414
%7 = OpFunction %4 None %6
413415
%2 = OpFunctionParameter %5
414416
%8 = OpLabel
417+
%9 = OpLoad %5 %2
415418
OpReturn
416419
OpFunctionEnd
417-
%9 = OpFunction %4 None %6
420+
%10 = OpFunction %4 None %6
418421
%3 = OpFunctionParameter %5
419-
%10 = OpLabel
422+
%11 = OpLabel
423+
%12 = OpLoad %5 %3
420424
OpReturn
421425
OpFunctionEnd"#;
422426

@@ -445,6 +449,7 @@ fn names_and_decorations() {
445449
%8 = OpFunction %5 None %7
446450
%4 = OpFunctionParameter %9
447451
%10 = OpLabel
452+
%11 = OpLoad %6 %4
448453
OpReturn
449454
OpFunctionEnd
450455
"#,
@@ -464,6 +469,7 @@ fn names_and_decorations() {
464469
%1 = OpFunction %3 None %5
465470
%2 = OpFunctionParameter %7
466471
%6 = OpLabel
472+
%8 = OpLoad %4 %2
467473
OpReturn
468474
OpFunctionEnd
469475
"#,
@@ -486,11 +492,13 @@ fn names_and_decorations() {
486492
%9 = OpFunction %5 None %8
487493
%4 = OpFunctionParameter %7
488494
%10 = OpLabel
495+
%11 = OpLoad %6 %4
489496
OpReturn
490497
OpFunctionEnd
491498
%1 = OpFunction %5 None %8
492499
%2 = OpFunctionParameter %7
493-
%11 = OpLabel
500+
%12 = OpLabel
501+
%13 = OpLoad %6 %2
494502
OpReturn
495503
OpFunctionEnd"#;
496504

0 commit comments

Comments
 (0)