Skip to content

Commit 365ca39

Browse files
authored
[SPIR-V] Fixup tests failing downstream (microsoft#5907)
These tests are failing in our downstream builds after migrating to Lit due to CHECK-NOTs referencing variables before they are defined. Those CHECK-NOTs have now been replaced with an `--implicit-check-not` that checks that there are no `OpDecorate ... NoContraction` instructions other than those CHECKed in the test.
1 parent e7b7b7d commit 365ca39

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

tools/clang/test/CodeGenSPIRV_Lit/decoration.no-contraction.stage-vars.hlsl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %dxc -T vs_6_0 -E main -fspv-reflect -fcgl %s -spirv | FileCheck %s
1+
// RUN: %dxc -T vs_6_0 -E main -fspv-reflect -fcgl %s -spirv | FileCheck %s --implicit-check-not "OpDecorate {{%[0-9]+}} NoContraction"
2+
3+
// The --implicit-check-not option above checks that there are no `OpDecorate ... NoContraction` instructions other than those CHECKed below.
24

35
// CHECK: OpDecorate [[aa_1:%[0-9]+]] NoContraction
46
// CHECK-NEXT: OpDecorate [[aa_plus_b_1:%[0-9]+]] NoContraction
@@ -18,12 +20,6 @@
1820
// CHECK-NEXT: OpDecorate [[cxcy_1:%[0-9]+]] NoContraction
1921
// CHECK-NEXT: OpDecorate [[cxcy_plus_dz_1:%[0-9]+]] NoContraction
2022

21-
// CHECK-NOT: OpDecorate [[cxcy_2]] NoContraction
22-
// CHECK-NOT: OpDecorate [[cxcy_plus_dz_2]] NoContraction
23-
24-
// CHECK-NOT: OpDecorate [[cxcy_3]] NoContraction
25-
// CHECK-NOT: OpDecorate [[cxcy_plus_dz_3]] NoContraction
26-
2723
// CHECK-NEXT: OpDecorate [[aa_3:%[0-9]+]] NoContraction
2824
// CHECK-NEXT: OpDecorate [[aa_plus_b_3:%[0-9]+]] NoContraction
2925

tools/clang/test/CodeGenSPIRV_Lit/decoration.no-contraction.struct.hlsl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s
1+
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s --implicit-check-not "OpDecorate {{%[0-9]+}} NoContraction"
2+
3+
// The --implicit-check-not option above checks that there are no `OpDecorate ... NoContraction` instructions other than those CHECKed below.
24

35
struct S {
46
float4 a;
@@ -18,27 +20,15 @@ struct T {
1820

1921

2022
// CHECK: OpName %w "w"
21-
// CHECK-NOT: OpDecorate [[x_mul_x_1]] NoContraction
22-
// CHECK-NOT: OpDecorate [[xx_plus_y_1]] NoContraction
2323
// CHECK-NEXT: OpDecorate [[x_mul_x_2:%[0-9]+]] NoContraction
2424
// CHECK-NEXT: OpDecorate [[xx_plus_y_2:%[0-9]+]] NoContraction
2525

26-
// CHECK-NOT: OpDecorate [[z2_mul_z3_1]] NoContraction
27-
// CHECK-NOT: OpDecorate [[z2z3_plus_z4_1]] NoContraction
2826
// CHECK-NEXT: OpDecorate [[z2_mul_z3_2:%[0-9]+]] NoContraction
2927
// CHECK-NEXT: OpDecorate [[z2z3_plus_z4_2:%[0-9]+]] NoContraction
3028

31-
// CHECK-NOT: OpDecorate [[uu_row0_1]] NoContraction
32-
// CHECK-NOT: OpDecorate [[uu_row1_1]] NoContraction
3329
// CHECK-NEXT: OpDecorate [[uu_row0_2:%[0-9]+]] NoContraction
3430
// CHECK-NEXT: OpDecorate [[uu_row1_2:%[0-9]+]] NoContraction
3531

36-
// CHECK-NOT: OpDecorate [[ww_row0_1]] NoContraction
37-
// CHECK-NOT: OpDecorate [[ww_row1_1]] NoContraction
38-
// CHECK-NOT: OpDecorate [[ww_row2_1]] NoContraction
39-
// CHECK-NOT: OpDecorate [[ww_plus_w_row0_1]] NoContraction
40-
// CHECK-NOT: OpDecorate [[ww_plus_w_row1_1]] NoContraction
41-
// CHECK-NOT: OpDecorate [[ww_plus_w_row2_1]] NoContraction
4232
// CHECK-NEXT: OpDecorate [[ww_row0_2:%[0-9]+]] NoContraction
4333
// CHECK-NEXT: OpDecorate [[ww_row1_2:%[0-9]+]] NoContraction
4434
// CHECK-NEXT: OpDecorate [[ww_row2_2:%[0-9]+]] NoContraction

tools/clang/test/CodeGenSPIRV_Lit/decoration.no-contraction.variable-reuse.hlsl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s
1+
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s --implicit-check-not "OpDecorate {{%[0-9]+}} NoContraction"
22

33
// The purpose of this test is to make sure non-precise computations are *not*
4-
// decorated with NoContraction.
4+
// decorated with NoContraction. Note the --implicit-check-not flag above.
55
//
66
// To this end, we will perform the same computation twice, once when it
77
// affects a precise variable, and once when it doesn't.
@@ -10,13 +10,9 @@ void foo(float p) { p = p + 1; }
1010

1111
// CHECK: OpName %bb_entry_0 "bb.entry"
1212
// CHECK-NEXT: OpDecorate [[first_b_plus_c:%[0-9]+]] NoContraction
13-
// CHECK-NOT: OpDecorate [[first_a_mul_b]] NoContraction
14-
// CHECK-NOT: OpDecorate [[ax_mul_bx]] NoContraction
1513
// CHECK-NEXT: OpDecorate [[second_a_mul_b:%[0-9]+]] NoContraction
16-
// CHECK-NOT: OpDecorate [[second_a_plus_b]] NoContraction
1714
// CHECK-NEXT: OpDecorate [[first_d_plus_e:%[0-9]+]] NoContraction
1815
// CHECK-NEXT: OpDecorate [[c_mul_d:%[0-9]+]] NoContraction
19-
// CHECK-NOT: OpDecorate [[second_d_plus_e]] NoContraction
2016
// CHECK-NEXT: OpDecorate [[r_plus_s:%[0-9]+]] NoContraction
2117

2218
void main() {

0 commit comments

Comments
 (0)