test an opaque record across a module boundary

A bodyless pub record ahead of a private definition exports the handle
and keeps the fields, the way flecs keeps ecs_world_t. It worked with
nothing added, and nothing said so.
This commit is contained in:
2026-10-08 11:09:42 +03:00
parent 6c8b38b7e2
commit e9960488fb
4 changed files with 33 additions and 3 deletions

View File

@@ -52,7 +52,10 @@
(test-assert "struct keeps C's meaning"
(not (emits? "(struct raw ((x int)))" "typedef")))
(test-assert "a record needs a name"
(reports? "(record ((x int)))" "record needs a name")))
(reports? "(record ((x int)))" "record needs a name"))
;; An opaque handle: the declaration is public, the fields are not
(test-assert "declared, then defined, is still defined"
(emits? "(pub record h)(record h ((x int)))" "struct h {")))
;; An ops block is mangled functions plus a registry entry. `pub'
;; inside it means what it means outside.