[llvm-branch-commits] [lldb] [lldb][RISCV] update RISCV target features in disassembler (PR #173047)
David Spickett via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Feb 12 03:00:43 PST 2026
================
@@ -0,0 +1,32 @@
+"""
+Tests that LLDB displays an appropriate warning when .riscv.attributes contains an invalid RISC-V arch string.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestRISCVConflictingExtensions(TestBase):
+ @skipIfLLVMTargetMissing("RISCV")
+ def test_conflicting_extensions(self):
+ """
+ This test demonstrates the scenario where:
+ 1. file_with_zcd.c is compiled with rv64gc (includes C and D).
+ 2. file_with_zcmp.c is compiled with rv64imad_zcmp (includes Zcmp).
+ 3. The linker merges .riscv.attributes, creating the union: C + D + Zcmp.
+
+ The Zcmp extension is incompatible with the C extension when the D extension is enabled.
+ Therefore, the arch string contains conflicting extensions, and LLDB should
+ display an appropriate warning in this case.
+ """
+ self.build()
+
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
+ output = self.res.GetOutput()
+
+ self.assertIn(
+ output,
+ "The .riscv.attributes section contains an invalid RISC-V arch string",
----------------
DavidSpickett wrote:
For the purposes of this PR, this is all fine.
I'm just curious what the user sees here? Do they get told the reason or just that it's invalid?
https://github.com/llvm/llvm-project/pull/173047
More information about the llvm-branch-commits
mailing list