Skip to content

Commit b1e8ff9

Browse files
committed
[lit][SPIRV] convert shaders to lit FileCheck test
Convert the moved shaders to lit FileCheck test.
1 parent d548d90 commit b1e8ff9

File tree

49 files changed

+471
-471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+471
-471
lines changed

tools/clang/test/CodeGenSPIRV_Lit/capability.unique.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -T ps_6_2 -E main
1+
// RUN: %dxc -T ps_6_2 -E main -fcgl %s -spirv | FileCheck %s
22

33
// Make sure the same capability is not applied twice.
44
//

tools/clang/test/CodeGenSPIRV_Lit/cs.groupshared.hlsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -T cs_6_0 -E main
1+
// RUN: %dxc -T cs_6_0 -E main -fcgl %s -spirv | FileCheck %s
22

33
struct S {
44
float f1;
@@ -25,8 +25,8 @@ groupshared S s;
2525
[numthreads(8, 8, 8)]
2626
void main(uint3 tid : SV_DispatchThreadID, uint2 gid : SV_GroupID) {
2727
// Make sure pointers have the correct storage class
28-
// CHECK: {{%\d+}} = OpAccessChain %_ptr_Workgroup_float %s %int_0
29-
// CHECK: [[d0:%\d+]] = OpAccessChain %_ptr_Workgroup_v2float %d %int_0
30-
// CHECK: {{%\d+}} = OpAccessChain %_ptr_Workgroup_float [[d0]] %int_1
28+
// CHECK: {{%[0-9]+}} = OpAccessChain %_ptr_Workgroup_float %s %int_0
29+
// CHECK: [[d0:%[0-9]+]] = OpAccessChain %_ptr_Workgroup_v2float %d %int_0
30+
// CHECK: {{%[0-9]+}} = OpAccessChain %_ptr_Workgroup_float [[d0]] %int_1
3131
d[0].y = s.f1;
3232
}

tools/clang/test/CodeGenSPIRV_Lit/cs.groupshared.not-in-globals.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -T cs_6_0 -E main
1+
// RUN: %dxc -T cs_6_0 -E main -fcgl %s -spirv | FileCheck %s
22

33
// A and B are groupshared, and should not be placed in the $Globals cbuffer.
44
// myGlobalInteger is a global variable and is placed in $Globals cbuffer.

tools/clang/test/CodeGenSPIRV_Lit/decoration.unique.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -T ps_6_2 -E main -fspv-reflect
1+
// RUN: %dxc -T ps_6_2 -E main -fspv-reflect -fcgl %s -spirv | FileCheck %s
22

33
// Make sure the same decoration is not applied twice.
44
//

tools/clang/test/CodeGenSPIRV_Lit/gs.emit.hlsl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -T gs_6_0 -E main
1+
// RUN: %dxc -T gs_6_0 -E main -fcgl %s -spirv | FileCheck %s
22

33
struct GsInnerOut {
44
float2 bar : BAR;
@@ -10,7 +10,7 @@ struct GsPerVertexOut {
1010
GsInnerOut s;
1111
};
1212

13-
// CHECK: [[null:%\d+]] = OpConstantNull %GsPerVertexOut
13+
// CHECK: [[null:%[0-9]+]] = OpConstantNull %GsPerVertexOut
1414

1515
[maxvertexcount(2)]
1616
void main(in line float2 foo[2] : FOO,
@@ -26,27 +26,27 @@ void main(in line float2 foo[2] : FOO,
2626
vertex = (GsPerVertexOut)0;
2727

2828
// Write back to stage output variables
29-
// CHECK-NEXT: [[vertex:%\d+]] = OpLoad %GsPerVertexOut %vertex
30-
// CHECK-NEXT: [[pos:%\d+]] = OpCompositeExtract %v4float [[vertex]] 0
29+
// CHECK-NEXT: [[vertex:%[0-9]+]] = OpLoad %GsPerVertexOut %vertex
30+
// CHECK-NEXT: [[pos:%[0-9]+]] = OpCompositeExtract %v4float [[vertex]] 0
3131
// CHECK-NEXT: OpStore %gl_Position_0 [[pos]]
32-
// CHECK-NEXT: [[foo:%\d+]] = OpCompositeExtract %v3float [[vertex]] 1
32+
// CHECK-NEXT: [[foo:%[0-9]+]] = OpCompositeExtract %v3float [[vertex]] 1
3333
// CHECK-NEXT: OpStore %out_var_FOO [[foo]]
34-
// CHECK-NEXT: [[s:%\d+]] = OpCompositeExtract %GsInnerOut [[vertex]] 2
35-
// CHECK-NEXT: [[bar:%\d+]] = OpCompositeExtract %v2float [[s]] 0
34+
// CHECK-NEXT: [[s:%[0-9]+]] = OpCompositeExtract %GsInnerOut [[vertex]] 2
35+
// CHECK-NEXT: [[bar:%[0-9]+]] = OpCompositeExtract %v2float [[s]] 0
3636
// CHECK-NEXT: OpStore %out_var_BAR [[bar]]
3737
// CHECK-NEXT: OpEmitVertex
3838

3939
outData.Append(vertex);
4040

4141
// Write back to stage output variables
42-
// CHECK-NEXT: [[vertex:%\d+]] = OpLoad %GsPerVertexOut %vertex
43-
// CHECK-NEXT: [[pos:%\d+]] = OpCompositeExtract %v4float [[vertex]] 0
44-
// CHECK-NEXT: OpStore %gl_Position_0 [[pos]]
45-
// CHECK-NEXT: [[foo:%\d+]] = OpCompositeExtract %v3float [[vertex]] 1
46-
// CHECK-NEXT: OpStore %out_var_FOO [[foo]]
47-
// CHECK-NEXT: [[s:%\d+]] = OpCompositeExtract %GsInnerOut [[vertex]] 2
48-
// CHECK-NEXT: [[bar:%\d+]] = OpCompositeExtract %v2float [[s]] 0
49-
// CHECK-NEXT: OpStore %out_var_BAR [[bar]]
42+
// CHECK-NEXT: [[vertex_0:%[0-9]+]] = OpLoad %GsPerVertexOut %vertex
43+
// CHECK-NEXT: [[pos_0:%[0-9]+]] = OpCompositeExtract %v4float [[vertex_0]] 0
44+
// CHECK-NEXT: OpStore %gl_Position_0 [[pos_0]]
45+
// CHECK-NEXT: [[foo_0:%[0-9]+]] = OpCompositeExtract %v3float [[vertex_0]] 1
46+
// CHECK-NEXT: OpStore %out_var_FOO [[foo_0]]
47+
// CHECK-NEXT: [[s_0:%[0-9]+]] = OpCompositeExtract %GsInnerOut [[vertex_0]] 2
48+
// CHECK-NEXT: [[bar_0:%[0-9]+]] = OpCompositeExtract %v2float [[s_0]] 0
49+
// CHECK-NEXT: OpStore %out_var_BAR [[bar_0]]
5050
// CHECK-NEXT: OpEmitVertex
5151
outData.Append(vertex);
5252

tools/clang/test/CodeGenSPIRV_Lit/hs.const.output-patch.hlsl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -T hs_6_0 -E main
1+
// RUN: %dxc -T hs_6_0 -E main -fcgl %s -spirv | FileCheck %s
22

33
struct HSCtrlPt {
44
float4 ctrlPt : CONTROLPOINT;
@@ -17,13 +17,13 @@ HSPatchConstData HSPatchConstantFunc(const OutputPatch<HSCtrlPt, 3> input) {
1717

1818
// CHECK: %input = OpFunctionParameter %_ptr_Function__arr_HSCtrlPt_uint_3
1919

20-
// CHECK: [[OutCtrl0:%\d+]] = OpAccessChain %_ptr_Function_v4float %input %uint_0 %int_0
21-
// CHECK: [[input0:%\d+]] = OpLoad %v4float [[OutCtrl0]]
22-
// CHECK: [[OutCtrl1:%\d+]] = OpAccessChain %_ptr_Function_v4float %input %uint_1 %int_0
23-
// CHECK: [[input1:%\d+]] = OpLoad %v4float [[OutCtrl1]]
24-
// CHECK: [[add:%\d+]] = OpFAdd %v4float [[input0]] [[input1]]
25-
// CHECK: [[OutCtrl2:%\d+]] = OpAccessChain %_ptr_Function_v4float %input %uint_2 %int_0
26-
// CHECK: [[input2:%\d+]] = OpLoad %v4float [[OutCtrl2]]
20+
// CHECK: [[OutCtrl0:%[0-9]+]] = OpAccessChain %_ptr_Function_v4float %input %uint_0 %int_0
21+
// CHECK: [[input0:%[0-9]+]] = OpLoad %v4float [[OutCtrl0]]
22+
// CHECK: [[OutCtrl1:%[0-9]+]] = OpAccessChain %_ptr_Function_v4float %input %uint_1 %int_0
23+
// CHECK: [[input1:%[0-9]+]] = OpLoad %v4float [[OutCtrl1]]
24+
// CHECK: [[add:%[0-9]+]] = OpFAdd %v4float [[input0]] [[input1]]
25+
// CHECK: [[OutCtrl2:%[0-9]+]] = OpAccessChain %_ptr_Function_v4float %input %uint_2 %int_0
26+
// CHECK: [[input2:%[0-9]+]] = OpLoad %v4float [[OutCtrl2]]
2727
// CHECK: OpFAdd %v4float [[add]] [[input2]]
2828
data.constData = input[0].ctrlPt + input[1].ctrlPt + input[2].ctrlPt;
2929

tools/clang/test/CodeGenSPIRV_Lit/hs.pcf.view-id.1.hlsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// RUN: %dxc -T hs_6_1 -E main
1+
// RUN: %dxc -T hs_6_1 -E main -fcgl %s -spirv | FileCheck %s
22

33
// Test: Both entry point and PCF Takes ViewID
44

55
// CHECK: OpCapability MultiView
66
// CHECK: OpExtension "SPV_KHR_multiview"
77

88
// CHECK: OpEntryPoint TessellationControl
9-
// CHECK-SAME: [[viewindex:%\d+]]
9+
// CHECK-SAME: [[viewindex:%[0-9]+]]
1010

1111
// CHECK: OpDecorate [[viewindex]] BuiltIn ViewIndex
1212

13-
// CHECK: [[pcfType:%\d+]] = OpTypeFunction %HsPcfOut %_ptr_Function_uint
13+
// CHECK: [[pcfType:%[0-9]+]] = OpTypeFunction %HsPcfOut %_ptr_Function_uint
1414
// CHECK: [[viewindex]] = OpVariable %_ptr_Input_uint Input
1515

1616
#define NumOutPoints 2
@@ -46,12 +46,12 @@ HsCpOut main(InputPatch<HsCpIn, NumOutPoints> patch,
4646
HsCpOut output;
4747
output.bar = viewid;
4848
return output;
49-
// CHECK: %main = OpFunction %void None {{%\d+}}
49+
// CHECK: %main = OpFunction %void None {{%[0-9]+}}
5050
// CHECK: %param_var_viewid = OpVariable %_ptr_Function_uint Function
5151

52-
// CHECK: [[val:%\d+]] = OpLoad %uint [[viewindex]]
52+
// CHECK: [[val:%[0-9]+]] = OpLoad %uint [[viewindex]]
5353
// CHECK: OpStore %param_var_viewid [[val]]
54-
// CHECK: {{%\d+}} = OpFunctionCall %HsPcfOut %pcf %param_var_viewid
54+
// CHECK: {{%[0-9]+}} = OpFunctionCall %HsPcfOut %pcf %param_var_viewid
5555

5656
// CHECK: %pcf = OpFunction %HsPcfOut None [[pcfType]]
5757
// CHECK: %viewid = OpFunctionParameter %_ptr_Function_uint

tools/clang/test/CodeGenSPIRV_Lit/hs.pcf.view-id.2.hlsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// RUN: %dxc -T hs_6_1 -E main
1+
// RUN: %dxc -T hs_6_1 -E main -fcgl %s -spirv | FileCheck %s
22

33
// Test: Both entry point and PCF Takes ViewID
44

55
// CHECK: OpCapability MultiView
66
// CHECK: OpExtension "SPV_KHR_multiview"
77

88
// CHECK: OpEntryPoint TessellationControl
9-
// CHECK-SAME: [[viewindex:%\d+]]
9+
// CHECK-SAME: [[viewindex:%[0-9]+]]
1010

1111
// CHECK: OpDecorate [[viewindex]] BuiltIn ViewIndex
1212

13-
// CHECK: [[pcfType:%\d+]] = OpTypeFunction %HsPcfOut %_ptr_Function_uint
13+
// CHECK: [[pcfType:%[0-9]+]] = OpTypeFunction %HsPcfOut %_ptr_Function_uint
1414
// CHECK: [[viewindex]] = OpVariable %_ptr_Input_uint Input
1515

1616
#define NumOutPoints 2
@@ -45,12 +45,12 @@ HsCpOut main(InputPatch<HsCpIn, NumOutPoints> patch,
4545
HsCpOut output;
4646
output = (HsCpOut)0;
4747
return output;
48-
// CHECK: %main = OpFunction %void None {{%\d+}}
48+
// CHECK: %main = OpFunction %void None {{%[0-9]+}}
4949
// CHECK: %param_var_viewid = OpVariable %_ptr_Function_uint Function
5050

51-
// CHECK: [[val:%\d+]] = OpLoad %uint [[viewindex]]
51+
// CHECK: [[val:%[0-9]+]] = OpLoad %uint [[viewindex]]
5252
// CHECK: OpStore %param_var_viewid [[val]]
53-
// CHECK: {{%\d+}} = OpFunctionCall %HsPcfOut %pcf %param_var_viewid
53+
// CHECK: {{%[0-9]+}} = OpFunctionCall %HsPcfOut %pcf %param_var_viewid
5454

5555
// CHECK: %pcf = OpFunction %HsPcfOut None [[pcfType]]
5656
// CHECK: %viewid = OpFunctionParameter %_ptr_Function_uint

tools/clang/test/CodeGenSPIRV_Lit/namespace.functions.hlsl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -T ps_6_0 -E main
1+
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s
22

33
// CHECK: OpName %AddRed "AddRed"
44
// CHECK: OpName %A__AddRed "A::AddRed"
@@ -8,11 +8,11 @@
88
// CHECK: OpName %A__createMyStruct "A::createMyStruct"
99
// CHECK: OpName %A__myStruct_add "A::myStruct.add"
1010

11-
// CHECK: [[v3f2:%\d+]] = OpConstantComposite %v3float %float_2 %float_2 %float_2
12-
// CHECK: [[v4f0:%\d+]] = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
13-
// CHECK: [[v3f0:%\d+]] = OpConstantComposite %v3float %float_0 %float_0 %float_0
14-
// CHECK: [[v3f1:%\d+]] = OpConstantComposite %v3float %float_1 %float_1 %float_1
15-
// CHECK: [[v3f3:%\d+]] = OpConstantComposite %v3float %float_3 %float_3 %float_3
11+
// CHECK: [[v3f2:%[0-9]+]] = OpConstantComposite %v3float %float_2 %float_2 %float_2
12+
// CHECK: [[v4f0:%[0-9]+]] = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
13+
// CHECK: [[v3f0:%[0-9]+]] = OpConstantComposite %v3float %float_0 %float_0 %float_0
14+
// CHECK: [[v3f1:%[0-9]+]] = OpConstantComposite %v3float %float_1 %float_1 %float_1
15+
// CHECK: [[v3f3:%[0-9]+]] = OpConstantComposite %v3float %float_3 %float_3 %float_3
1616

1717
namespace A {
1818

@@ -44,25 +44,25 @@ float3 AddRed() { return float3(2, 2, 2); }
4444

4545
float4 main(float4 PosCS : SV_Position) : SV_Target
4646
{
47-
// CHECK: {{%\d+}} = OpFunctionCall %v3float %AddRed
47+
// CHECK: {{%[0-9]+}} = OpFunctionCall %v3float %AddRed
4848
float3 val_1 = AddRed();
49-
// CHECK: {{%\d+}} = OpFunctionCall %v3float %A__AddRed
49+
// CHECK: {{%[0-9]+}} = OpFunctionCall %v3float %A__AddRed
5050
float3 val_2 = A::AddRed();
51-
// CHECK: {{%\d+}} = OpFunctionCall %v3float %A__B__AddRed
51+
// CHECK: {{%[0-9]+}} = OpFunctionCall %v3float %A__B__AddRed
5252
float3 val_3 = A::B::AddRed();
5353

54-
// CHECK: {{%\d+}} = OpFunctionCall %v3float %A__B__AddBlue
54+
// CHECK: {{%[0-9]+}} = OpFunctionCall %v3float %A__B__AddBlue
5555
float3 val_4 = A::B::AddBlue();
56-
// CHECK: {{%\d+}} = OpFunctionCall %v3float %A__AddGreen
56+
// CHECK: {{%[0-9]+}} = OpFunctionCall %v3float %A__AddGreen
5757
float3 val_5 = A::AddGreen();
5858

5959
// CHECK: OpStore %vec3f [[v3f2]]
6060
A::B::f3 vec3f = float3(2,2,2);
6161

62-
// CHECK: [[s:%\d+]] = OpFunctionCall %myStruct %A__createMyStruct
62+
// CHECK: [[s:%[0-9]+]] = OpFunctionCall %myStruct %A__createMyStruct
6363
// CHECK: OpStore %s [[s]]
6464
A::myStruct s = A::createMyStruct();
65-
// CHECK: {{%\d+}} = OpFunctionCall %int %A__myStruct_add %s
65+
// CHECK: {{%[0-9]+}} = OpFunctionCall %int %A__myStruct_add %s
6666
int val_6 = s.add();
6767

6868
return float4(0,0,0,0);

tools/clang/test/CodeGenSPIRV_Lit/namespace.globals.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -T ps_6_0 -E main
1+
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s
22

33
// CHECK: OpMemberName %type__Globals 0 "a"
44
// CHECK: OpMemberName %type__Globals 1 "b"

0 commit comments

Comments
 (0)