summaryrefslogtreecommitdiff
path: root/tests/diagnostics
diff options
context:
space:
mode:
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