Files
sx/examples/1621-cimport-shadow-os-lib.sx

18 lines
669 B
Plaintext

// Pins the C2 gap (PLAN-C C0.3): a `#source` unit defining a symbol
// that ALSO lives in an OS image already loaded into the compiler
// process (libz, via libLLVM) loses under `sx run` — the JIT resolves
// globally and the earlier-loaded OS copy wins. The unit's
// zlibCompileFlags answers 0xDEADBEEF (3735928559); the OS one answers
// real flag bits. After C2 (unit-first resolution) this prints true.
#import "modules/std.sx";
zshadow :: #import c {
#include "1621-cimport-shadow-os-lib/shadow.h";
#source "1621-cimport-shadow-os-lib/shadow.c";
};
main :: () -> i32 {
print("from_unit: {}\n", zshadow.zlibCompileFlags() == 3735928559);
0
}