diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-20 09:28:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-20 09:28:13 -0700 |
| commit | 307315a7305e76529837fd1cdb677f534d5f539b (patch) | |
| tree | ba39e96ba2e9b3d62d1213aab2f1cc54febe451a /tests/diagnostics | |
| parent | 9936178dd3efb026bfa142512a2bf061d7a75ab5 (diff) | |
Properly check switch case. (#5341)
Diffstat (limited to 'tests/diagnostics')
| -rw-r--r-- | tests/diagnostics/constexpr-error.slang | 5 | ||||
| -rw-r--r-- | tests/diagnostics/constexpr-error.slang.expected | 20 |
2 files changed, 4 insertions, 21 deletions
diff --git a/tests/diagnostics/constexpr-error.slang b/tests/diagnostics/constexpr-error.slang index a5b98264b..0a4744b71 100644 --- a/tests/diagnostics/constexpr-error.slang +++ b/tests/diagnostics/constexpr-error.slang @@ -1,4 +1,4 @@ -//DIAGNOSTIC_TEST:SIMPLE: +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): // Failure to pass compile-time-constant data // where it is expected. @@ -24,6 +24,7 @@ float4 main() : SV_Target result += t.Sample(s, uv, int2(0,0)); // Error: data passed through cbuffer isn't compile-time constant + // CHECK: ([[# @LINE+1]]): error 40006: result += t.Sample(s, uv, offset); // Error: data computed via conditional isn't compile-time cosntant @@ -32,10 +33,12 @@ float4 main() : SV_Target { ii = 1; } + // CHECK: ([[# @LINE+1]]): error 40006: result += t.Sample(s, uv, int2(ii)); // Error: data computed in loop isn't compile-time constant // (and loop isn't unroll-able) + // CHECK: ([[# @LINE+1]]): error 40006: for(uint jj = 0; jj < uv.y; jj++) { result += t.Sample(s, uv, int2(jj)); diff --git a/tests/diagnostics/constexpr-error.slang.expected b/tests/diagnostics/constexpr-error.slang.expected deleted file mode 100644 index 6f124fe34..000000000 --- a/tests/diagnostics/constexpr-error.slang.expected +++ /dev/null @@ -1,20 +0,0 @@ -result code = -1 -standard error = { -tests/diagnostics/constexpr-error.slang(27): error 40006: expected a compile-time constant - result += t.Sample(s, uv, offset); - ^~~~~~ -tests/diagnostics/constexpr-error.slang(35): error 40006: expected a compile-time constant - result += t.Sample(s, uv, int2(ii)); - ^ -tests/diagnostics/constexpr-error.slang(39): error 40006: expected a compile-time constant - for(uint jj = 0; jj < uv.y; jj++) - ^~ -tests/diagnostics/constexpr-error.slang(41): error 40006: expected a compile-time constant - result += t.Sample(s, uv, int2(jj)); - ^ -tests/diagnostics/constexpr-error.slang(39): error 40006: expected a compile-time constant - for(uint jj = 0; jj < uv.y; jj++) - ^~ -} -standard output = { -} |
