blob: aa4ae8a39bbade4055ed650636466c0daa706af9 [file] [log] [blame]
### Compilation failed:
error: 6: loop must guarantee termination in fewer iterations
void loop_length_100000() { for (int i = 0; i < 100000; i++) {} }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 7: invalid loop expression
void infinite_loop1() { for (int i = 0; i < 1; i += 0) {} }
^^^^^^
error: 8: invalid loop expression
void infinite_loop2() { for (int i = 3; i >= 3; i += 0) {} }
^^^^^^
error: 9: loop must guarantee termination in fewer iterations
void infinite_loop3() { for (float i = 3; i >= 3; i += 1e-20) {} }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 14: loop index must not be modified within body of the loop
void index_modified() { for (int i = 0; i < 2; i++) { i++; } }
^^^^^^^^
error: 15: loop index must not be modified within body of the loop
void index_out_param() { for (int i = 0; i < 1; i++) { set(i); } }
^^^^^^^^^^^
error: 16: loop index must not be modified within body of the loop
void index_inout_param() { for (int i = 0; i < 1; i++) { inc(i); } }
^^^^^^^^^^^
error: 18: loop must guarantee termination in fewer iterations
void infinite_loop_le() { for (int i = 0; i <= 3; --i) {} }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 19: loop must guarantee termination in fewer iterations
void infinite_loop_lt() { for (int i = 0; i < 4; --i) {} }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 20: loop must guarantee termination in fewer iterations
void infinite_loop_ge() { for (int i = 3; i >= 0; ++i) {} }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 21: loop must guarantee termination in fewer iterations
void infinite_loop_gt() { for (int i = 3; i > -1; ++i) {} }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 22: invalid loop expression
void infinite_loop_eq1() { for (int i = 0; i == 0; i-=0) {} }
^^^^
error: 23: invalid loop expression
void infinite_loop_eq2() { for (int i = 1; i == 1; i+=0) {} }
^^^^
error: 24: loop must guarantee termination in fewer iterations
void infinite_loop_ne1() { for (int i = 0; i != 4; i--) {} }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 25: loop must guarantee termination in fewer iterations
void infinite_loop_ne2() { for (int i = 0; i != 4; i+=3) {} }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 errors