Zebediah Figura : tests: Add a simple test for function overloads.

Alexandre Julliard julliard at winehq.org
Wed Sep 8 15:11:20 CDT 2021


Module: vkd3d
Branch: master
Commit: 6e182e02063bf3ede75d5b9c1e1edc334dfce300
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=6e182e02063bf3ede75d5b9c1e1edc334dfce300

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Sep  1 17:20:51 2021 -0500

tests: Add a simple test for function overloads.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 Makefile.am                              |  2 ++
 tests/hlsl-function-overload.shader_test | 40 ++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index f51233c..721a6b6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,6 +58,7 @@ vkd3d_shader_tests = \
 	tests/hlsl-array-dimension.shader_test \
 	tests/hlsl-comma.shader_test \
 	tests/hlsl-duplicate-modifiers.shader_test \
+	tests/hlsl-function-overload.shader_test \
 	tests/hlsl-invalid.shader_test \
 	tests/hlsl-majority-pragma.shader_test \
 	tests/hlsl-majority-typedef.shader_test \
@@ -266,6 +267,7 @@ XFAIL_TESTS = \
 	tests/hlsl-array-dimension.shader_test \
 	tests/hlsl-comma.shader_test \
 	tests/hlsl-duplicate-modifiers.shader_test \
+	tests/hlsl-function-overload.shader_test \
 	tests/hlsl-majority-pragma.shader_test \
 	tests/hlsl-majority-typedef.shader_test \
 	tests/hlsl-nested-arrays.shader_test \
diff --git a/tests/hlsl-function-overload.shader_test b/tests/hlsl-function-overload.shader_test
new file mode 100644
index 0000000..c6e0ccf
--- /dev/null
+++ b/tests/hlsl-function-overload.shader_test
@@ -0,0 +1,40 @@
+[pixel shader fail]
+/* The same function signature cannot be defined twice. */
+
+float func(int arg)
+{
+    return 0.1;
+}
+
+float func(int arg)
+{
+    return 0.1;
+}
+
+float4 main() : sv_target
+{
+    return 0;
+}
+
+[pixel shader]
+/* Test a basic overload. */
+float func(int arg)
+{
+    return 0.1;
+}
+
+float func(uint arg)
+{
+    return 0.2;
+}
+
+float4 main() : sv_target
+{
+    int i = 1;
+    uint u = 1;
+    return float4(func(i), func(u), func(int2(1, 1)), func(uint2(1, 1)));
+}
+
+[test]
+draw quad
+probe all rgba (0.1, 0.2, 0.1, 0.2)




More information about the wine-cvs mailing list