zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 7e6cc4c50565b6403bd2ecaabccd4ca37cb05ed2 (tree)
parent 896d93e1e6f7638afd1536c0d40d93a3faeb1356
Author: LemonBoy <thatlemon@gmail.com>
Date:   Mon, 26 Apr 2021 18:28:17 +0200

stage2: Ensure the features set is populated

Diffstat:
Mlib/std/zig/system/linux.zig | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/std/zig/system/linux.zig b/lib/std/zig/system/linux.zig @@ -53,10 +53,11 @@ const SparcCpuinfoImpl = struct { // At the moment we only support 64bit SPARC systems. assert(self.is_64bit); + const model = self.model orelse Target.Cpu.Model.generic(arch); return Target.Cpu{ .arch = arch, - .model = self.model orelse Target.Cpu.Model.generic(arch), - .features = Target.Cpu.Feature.Set.empty, + .model = model, + .features = model.features, }; } }; @@ -75,6 +76,7 @@ test "cpuinfo: SPARC" { const r = SparcCpuinfoParser.parse(.sparcv9, fbs.reader()) catch unreachable; testing.expectEqual(&Target.sparc.cpu.niagara2, r.?.model); + testing.expect(Target.sparc.cpu.niagara2.features.eql(r.?.features)); } // The generic implementation of a /proc/cpuinfo parser.