diff options
| author | James Helferty (NVIDIA) <jhelferty@nvidia.com> | 2025-09-26 13:01:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-26 17:01:38 +0000 |
| commit | e9f74ebfa83cd6aca39d7e3da2801cd47935bd1a (patch) | |
| tree | a90c1a908b337ae54938fefc45f25865c2cc9ae8 /tests/diagnostics | |
| parent | ed5dfc550e7a0b8b685a130493faa8be198fb0a5 (diff) | |
Diagnostic on use of unsupported entry point modifiers (#8487)
Generate a diagnostic warning whenever unsupported modifiers (keywords,
attributes) are found on entry point parameters. These have been
silently ignored up until now, with the parser accepting them but Slang
not actually doing anything with them.
Fixes #7151
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'tests/diagnostics')
| -rw-r--r-- | tests/diagnostics/entry-point-mod-errors.slang | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/diagnostics/entry-point-mod-errors.slang b/tests/diagnostics/entry-point-mod-errors.slang new file mode 100644 index 000000000..090ce5e33 --- /dev/null +++ b/tests/diagnostics/entry-point-mod-errors.slang @@ -0,0 +1,22 @@ +// Test to check if we emit a warning when unhandled modifiers are applied to +// entry point parameters. + +//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 +[shader("compute")] +[numthreads(1,1,1)] +void computeMain( +// CHECK: ([[#@LINE+1]]): warning 38010: {{.*}}vk::binding + [[vk::binding(5, 4)]] RWStructuredBuffer<uint> test1, +// CHECK: ([[#@LINE+1]]): warning 38010: {{.*}}vk::push_constant + [[vk::push_constant]] RWStructuredBuffer<float> test2, +// CHECK: ([[#@LINE+1]]): warning 38010: {{.*}}register + RWStructuredBuffer<float> test3 : register(r0), +// CHECK: ([[#@LINE+1]]): warning 38010: {{.*}}packoffset + float test4 : packoffset(c4), + RWBuffer<float> output +) +{ + output[0] = test2[0]; +} |
