diff options
| author | Yong He <yonghe@outlook.com> | 2024-12-17 22:30:22 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-17 22:30:22 -0800 |
| commit | 45af2467289bd39baff0269bb7de8a538f617dec (patch) | |
| tree | de45c041f03d0e6b8d72235edbee7b7671220c0c /tests/diagnostics/specialization-constants.slang | |
| parent | 6e24244832d9032f0993cb088af625238096b723 (diff) | |
Add verification logic on push and specialization constants. (#5887)
* Add verification logic on push and specialization constants.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'tests/diagnostics/specialization-constants.slang')
| -rw-r--r-- | tests/diagnostics/specialization-constants.slang | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/diagnostics/specialization-constants.slang b/tests/diagnostics/specialization-constants.slang new file mode 100644 index 000000000..30f3a5f95 --- /dev/null +++ b/tests/diagnostics/specialization-constants.slang @@ -0,0 +1,16 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv + +struct T { int x; int y; } + +// CHECK: ([[# @LINE+1]]): error 31218 +[vk::constant_id(1)] +const T st; + +[vk::constant_id(1)] +// CHECK: ([[# @LINE+1]]): error 31219 +static const int x = 2; + +[push_constant] +[vk::constant_id(1)] +// CHECK: ([[# @LINE+1]]): error 31220 +const int y;
\ No newline at end of file |
