diff options
| author | 2026-10-14 16:58:59 +0330 | |
|---|---|---|
| committer | 2026-10-14 16:58:59 +0330 | |
| commit | 77d2f8a44e2503796a7ef5c170e11811a4f7fcfd (patch) | |
| tree | df316b685295cecaf8d587ad3bf36a245839abca /tests/conformance/5-declarations | |
| parent | bool: normalising into a bool keeps an incompatible source type, so the retur... (diff) | |
prototypes: parameters may be unnamed, int f(int, int*); (appendix b.2.13)
Diffstat (limited to 'tests/conformance/5-declarations')
| -rw-r--r-- | tests/conformance/5-declarations/fn_prototype_unnamed_pointer_params.zc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/conformance/5-declarations/fn_prototype_unnamed_pointer_params.zc b/tests/conformance/5-declarations/fn_prototype_unnamed_pointer_params.zc new file mode 100644 index 0000000..7136bee --- /dev/null +++ b/tests/conformance/5-declarations/fn_prototype_unnamed_pointer_params.zc @@ -0,0 +1,8 @@ +// expect: 7/ +// spec 5.2.1: a prototype's parameters may be unnamed, pointers included +include rt; +void pn(int x) { rt.put_n(x); rt.put_c(10); } +int f(int, int*); +fn main() { int[1] a; a[0] = 5; pn(f(2, a)); return 0; } +int f(int k, int* p) { return k + p[0]; } +// zc0: skip |
