diff options
| author | 2026-10-14 15:49:27 +0330 | |
|---|---|---|
| committer | 2026-10-14 15:49:27 +0330 | |
| commit | 0ff8e8ee280e46f9f0ff06bf0958e91ff29da52e (patch) | |
| tree | f0d8b760771ca31c9e15796c06ead330299ab8e6 /tests/conformance/4-statements | |
| parent | agent/spec-conformance: unmerged work from previous session (diff) | |
conformance: port the previous agent's suite, fix six expectations, add sections 5 to 8 and appendix b, known.txt, zc0 skips, wire into test.sh
Diffstat (limited to 'tests/conformance/4-statements')
35 files changed, 39 insertions, 8 deletions
diff --git a/tests/conformance/4-statements/asm_float_literal.zc b/tests/conformance/4-statements/asm_float_literal.zc index dfb1e23..c4090e8 100644 --- a/tests/conformance/4-statements/asm_float_literal.zc +++ b/tests/conformance/4-statements/asm_float_literal.zc @@ -3,5 +3,5 @@ include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } fn pf(x) { asm { x @ #1220 } rt.put_c(10); return 0; } -fn main() { float f = asm { 1.5 }; pf(f); return 0; } +fn main() { word w = asm { 1.5 }; pf(w); return 0; } diff --git a/tests/conformance/4-statements/asm_function_name.zc b/tests/conformance/4-statements/asm_function_name.zc index 56d8bad..209e7d4 100644 --- a/tests/conformance/4-statements/asm_function_name.zc +++ b/tests/conformance/4-statements/asm_function_name.zc @@ -4,3 +4,4 @@ include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } int three() { return 3; } fn main() { fn() g = asm { three }; pn(g()); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/decl_const_local_typed_float.zc b/tests/conformance/4-statements/decl_const_local_typed_float.zc index d8470ae..c96cbbc 100644 --- a/tests/conformance/4-statements/decl_const_local_typed_float.zc +++ b/tests/conformance/4-statements/decl_const_local_typed_float.zc @@ -4,3 +4,4 @@ include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } fn pf(x) { asm { x @ #1220 } rt.put_c(10); return 0; } fn main() { const float k = 3; pf(k); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/decl_const_takes_initializer_type.zc b/tests/conformance/4-statements/decl_const_takes_initializer_type.zc index cfe2aec..1715148 100644 --- a/tests/conformance/4-statements/decl_const_takes_initializer_type.zc +++ b/tests/conformance/4-statements/decl_const_takes_initializer_type.zc @@ -4,3 +4,4 @@ include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } fn pf(x) { asm { x @ #1220 } rt.put_c(10); return 0; } fn main() { const k = 1.5; pf(k - 1); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/decl_let_array.zc b/tests/conformance/4-statements/decl_let_array.zc index 9d8d701..a0d5988 100644 --- a/tests/conformance/4-statements/decl_let_array.zc +++ b/tests/conformance/4-statements/decl_let_array.zc @@ -8,3 +8,4 @@ fn main() { pn(sizeof(a)); pn(a[9]); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/decl_typed_tag_u_hand_up.zc b/tests/conformance/4-statements/decl_typed_tag_u_hand_up.zc index 7bbf280..8756d2a 100644 --- a/tests/conformance/4-statements/decl_typed_tag_u_hand_up.zc +++ b/tests/conformance/4-statements/decl_typed_tag_u_hand_up.zc @@ -12,3 +12,4 @@ fn main() { pn(*q); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/memdebug_report.zc b/tests/conformance/4-statements/memdebug_report.zc index db81c6d..406662e 100644 --- a/tests/conformance/4-statements/memdebug_report.zc +++ b/tests/conformance/4-statements/memdebug_report.zc @@ -1,4 +1,4 @@ -// expect: 1/ +// expect: leak: line 8 3 words/107/ // spec 4.11: rt.memreport() returns the count of live recorded objects include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } @@ -8,7 +8,7 @@ fn main() { int* q = rt.new(3); int* r = rt.new(2); rt.free(r); - pn(rt.memreport()); + pn(rt.memreport() * 100 + 7); } return 0; } diff --git a/tests/conformance/4-statements/memdebug_report_line.zc b/tests/conformance/4-statements/memdebug_report_line.zc index 8ab4273..52eecba 100644 --- a/tests/conformance/4-statements/memdebug_report_line.zc +++ b/tests/conformance/4-statements/memdebug_report_line.zc @@ -1,4 +1,4 @@ -// expect error: leak: line 8 +// expect: leak: line 9 3 words/ // spec 4.11: leak: line N W words per live recorded object (N is the allocation line) include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } diff --git a/tests/conformance/4-statements/return_frees_owned_locals.zc b/tests/conformance/4-statements/return_frees_owned_locals.zc index ccff11c..773eec2 100644 --- a/tests/conformance/4-statements/return_frees_owned_locals.zc +++ b/tests/conformance/4-statements/return_frees_owned_locals.zc @@ -9,3 +9,4 @@ int f(int n) { return 0; } fn main() { pn(f(5)); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_break_in_loop_leaves_switch_only.zc b/tests/conformance/4-statements/switch_break_in_loop_leaves_switch_only.zc index d69b64a..ab55e4d 100644 --- a/tests/conformance/4-statements/switch_break_in_loop_leaves_switch_only.zc +++ b/tests/conformance/4-statements/switch_break_in_loop_leaves_switch_only.zc @@ -1,4 +1,4 @@ -// expect: 3/ +// expect: 5/ // spec 4.7.1: break in a switch inside a loop leaves the switch, not the loop include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } @@ -11,3 +11,4 @@ fn main() { pn(n); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_break_leaves_early.zc b/tests/conformance/4-statements/switch_break_leaves_early.zc index 8adbe64..a9bf11b 100644 --- a/tests/conformance/4-statements/switch_break_leaves_early.zc +++ b/tests/conformance/4-statements/switch_break_leaves_early.zc @@ -8,3 +8,4 @@ fn main() { pn(9); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_case_own_block.zc b/tests/conformance/4-statements/switch_case_own_block.zc index 16bc31f..63bdc5f 100644 --- a/tests/conformance/4-statements/switch_case_own_block.zc +++ b/tests/conformance/4-statements/switch_case_own_block.zc @@ -9,3 +9,4 @@ void t(int k) { } } fn main() { t(1); t(2); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_case_three.zc b/tests/conformance/4-statements/switch_case_three.zc index eefaced..f709abb 100644 --- a/tests/conformance/4-statements/switch_case_three.zc +++ b/tests/conformance/4-statements/switch_case_three.zc @@ -8,3 +8,4 @@ fn main() { switch (k) { case 1, 2: ps("one-two"); case 3: ps("three"); break; default: ps("d"); } return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_case_underscore.zc b/tests/conformance/4-statements/switch_case_underscore.zc index 4d05f8e..969ea7e 100644 --- a/tests/conformance/4-statements/switch_case_underscore.zc +++ b/tests/conformance/4-statements/switch_case_underscore.zc @@ -5,3 +5,4 @@ void pn(int x) { rt.put_n(x); rt.put_c(10); } void ps(char* s) { rt.put_s(s); rt.put_c(10); } void t(int k) { switch (k) { case 1: ps("one"); case _: ps("d"); } } fn main() { t(8); t(1); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_continue_continues_loop.zc b/tests/conformance/4-statements/switch_continue_continues_loop.zc index d408253..c100b0c 100644 --- a/tests/conformance/4-statements/switch_continue_continues_loop.zc +++ b/tests/conformance/4-statements/switch_continue_continues_loop.zc @@ -8,3 +8,4 @@ fn main() { } return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_default_first_position_not_matched.zc b/tests/conformance/4-statements/switch_default_first_position_not_matched.zc index 4d63ae3..b4f3283 100644 --- a/tests/conformance/4-statements/switch_default_first_position_not_matched.zc +++ b/tests/conformance/4-statements/switch_default_first_position_not_matched.zc @@ -8,3 +8,4 @@ fn main() { switch (k) { default: ps("d"); case 1: ps("one"); case 2: ps("two"); } return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_default_first_position_taken.zc b/tests/conformance/4-statements/switch_default_first_position_taken.zc index 113795f..a4ab811 100644 --- a/tests/conformance/4-statements/switch_default_first_position_taken.zc +++ b/tests/conformance/4-statements/switch_default_first_position_taken.zc @@ -8,3 +8,4 @@ fn main() { switch (k) { default: ps("d"); case 1: ps("one"); case 2: ps("two"); } return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_default_middle.zc b/tests/conformance/4-statements/switch_default_middle.zc index a390efe..f96db88 100644 --- a/tests/conformance/4-statements/switch_default_middle.zc +++ b/tests/conformance/4-statements/switch_default_middle.zc @@ -5,3 +5,4 @@ void pn(int x) { rt.put_n(x); rt.put_c(10); } void ps(char* s) { rt.put_s(s); rt.put_c(10); } void t(int k) { switch (k) { case 1: ps("one"); default: ps("d"); case 2: ps("two"); } } fn main() { t(5); t(2); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_default_runs.zc b/tests/conformance/4-statements/switch_default_runs.zc index bc42976..aa9c6a7 100644 --- a/tests/conformance/4-statements/switch_default_runs.zc +++ b/tests/conformance/4-statements/switch_default_runs.zc @@ -8,3 +8,4 @@ fn main() { switch (k) { case 1, 2: ps("one-two"); case 3: ps("three"); break; default: ps("d"); } return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_duplicate_labels_first_wins.zc b/tests/conformance/4-statements/switch_duplicate_labels_first_wins.zc index e2a2e3b..67a0204 100644 --- a/tests/conformance/4-statements/switch_duplicate_labels_first_wins.zc +++ b/tests/conformance/4-statements/switch_duplicate_labels_first_wins.zc @@ -8,3 +8,4 @@ fn main() { switch (k) { case 4: ps("first"); case 4: ps("second"); } return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_expression_evaluated_once.zc b/tests/conformance/4-statements/switch_expression_evaluated_once.zc index bf82b99..5b6e822 100644 --- a/tests/conformance/4-statements/switch_expression_evaluated_once.zc +++ b/tests/conformance/4-statements/switch_expression_evaluated_once.zc @@ -1,4 +1,4 @@ -// expect: 1/hit/ +// expect: hit1/ // spec 4.7.1 include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } @@ -8,3 +8,4 @@ fn main() { pn(i); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_label_forms.zc b/tests/conformance/4-statements/switch_label_forms.zc index ae131aa..cfe2712 100644 --- a/tests/conformance/4-statements/switch_label_forms.zc +++ b/tests/conformance/4-statements/switch_label_forms.zc @@ -1,5 +1,5 @@ // expect: neg/chr/sum/enum/ -// spec 4.7.1 and 3.14: labels are constant expressions +// spec 4.7.1 and 3.14: labels are constant expressions (no precedence: 1 + 1 * 3 is 6) include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } enum color { RED, GREEN }; @@ -12,5 +12,5 @@ void t(int k) { } rt.put_c(10); } -fn main() { t(-1); pn(0); return 0; } +fn main() { t(-1); t('a'); t(6); t(1); return 0; } // zc0: skip diff --git a/tests/conformance/4-statements/switch_nested.zc b/tests/conformance/4-statements/switch_nested.zc index 7fd9a34..d7f27f5 100644 --- a/tests/conformance/4-statements/switch_nested.zc +++ b/tests/conformance/4-statements/switch_nested.zc @@ -12,3 +12,4 @@ fn main() { } return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_no_fallthrough_k2.zc b/tests/conformance/4-statements/switch_no_fallthrough_k2.zc index 276ca30..c312236 100644 --- a/tests/conformance/4-statements/switch_no_fallthrough_k2.zc +++ b/tests/conformance/4-statements/switch_no_fallthrough_k2.zc @@ -8,3 +8,4 @@ fn main() { switch (k) { case 1, 2: ps("one-two"); case 3: ps("three"); break; default: ps("d"); } return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_no_match_no_default.zc b/tests/conformance/4-statements/switch_no_match_no_default.zc index 3021388..54c2016 100644 --- a/tests/conformance/4-statements/switch_no_match_no_default.zc +++ b/tests/conformance/4-statements/switch_no_match_no_default.zc @@ -9,3 +9,4 @@ fn main() { ps("after"); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_return_inside_case.zc b/tests/conformance/4-statements/switch_return_inside_case.zc index 7375e79..e2a0ee6 100644 --- a/tests/conformance/4-statements/switch_return_inside_case.zc +++ b/tests/conformance/4-statements/switch_return_inside_case.zc @@ -4,3 +4,4 @@ include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } int f(int k) { switch (k) { case 1: return 10; case 2: return 20; } return 0; } fn main() { pn(f(2)); pn(f(1)); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_tagged_all_covered_no_warning.zc b/tests/conformance/4-statements/switch_tagged_all_covered_no_warning.zc index 45a9846..4a3245f 100644 --- a/tests/conformance/4-statements/switch_tagged_all_covered_no_warning.zc +++ b/tests/conformance/4-statements/switch_tagged_all_covered_no_warning.zc @@ -9,3 +9,4 @@ fn main() { rt.free(s); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_tagged_circle.zc b/tests/conformance/4-statements/switch_tagged_circle.zc index b1b1c55..15bc01d 100644 --- a/tests/conformance/4-statements/switch_tagged_circle.zc +++ b/tests/conformance/4-statements/switch_tagged_circle.zc @@ -9,3 +9,4 @@ fn main() { rt.free(s); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_tagged_default_no_warning.zc b/tests/conformance/4-statements/switch_tagged_default_no_warning.zc index 0a22a7a..e7078ce 100644 --- a/tests/conformance/4-statements/switch_tagged_default_no_warning.zc +++ b/tests/conformance/4-statements/switch_tagged_default_no_warning.zc @@ -9,3 +9,4 @@ fn main() { rt.free(s); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_tagged_example.zc b/tests/conformance/4-statements/switch_tagged_example.zc index 932aefc..0099791 100644 --- a/tests/conformance/4-statements/switch_tagged_example.zc +++ b/tests/conformance/4-statements/switch_tagged_example.zc @@ -9,3 +9,4 @@ fn main() { rt.free(s); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_tagged_match_by_tag.zc b/tests/conformance/4-statements/switch_tagged_match_by_tag.zc index 9d2f7a1..3e2895c 100644 --- a/tests/conformance/4-statements/switch_tagged_match_by_tag.zc +++ b/tests/conformance/4-statements/switch_tagged_match_by_tag.zc @@ -17,3 +17,4 @@ fn main() { rt.free(a); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/switch_tagged_uncovered_warning_not_error.zc b/tests/conformance/4-statements/switch_tagged_uncovered_warning_not_error.zc index dfacc9c..2207536 100644 --- a/tests/conformance/4-statements/switch_tagged_uncovered_warning_not_error.zc +++ b/tests/conformance/4-statements/switch_tagged_uncovered_warning_not_error.zc @@ -9,3 +9,4 @@ fn main() { rt.free(s); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/unchecked_fn.zc b/tests/conformance/4-statements/unchecked_fn.zc index fa2055e..bc8acc5 100644 --- a/tests/conformance/4-statements/unchecked_fn.zc +++ b/tests/conformance/4-statements/unchecked_fn.zc @@ -4,3 +4,4 @@ include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } unchecked fn leaky() { int* p = rt.new(int); return 0; } fn main() { leaky(); pn(1); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/unchecked_stmt_block.zc b/tests/conformance/4-statements/unchecked_stmt_block.zc index eca1a38..1aabb03 100644 --- a/tests/conformance/4-statements/unchecked_stmt_block.zc +++ b/tests/conformance/4-statements/unchecked_stmt_block.zc @@ -7,3 +7,4 @@ fn main() { rt.put_s("ok"); rt.put_c(10); return 0; } +// zc0: skip diff --git a/tests/conformance/4-statements/unchecked_toplevel_rest_of_unit.zc b/tests/conformance/4-statements/unchecked_toplevel_rest_of_unit.zc index 439eca7..7d70eff 100644 --- a/tests/conformance/4-statements/unchecked_toplevel_rest_of_unit.zc +++ b/tests/conformance/4-statements/unchecked_toplevel_rest_of_unit.zc @@ -8,3 +8,4 @@ fn main() { pn(1); return 0; } +// zc0: skip |
