Skip to content

Commit ddfaaed

Browse files
committed
[lldb] Added checking for RISC-V
1 parent 620c383 commit ddfaaed

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lldb/packages/Python/lldbsuite/test/lldbplatformutil.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ def getArchitecture():
240240
arch = "x86_64"
241241
if arch in ["armv7l", "armv8l"]:
242242
arch = "arm"
243+
if re.match("rv64*", arch):
244+
arch = "riscv64"
245+
if re.match("rv32*", arch):
246+
arch = "riscv32"
243247
return arch
244248

245249

lldb/packages/Python/lldbsuite/test/lldbtest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,11 @@ def isLoongArchLSX(self):
13931393
def isLoongArchLASX(self):
13941394
return self.isLoongArch() and "lasx" in self.getCPUInfo()
13951395

1396+
def isRISCV(self):
1397+
"""Returns true if the architecture is RISCV64 or RISCV32."""
1398+
arch = self.getArchitecture()
1399+
return arch in ["riscv64", "riscv32"]
1400+
13961401
def getArchitecture(self):
13971402
"""Returns the architecture in effect the test suite is running with."""
13981403
return lldbplatformutil.getArchitecture()

0 commit comments

Comments
 (0)