Skip to content

Commit b31595b

Browse files
committed
Give descriptive names to the test cases in dst-error.hlsl and remove the test from dst.hlsl
1 parent bd44eaa commit b31595b

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

clang/test/CodeGenHLSL/builtins/dst.hlsl

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,42 +44,27 @@ double4 dstWithDouble(double4 p1, double4 p2)
4444
return dst(p1, p2);
4545
}
4646

47-
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z9testfloatff(
47+
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z16dstWithScalarInpff(
4848
// CHECK-SAME: float noundef nofpclass(nan inf) [[P:%.*]], float noundef nofpclass(nan inf) [[Q:%.*]]) local_unnamed_addr #[[ATTR0]] {
4949
// CHECK: [[MULRES:%.*]] = fmul reassoc nnan ninf nsz arcp afn float [[Q]], [[P]]
5050
// CHECK-NEXT: [[VECINIT:%.*]] = insertelement <4 x float> <float 1.000000e+00, float poison, float poison, float poison>, float [[MULRES]], i64 1
5151
// CHECK-NEXT: [[VECINIT3:%.*]] = insertelement <4 x float> [[VECINIT]], float [[P]], i64 2
5252
// CHECK-NEXT: [[VECINIT5:%.*]] = insertelement <4 x float> [[VECINIT3]], float [[Q]], i64 3
5353
// CHECK-NEXT: ret <4 x float> [[VECINIT5]]
54-
float4 testfloat(float a, float b)
54+
float4 dstWithScalarInp(float a, float b)
5555
{
5656
return dst(a, b);
5757
}
5858

59-
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z10testfloat4fDv4_f(
59+
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z22dstWithScalarAndVectorfDv4_f(
6060
// CHECK-SAME: float noundef nofpclass(nan inf) [[P:%.*]], <4 x float> noundef nofpclass(nan inf) [[Q:%.*]]) local_unnamed_addr #[[ATTR0]] {
6161
// CHECK: [[VECEXT1:%.*]] = extractelement <4 x float> [[Q:%.*]], i64 1
6262
// CHECK-NEXT: [[MULRES:%.*]] = fmul reassoc nnan ninf nsz arcp afn float [[VECEXT1]], [[P]]
6363
// CHECK-NEXT: [[VECINIT:%.*]] = insertelement <4 x float> <float 1.000000e+00, float poison, float poison, float poison>, float [[MULRES]], i64 1
6464
// CHECK-NEXT: [[VECINIT3:%.*]] = insertelement <4 x float> [[VECINIT]], float %a, i64 2
6565
// CHECK-NEXT: [[VECINIT5:%.*]] = shufflevector <4 x float> [[VECINIT3]], <4 x float> [[Q]], <4 x i32> <i32 0, i32 1, i32 2, i32 7>
6666
// CHECK-NEXT: ret <4 x float> [[VECINIT5]]
67-
float4 testfloat4(float a, float4 b)
67+
float4 dstWithScalarAndVector(float a, float4 b)
6868
{
6969
return dst(a, b);
70-
}
71-
72-
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x half> @_Z21testRetTypeShriinkingDv4_fS_(
73-
// CHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[P:%.*]], <4 x float> noundef nofpclass(nan inf) [[Q:%.*]]) local_unnamed_addr #[[ATTR0]] {
74-
// CHECK: [[VECEXT:%.*]] = extractelement <4 x float> [[P]], i64 1
75-
// CHECK-NEXT: [[VECEXT1:%.*]] = extractelement <4 x float> [[Q]], i64 1
76-
// CHECK-NEXT: [[MULRES:%.*]] = fmul reassoc nnan ninf nsz arcp afn float [[VECEXT1]], [[VECEXT]]
77-
// CHECK-NEXT: [[VECINIT:%.*]] = insertelement <4 x float> <float 1.000000e+00, float poison, float poison, float poison>, float [[MULRES]], i64 1
78-
// CHECK-NEXT: [[VECINIT3:%.*]] = shufflevector <4 x float> [[VECINIT]], <4 x float> %a, <4 x i32> <i32 0, i32 1, i32 6, i32 poison>
79-
// CHECK-NEXT: [[VECINIT5:%.*]] = shufflevector <4 x float> %vecinit3.i, <4 x float> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
80-
// CHECK-NEXT: [[CONV:%.*]] = fptrunc reassoc nnan ninf nsz arcp afn <4 x float> [[VECINIT5]] to <4 x half>
81-
// CHECK-NEXT: ret <4 x half> [[CONV]]
82-
half4 testRetTypeShriinking(float4 a, float4 b)
83-
{
84-
return dst(a, b);
85-
}
70+
}

clang/test/SemaHLSL/BuiltIns/dst-error.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ float4 test_3_components(float3 p0, float3 p1)
3636
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: no known conversion from 'vector<float, 3>' to 'vector<double, 4>' for 1st argument}}
3737
}
3838

39-
float4 test_float2(double4 p0, float4 p1)
39+
float4 test_with_ambiguous_inp(double4 p0, float4 p1)
4040
{
4141
return dst(p0, p1);
4242
// expected-error@-1 {{call to 'dst' is ambiguous}}
4343
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}}
4444
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}}
4545
}
4646

47-
float2 test_float2(float4 p0, float4 p1)
47+
float2 test_with_return_float2(float4 p0, float4 p1)
4848
{
4949
return dst(p0, p1);
5050
// expected-warning@-1 {{implicit conversion truncates vector: 'vector<float, 4>' (vector of 4 'float' values) to 'vector<float, 2>' (vector of 2 'float' values)}}

0 commit comments

Comments
 (0)