AstGen: lower function addrspace expression correctly

Also, add some basic behavior tests for addrspace and linksection which
would have caught this bug in CI.
This commit is contained in:
mlugg
2024-12-27 21:21:11 +00:00
committed by Matthew Lugg
parent 5ee2816f62
commit 01081cc8e8
4 changed files with 122 additions and 14 deletions

View File

@@ -4228,7 +4228,7 @@ fn fnDecl(
if (fn_proto.ast.addrspace_expr != 0) {
astgen.restoreSourceCursor(saved_cursor);
const addrspace_ty = try addrspace_gz.addBuiltinValue(fn_proto.ast.addrspace_expr, .address_space);
const inst = try expr(&addrspace_gz, &addrspace_gz.base, .{ .rl = .{ .coerced_ty = addrspace_ty } }, fn_proto.ast.section_expr);
const inst = try expr(&addrspace_gz, &addrspace_gz.base, .{ .rl = .{ .coerced_ty = addrspace_ty } }, fn_proto.ast.addrspace_expr);
_ = try addrspace_gz.addBreakWithSrcNode(.break_inline, decl_inst, inst, decl_node);
}