Skip to content

Commit ff8c839

Browse files
committed
[benchmark] Support Linux/sparc64 /proc/cpuinfo
When running an LLVM 20.1.0 rc1 reltest on Linux/sparc64, all 75 of the new `libcxx/test/benchmarks` tests `FAIL`, all in the same way: ``` ``` And indeed the Linux/sparc64 /proc/cpuinfo format is completely different from the x86_64 one: the interesting line is ncpus active : 24 This patch adjusts `sysinfo.cc` to handle that. Tested on `sparc64-unknown-linux-gnu`. I hope this can go in without going via upstream which doesn't have the analogous alpha patch either.
1 parent cdeeb39 commit ff8c839

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

third-party/benchmark/src/sysinfo.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,8 @@ int GetNumCPUsImpl() {
520520
}
521521
#if defined(__alpha__)
522522
const std::string Key = "cpus detected";
523+
#elif defined(__sparc__)
524+
const std::string Key = "ncpus active";
523525
#else
524526
const std::string Key = "processor";
525527
#endif

0 commit comments

Comments
 (0)