authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-04-26 18:28:17+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-04-26 18:28:17+02:00
log7e6cc4c50565b6403bd2ecaabccd4ca37cb05ed2
tree45398fc74908df0dbfaf6939bb2623ddc5fc4787
parent896d93e1e6f7638afd1536c0d40d93a3faeb1356

stage2: Ensure the features set is populated


1 files changed, 4 insertions(+), 2 deletions(-)

lib/std/zig/system/linux.zig+4-2
...@@ -53,10 +53,11 @@ const SparcCpuinfoImpl = struct {...@@ -53,10 +53,11 @@ const SparcCpuinfoImpl = struct {
53 // At the moment we only support 64bit SPARC systems.53 // At the moment we only support 64bit SPARC systems.
54 assert(self.is_64bit);54 assert(self.is_64bit);
5555
56 const model = self.model orelse Target.Cpu.Model.generic(arch);
56 return Target.Cpu{57 return Target.Cpu{
57 .arch = arch,58 .arch = arch,
58 .model = self.model orelse Target.Cpu.Model.generic(arch),59 .model = model,
59 .features = Target.Cpu.Feature.Set.empty,60 .features = model.features,
60 };61 };
61 }62 }
62};63};
...@@ -75,6 +76,7 @@ test "cpuinfo: SPARC" {...@@ -75,6 +76,7 @@ test "cpuinfo: SPARC" {
7576
76 const r = SparcCpuinfoParser.parse(.sparcv9, fbs.reader()) catch unreachable;77 const r = SparcCpuinfoParser.parse(.sparcv9, fbs.reader()) catch unreachable;
77 testing.expectEqual(&Target.sparc.cpu.niagara2, r.?.model);78 testing.expectEqual(&Target.sparc.cpu.niagara2, r.?.model);
79 testing.expect(Target.sparc.cpu.niagara2.features.eql(r.?.features));
78}80}
7981
80// The generic implementation of a /proc/cpuinfo parser.82// The generic implementation of a /proc/cpuinfo parser.