test(C0.3): pin JIT shadowing — a #source unit's zlibCompileFlags loses to the process-loaded OS libz (xfail for C2.1)

This commit is contained in:
agra
2026-06-12 16:38:02 +03:00
parent 22455c706b
commit 1009181638
6 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
// 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
}

View File

@@ -0,0 +1 @@
unsigned long zlibCompileFlags(void) { return 3735928559UL; }

View File

@@ -0,0 +1 @@
unsigned long zlibCompileFlags(void);

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
from_unit: false