summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics
diff options
context:
space:
mode:
authorvenkataram-nv <vedavamadath@nvidia.com>2024-09-09 22:03:27 -0700
committerGitHub <noreply@github.com>2024-09-09 22:03:27 -0700
commitd9fc7bc9b9b12e0d7c24d9159e501271161aedeb (patch)
tree32b9e60fb8dde21f24711ff4b60378ad4c839407 /tests/diagnostics
parent170558c9618252933286955c6d010c8e3735652a (diff)
Add load paths to return value check (#5042)
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/uninitialized-struct-from-constructor.slang24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/diagnostics/uninitialized-struct-from-constructor.slang b/tests/diagnostics/uninitialized-struct-from-constructor.slang
new file mode 100644
index 000000000..e3c44dca1
--- /dev/null
+++ b/tests/diagnostics/uninitialized-struct-from-constructor.slang
@@ -0,0 +1,24 @@
+//TEST:SIMPLE(filecheck=CHK): -target spirv
+
+struct TangentSpace
+{
+ static const float3 localNormal = {0, 1, 0};
+
+ float4x4 tangentTransform;
+ float3 geometryNormal;
+
+ __init(in float3 normal, in float3 inRay)
+ {
+ // Should not warn here
+ tangentTransform = getMatrix(normal, inRay);
+ geometryNormal = localNormal;
+ }
+
+ float4x4 getMatrix(in float3 normal, in float3 inRay)
+ {
+ return float4x4(0.0f);
+ }
+}
+
+//CHK-NOT: warning 41020
+//CHK-NOT: warning 41021 \ No newline at end of file