summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-03-05 17:24:44 -0500
committerGitHub <noreply@github.com>2019-03-05 17:24:44 -0500
commitdcd9e574782b87d6280f1db8ee9ba6dbb7c96c8b (patch)
treedcb900ec86c6454ff2fcbe16dea6512fdec49413 /tests/bugs
parent3d5546600fb4c585b6f6f6dcdb5e122698d1225e (diff)
Hotfix/crash invalid vk binding (#875)
* Add diagnostic for vk::binding failure. * Add test for vk::binding failure. * Add the expected output for glsl-layout-define.hlsl * * Copy over initialize expr if available when validating unchecked * Fix unloop - because now it always has one parameter (when before it could have none) * Split vk::binding and layout tests with invalid parameters * Removed the diagnostic for 2 ints expected * Added vk::binding that doesn't specify set in vk-bindings.slang * * Fix typo * Improve comments.
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/glsl-layout-define.hlsl5
-rw-r--r--tests/bugs/glsl-layout-define.hlsl.expected7
-rw-r--r--tests/bugs/glsl-vk-binding-define.hlsl5
-rw-r--r--tests/bugs/glsl-vk-binding-define.hlsl.expected7
4 files changed, 24 insertions, 0 deletions
diff --git a/tests/bugs/glsl-layout-define.hlsl b/tests/bugs/glsl-layout-define.hlsl
new file mode 100644
index 000000000..8f09fd592
--- /dev/null
+++ b/tests/bugs/glsl-layout-define.hlsl
@@ -0,0 +1,5 @@
+//TEST:SIMPLE: -profile vs_5_0
+
+layout(binding = UNDEFINED_VK_BINDING, set = UNDEFINED_VK_SET)
+Texture2DArray<float4> Float4Texture2DArrays[] : register(t0, space100);
+
diff --git a/tests/bugs/glsl-layout-define.hlsl.expected b/tests/bugs/glsl-layout-define.hlsl.expected
new file mode 100644
index 000000000..9c00916c3
--- /dev/null
+++ b/tests/bugs/glsl-layout-define.hlsl.expected
@@ -0,0 +1,7 @@
+result code = -1
+standard error = {
+tests/bugs/glsl-layout-define.hlsl(3): error 20001: unexpected identifier, expected integer literal
+tests/bugs/glsl-layout-define.hlsl(3): error 20001: unexpected ')', expected ';'
+}
+standard output = {
+}
diff --git a/tests/bugs/glsl-vk-binding-define.hlsl b/tests/bugs/glsl-vk-binding-define.hlsl
new file mode 100644
index 000000000..4e68c0f75
--- /dev/null
+++ b/tests/bugs/glsl-vk-binding-define.hlsl
@@ -0,0 +1,5 @@
+//TEST:SIMPLE: -profile vs_5_0
+
+[[vk::binding(UNDEFINED_VK_BINDING, UNDEFINED_VK_SET)]]
+Texture2DArray<float4> Float4Texture2DArrays[] : register(t0, space100);
+
diff --git a/tests/bugs/glsl-vk-binding-define.hlsl.expected b/tests/bugs/glsl-vk-binding-define.hlsl.expected
new file mode 100644
index 000000000..aaac7f0c6
--- /dev/null
+++ b/tests/bugs/glsl-vk-binding-define.hlsl.expected
@@ -0,0 +1,7 @@
+result code = -1
+standard error = {
+tests/bugs/glsl-vk-binding-define.hlsl(3): error 30015: undefined identifier 'UNDEFINED_VK_BINDING'.
+tests/bugs/glsl-vk-binding-define.hlsl(3): error 30015: undefined identifier 'UNDEFINED_VK_SET'.
+}
+standard output = {
+}