| author | |
| committer | |
| log | 2fefc0b5c7618012916e75e3058b381cf48f0ebb |
| tree | 186bcc9b9990924a82ffb6ec7ac7c3bdd2b58439 |
| parent | 648f592db10d3354dcf7e36264291dd82f4d0e3a |
| signature |
Closes #18052
Closes #18104
Signed-off-by: Tw <tw19881113@gmail.com>3 files changed, 16 insertions(+), 2 deletions(-)
src/Zir.zig+3-2| ... | ... | @@ -3416,8 +3416,9 @@ pub const DeclIterator = struct { |
| 3416 | 3416 | it.extra_index += 5; // src_hash(4) + line(1) |
| 3417 | 3417 | const name = it.zir.nullTerminatedString(it.zir.extra[it.extra_index]); |
| 3418 | 3418 | it.extra_index += 3; // name(1) + value(1) + doc_comment(1) |
| 3419 | it.extra_index += @as(u1, @truncate(flags >> 2)); | |
| 3420 | it.extra_index += @as(u1, @truncate(flags >> 3)); | |
| 3419 | it.extra_index += @as(u1, @truncate(flags >> 2)); // align | |
| 3420 | it.extra_index += @as(u1, @truncate(flags >> 3)); // link_section | |
| 3421 | it.extra_index += @as(u1, @truncate(flags >> 3)); // address_space | |
| 3421 | 3422 | |
| 3422 | 3423 | return Item{ |
| 3423 | 3424 | .sub_index = sub_index, |
test/behavior.zig+1| ... | ... | @@ -228,6 +228,7 @@ test { |
| 228 | 228 | _ = @import("behavior/type.zig"); |
| 229 | 229 | _ = @import("behavior/type_info.zig"); |
| 230 | 230 | _ = @import("behavior/type_info_only_pub_decls.zig"); |
| 231 | _ = @import("behavior/type_info_mul_linksection_addrspace_decls.zig"); | |
| 231 | 232 | _ = @import("behavior/typename.zig"); |
| 232 | 233 | _ = @import("behavior/undefined.zig"); |
| 233 | 234 | _ = @import("behavior/underscore.zig"); |
test/behavior/type_info_mul_linksection_addrspace_decls.zig created+12| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | const std = @import("std"); | |
| 2 | const expect = std.testing.expect; | |
| 3 | ||
| 4 | pub const a linksection("sec_a") = 0; | |
| 5 | pub const b linksection("sec_b") = 0; | |
| 6 | pub const c addrspace("space_c") = 0; | |
| 7 | pub const d addrspace("space_d") = 0; | |
| 8 | ||
| 9 | test { | |
| 10 | const decls = @typeInfo(@This()).Struct.decls; | |
| 11 | try expect(decls.len == 4); | |
| 12 | } |