================
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only
-disable-llvm-passes -verify
+
+float4 test_too_many_arg(float4 p0)
+{
+ dst(p0, p0, p0);
+ // expected-error@-1 {{no matching function for call to 'dst'}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
requires 2 arguments, but 3 were provided}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
requires 2 arguments, but 3 were provided}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
requires 2 arguments, but 3 were provided}}
+}
+
+float4 test_no_second_arg(float4 p0)
+{
+ return dst(p0);
+ // expected-error@-1 {{no matching function for call to 'dst'}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
requires 2 arguments, but 1 was provided}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
requires 2 arguments, but 1 was provided}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
requires 2 arguments, but 1 was provided}}
+}
+
+float4 test_no_args()
+{
+ return dst();
+ // expected-error@-1 {{no matching function for call to 'dst'}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
requires 2 arguments, but 0 were provided}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
requires 2 arguments, but 0 were provided}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
requires 2 arguments, but 0 were provided}}
+}
+
+float4 test_3_components(float3 p0, float3 p1)
+{
+ return dst(p0, p1);
+ // expected-error@-1 {{no matching function for call to 'dst'}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
no known conversion from 'vector<[...], 3>' to 'vector<[...], 4>' for 1st
argument}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
no known conversion from 'vector<float, 3>' to 'vector<half, 4>' for 1st
argument}}
+ // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable:
no known conversion from 'vector<float, 3>' to 'vector<double, 4>' for 1st
argument}}
+}
----------------
farzonl wrote:
I think I resolved the last comment on this to quickly thinking the tests were
added. I copied your implementation into godbolt and added a few tests
https://hlsl.godbolt.org/z/exrzrP4j6
All of these should be ` error: call to 'dst' is ambiguous`:
```hlsl
export float4 test(float4 a, double b) {
return dst(a,b);
}
export float4 test(double a, float4 b) {
return dst(a,b);
}
export float4 test(double4 a, float b) {
return dst(a,b);
}
export float4 test(double4 a, float4 b) {
return dst(a,b);
}
```
https://github.com/llvm/llvm-project/pull/133828
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits