Giovanni Mascellani : tests: Test a for loop, with break and continue.

Alexandre Julliard julliard at winehq.org
Wed Sep 15 16:20:12 CDT 2021


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

Author: Giovanni Mascellani <gmascellani at codeweavers.com>
Date:   Wed Sep 15 16:00:16 2021 +0200

tests: Test a for loop, with break and continue.

Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 Makefile.am                |  2 ++
 tests/hlsl-for.shader_test | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index a5aaa35..c745dba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -64,6 +64,7 @@ vkd3d_shader_tests = \
 	tests/hlsl-clamp.shader_test \
 	tests/hlsl-comma.shader_test \
 	tests/hlsl-duplicate-modifiers.shader_test \
+	tests/hlsl-for.shader_test \
 	tests/hlsl-function-overload.shader_test \
 	tests/hlsl-invalid.shader_test \
 	tests/hlsl-majority-pragma.shader_test \
@@ -281,6 +282,7 @@ XFAIL_TESTS = \
 	tests/hlsl-clamp.shader_test \
 	tests/hlsl-comma.shader_test \
 	tests/hlsl-duplicate-modifiers.shader_test \
+	tests/hlsl-for.shader_test \
 	tests/hlsl-function-overload.shader_test \
 	tests/hlsl-majority-pragma.shader_test \
 	tests/hlsl-majority-typedef.shader_test \
diff --git a/tests/hlsl-for.shader_test b/tests/hlsl-for.shader_test
new file mode 100644
index 0000000..b133ce9
--- /dev/null
+++ b/tests/hlsl-for.shader_test
@@ -0,0 +1,22 @@
+[pixel shader]
+float4 main(float4 pos : SV_POSITION) : SV_TARGET
+{
+    int i;
+    float x = 0.0;
+    for (i = 0; i < 10; i++)
+    {
+        x += i;
+        if (pos.x == 1.5 && i == 5)
+            break;
+        if (pos.x == 2.5 && i >= 7)
+            continue;
+        x -= 1;
+    }
+    return float4(i, x, 0.0, 0.0);
+}
+
+[test]
+draw quad
+probe rgba (0, 0) (10.0, 35.0, 0.0, 0.0)
+probe rgba (1, 0) (5.0, 10.0, 0.0, 0.0)
+probe rgba (2, 0) (10.0, 38.0, 0.0, 0.0)




More information about the wine-cvs mailing list