Skip to content

Commit 14dccee

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

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,10 @@ 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+
return self.getArchitecture() in ["riscv64", "riscv32"]
1399+
13961400
def getArchitecture(self):
13971401
"""Returns the architecture in effect the test suite is running with."""
13981402
return lldbplatformutil.getArchitecture()

0 commit comments

Comments
 (0)