boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

commit 274d7069637174dad3a714ee34d3da529e6a1399
parent a61591aadc232259653aa21c4836012b7f06a380
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Sun, 26 Apr 2026 22:48:58 -0700

cc tests: void* <-> T* implicit conversion fixture (§K.4)

cg-cast's `to-kind = 'ptr` clause is relabel-only between any pair of
pointer types, so `void* p = &x; int *q = p;` round-trips bit-for-bit
without an explicit cast. cg-assign drives the cast from rhs->lhs at
each assignment.

Diffstat:
Atests/cc-parse/73-voidptr-impl.c | 10++++++++++
Atests/cc-parse/73-voidptr-impl.expected-exit | 1+
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/tests/cc-parse/73-voidptr-impl.c b/tests/cc-parse/73-voidptr-impl.c @@ -0,0 +1,10 @@ +/* §K.4 — void* <-> T* implicit conversion (no cast required). */ +int main(void) { + int x; + void *p; + int *q; + x = 42; + p = &x; /* int* -> void* */ + q = p; /* void* -> int* */ + return *q; /* 42 */ +} diff --git a/tests/cc-parse/73-voidptr-impl.expected-exit b/tests/cc-parse/73-voidptr-impl.expected-exit @@ -0,0 +1 @@ +42