[Lldb-commits] [lldb] [lldb][test] Make Linux cpuinfo check more robust (PR #160675)

Julian Lettner via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 25 13:50:01 PDT 2025


================
@@ -39,9 +39,16 @@ def _is_supported_linux(self, cmd_runner):
         if err.Fail() or retcode != 0:
             return output, False
 
-        # FIXME: simple substring match, e.g., test for 'sme' will be true if
-        # 'sme2' or 'smefa64' is present
-        return None, (self.cpu_info_flag in output)
+        # Assume that every processor presents the same features.
+        # Look for the first "Features: ...." line.
----------------
yln wrote:

Could use regex (we already `import re`) to make this more streamlined:
```
m = re.search(r"Features\s*: (.*)\n", cpuinfo)
feature_list = m.group(1).split()
```

This would also lend itself to future extension to include all processors features by using `re.findall()` and creating a union set of all processor feature lists.

https://github.com/llvm/llvm-project/pull/160675


More information about the lldb-commits mailing list