diff options
| author | Yong He <yonghe@outlook.com> | 2023-02-20 10:17:00 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-20 10:17:00 -0800 |
| commit | 8b05df4187117d61491f2fdbeb7d744146ad73f7 (patch) | |
| tree | cfb17b26e9db313d0b6ce1a07efe85b35d6d1638 /tests/diagnostics/for-loop-warning.slang.expected | |
| parent | a8da735ca4e0ed49796dda164c39e21aea4a7bc6 (diff) | |
Add static for loop iteration inference. (#2659)
Diffstat (limited to 'tests/diagnostics/for-loop-warning.slang.expected')
| -rw-r--r-- | tests/diagnostics/for-loop-warning.slang.expected | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/diagnostics/for-loop-warning.slang.expected b/tests/diagnostics/for-loop-warning.slang.expected new file mode 100644 index 000000000..e37abb035 --- /dev/null +++ b/tests/diagnostics/for-loop-warning.slang.expected @@ -0,0 +1,35 @@ +result code = 0 +standard error = { +tests/diagnostics/for-loop-warning.slang(6): warning 30502: the for loop is modifiying variable 'i' in the opposite direction from loop exit condition. + for (int i = 0; i < x; i--) // warn. + ^~ +tests/diagnostics/for-loop-warning.slang(10): warning 30503: the for loop is not modifiying variable 'j' because the step size evaluates to 0. + for (int j = 0; j < 3; j += 0) // warn. + ^~ +tests/diagnostics/for-loop-warning.slang(14): warning 30500: the for loop initializes and checks variable 'j' but the side effect expression is modifying 'i'. + for (int j = 0; j < 3; i++) // warn. + ^ +tests/diagnostics/for-loop-warning.slang(19): warning 30501: the for loop initializes and modifies variable 'j' but the predicate expression is checking 'i'. + for (int j = 0; i < 4; j++) // warn. + ^ +tests/diagnostics/for-loop-warning.slang(42): warning 30505: the loop runs for 0 iterations and will be removed. + for (int i = 1; i < 0; i++) // warn + ^~~ +tests/diagnostics/for-loop-warning.slang(45): warning 30505: the loop runs for 0 iterations and will be removed. + for (int i = 1; i >= 2; i--) // warn + ^~~ +tests/diagnostics/for-loop-warning.slang(51): warning 30505: the loop runs for 0 iterations and will be removed. + for (int i = 1; i > 1; i--) // warn + ^~~ +tests/diagnostics/for-loop-warning.slang(23): warning 30504: the for loop is statically determined to terminate within 3 iterations, which is less than what [MaxIters] specifies. + [MaxIters(6)] // warn + ^~~~~~~~ +tests/diagnostics/for-loop-warning.slang(28): warning 30504: the for loop is statically determined to terminate within 2 iterations, which is less than what [MaxIters] specifies. + [MaxIters(6)] // warn + ^~~~~~~~ +tests/diagnostics/for-loop-warning.slang(32): warning 30504: the for loop is statically determined to terminate within 5 iterations, which is less than what [MaxIters] specifies. + [MaxIters(6)] // warn + ^~~~~~~~ +} +standard output = { +} |
