From f8108a4753b1694b78d775a622fa5ce4d28d16fb Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Wed, 7 Aug 2024 16:57:02 -0400 Subject: [PATCH] tests: Add additional string tests. --- tests/hlsl/strings.shader_test | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/hlsl/strings.shader_test b/tests/hlsl/strings.shader_test index 546da7f5..1ada01e3 100644 --- a/tests/hlsl/strings.shader_test +++ b/tests/hlsl/strings.shader_test @@ -50,6 +50,48 @@ float4 main() : sv_target return 0; } +% This crashes on fxc using ps_5_0 +[pixel shader fail] +struct +{ + float a; + string b; +} apple = {1, "foobar"}; + +float4 main() : sv_target +{ + return apple.a; +} + +[pixel shader fail todo] +struct apple +{ + float a; + string b; +}; + +float4 main(struct apple ap = {1, "foobar"}) : sv_target +{ + return ap.a; +} + +[pixel shader fail todo] +float4 main(string s = "foobar") : sv_target +{ + return 0; +} + +[pixel shader fail(sm>=6) todo] +string strs[2] = {"foo", "bar"}; + +float4 main() : sv_target { return 0; } + +% Test string concatenation +[pixel shader todo] +string str = "foo" "bar" + "baz"; + +float4 main() : sv_target { return 0; } % Escape sequences are hanlded differently in DXC. % Octal, hexadecimal, and unicode escape sequences that are out of range are considered errors.