diff --git a/tests/diagnostics/entry-point-mod-errors.slang b/tests/diagnostics/entry-point-mod-errors.slang index 090ce5e337..bf59d4f3f0 100644 --- a/tests/diagnostics/entry-point-mod-errors.slang +++ b/tests/diagnostics/entry-point-mod-errors.slang @@ -4,6 +4,7 @@ //DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target cuda //DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target metal //DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target cpp +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target spirv [shader("compute")] [numthreads(1,1,1)] void computeMain( diff --git a/tests/diagnostics/vk-binding-entry-point-param-spirv.slang b/tests/diagnostics/vk-binding-entry-point-param-spirv.slang new file mode 100644 index 0000000000..e17a0eff8d --- /dev/null +++ b/tests/diagnostics/vk-binding-entry-point-param-spirv.slang @@ -0,0 +1,18 @@ +// Test that vk::binding attributes on entry point parameters trigger a warning on spirv target +// This addresses the issue where vk::binding is ignored on entry point parameters + +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main -target spirv + +[numthreads(32, 1, 1)] +[shader("compute")] +void main( +// CHECK: ([[#@LINE+1]]): warning 38010: {{.*}}vk::binding{{.*}}a + [[vk::binding(/* binding */ 0, /* set */ 1)]] + StructuredBuffer a, +// CHECK: ([[#@LINE+1]]): warning 38010: {{.*}}vk::binding{{.*}}b + [[vk::binding(/* binding */ 3, /* set */ 2)]] + RWStructuredBuffer b, +) +{ + b[0] = a[0]; +}