diff options
| author | Yong He <yonghe@outlook.com> | 2024-02-06 16:30:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-06 16:30:31 -0800 |
| commit | ab41d548db376c6b52869004d1b6e21b88b4c9c8 (patch) | |
| tree | 61aacddad8b8c56d77cf63ab3b650fdb28bbe0e6 /tests/language-feature/capability/capability4.slang | |
| parent | 6365e00179179f2bc0bc25af3d51d528501498d5 (diff) | |
Improve Capability System (#3555)
* Improve capability system.
* Update documentation.
* Tuning semantics.
* LSP: hierarchical diagnostics.
* Fix test.
* Fix test.
Diffstat (limited to 'tests/language-feature/capability/capability4.slang')
| -rw-r--r-- | tests/language-feature/capability/capability4.slang | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/language-feature/capability/capability4.slang b/tests/language-feature/capability/capability4.slang new file mode 100644 index 000000000..fce1f78ac --- /dev/null +++ b/tests/language-feature/capability/capability4.slang @@ -0,0 +1,25 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -entry main -stage compute + +// Check that a non-static member method implictly requires capabilities +// defined in ThisType. + +[require(hlsl)] +struct Type +{ + int member; + [require(glsl)] + [mutating] + // CHECK: ([[# @LINE+1]]): error 36108: + void f() + { + } + + [require(glsl)] + // CHECK-NOT: ([[# @LINE+1]]): error 36108: + static void f1() + { + } +} + +void main() +{} |
