diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-04-19 23:18:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-19 20:18:40 -0700 |
| commit | f9bcad35562c1f08638e6d3eb397d370d7d2f8f8 (patch) | |
| tree | 4e2a993689209bd5b597263922af03cb87d07c3d /tests/language-feature/capability/cpp-target-missing-cpp-impl.slang | |
| parent | 2da28c50d9c3699692eccde4b86d0b8d2323e55c (diff) | |
Initial pass to add capability declarations to stdlib intrinsics. (#3912)
Diffstat (limited to 'tests/language-feature/capability/cpp-target-missing-cpp-impl.slang')
| -rw-r--r-- | tests/language-feature/capability/cpp-target-missing-cpp-impl.slang | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/language-feature/capability/cpp-target-missing-cpp-impl.slang b/tests/language-feature/capability/cpp-target-missing-cpp-impl.slang new file mode 100644 index 000000000..a01993e8f --- /dev/null +++ b/tests/language-feature/capability/cpp-target-missing-cpp-impl.slang @@ -0,0 +1,34 @@ +//TEST:SIMPLE(filecheck=CHECK): -target cpp -entry computeMain -stage compute -allow-glsl +//TEST:SIMPLE(filecheck=CHECK_IGNORE_CAPS): -target cpp -entry computeMain -stage compute -allow-glsl -ignore-capabilities +// CHECK_IGNORE_CAPS-NOT: error 36107 +// CHECK: error 36107 + +layout(binding = 0) buffer MyBlockName +{ + int v[1]; +} outputBuffer; + +// `default` only should try to define `glsl`, but glsl target is +// present in a `case` statment. Therefore this code should error +// since cpp is missing a target for a function called +[require(glsl)] +void someInternalFunc() +{ + __target_switch + { + case glsl: + outputBuffer.v[0] = 0; + default: + outputBuffer.v[0] = 0; + } +} +void someMin() +{ + someInternalFunc(); +} + +[numthreads(1,1,1)] +void computeMain() +{ + someMin(); +} |
