diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2020-06-15 13:56:11 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-15 13:56:11 -0700 |
| commit | 926e4bb05402eaf4430e52f0fd07c5da79220322 (patch) | |
| tree | a22d5e46ae911b70452565e4b6ad1f2c0c8c65bf /tests/diagnostics/void-function-returning-value.slang | |
| parent | 7e7425de730d7b3f4590c71111e22e5103b53200 (diff) | |
| parent | 3461ed41118480c3494f810cddd3cd8c735e2fbb (diff) | |
Merge branch 'master' into glsl-loop
Diffstat (limited to 'tests/diagnostics/void-function-returning-value.slang')
| -rw-r--r-- | tests/diagnostics/void-function-returning-value.slang | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/diagnostics/void-function-returning-value.slang b/tests/diagnostics/void-function-returning-value.slang new file mode 100644 index 000000000..558e37dbc --- /dev/null +++ b/tests/diagnostics/void-function-returning-value.slang @@ -0,0 +1,25 @@ +// void-function-returning-value.slang + +// Confirm that we diagnose a `void` function that returns a value. + +//DIAGNOSTIC_TEST:SIMPLE:-stage compute -entry main -target dxbc + +void good() +{ + // Explicit cast to `void` is okay. + return (void)1; +} + +void bad() +{ + // Implicit cast to `void` is not allowed. + return 1; +} + +[numthreads(1, 1, 1)] +void main( + uint3 dispatchThreadID : SV_DispatchThreadID) +{ + good(); + bad(); +}
\ No newline at end of file |
