diff options
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(); +} |
