upgrade llvm@22
This commit is contained in:
@@ -13,18 +13,24 @@ Foo :: struct {
|
||||
}
|
||||
|
||||
main :: () {
|
||||
a : Foo; // default value of 0
|
||||
a : Foo; // a=0, b=42, d=17 from defaults; c is `---` (undefined)
|
||||
// `c` was declared `---`, so its contents are undefined here. Pin it
|
||||
// before printing so the snapshot is deterministic — printing the raw
|
||||
// undefined byte yields whatever garbage the stack/codegen leaves.
|
||||
a.c = 0;
|
||||
print("a 0 : {}\n", a);
|
||||
a.a = 1;
|
||||
// a.c is still undefined at this point
|
||||
a.a = 1;
|
||||
a.c = 8;
|
||||
print("a 1 : {}\n", a);
|
||||
|
||||
large: f64 = 5989.5;
|
||||
b : Foo = ---; // undefined
|
||||
b : Foo = ---; // EVERY field undefined — `= ---` skips all defaults
|
||||
// Assign each field explicitly; nothing here may be read before it is
|
||||
// written, since `= ---` left the whole struct undefined.
|
||||
b.a = 1;
|
||||
b.c = xx large; // converts f64 to u8
|
||||
// expect stdout : "b: Foo{a:1, b: 42, c: 7, d: 12}"
|
||||
b.b = SPECIAL_VALUE; // re-supply the default `= ---` skipped
|
||||
b.c = xx large; // converts f64 to u8 (5989.5 -> 101)
|
||||
b.d = xx resolve(5); // converts i32 to u8 (17)
|
||||
print("b: {}", b);
|
||||
print("\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user