Zcu: don't tell linkers about exports if there are compile errors
In the best case, this is redundant work, because we aren't actually going to emit a working binary this update. In the worst case, it causes bugs because the linker may not have *seen* the thing being exported due to the compile errors. Resolves: #24417
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
export fn foo() void {
|
||||
const S = struct { x: u32 = "bad default" };
|
||||
const s: S = undefined;
|
||||
_ = s;
|
||||
}
|
||||
|
||||
// This test case explicitly runs on the LLVM backend as well as self-hosted, as
|
||||
// the original bug leading to this test occurred only with the LLVM backend.
|
||||
|
||||
// error
|
||||
// backend=stage2,llvm
|
||||
//
|
||||
// :2:33: error: expected type 'u32', found '*const [11:0]u8'
|
||||
Reference in New Issue
Block a user