[clang] [clang] Enable descriptions for --print-supported-extensions (PR #66715)

David Spickett via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 20 05:33:07 PDT 2023


================
@@ -1012,11 +1013,18 @@ TEST(TargetParserTest, getARMCPUForArch) {
 
 TEST(TargetParserTest, ARMPrintSupportedExtensions) {
   std::string expected = "All available -march extensions for ARM\n\n"
-                         "\tcrc\n\tcrypto\n\tsha2";
+                         "    Name                Description\n"
+                         "    crc                 This is a long dummy description\n"
+                         "    crypto              This is a long dummy description\n"
+                         "    sha2                This is a long dummy description\n";
+
+  llvm::StringMap<llvm::StringRef> DummyMap;
+  for (const auto &E : llvm::ARM::ARCHExtNames)
+    DummyMap.insert({E.Name, "This is a long dummy description"});
----------------
DavidSpickett wrote:

Not sure what you mean.
```
DummyMap["crc"] = "This is a long dummy description";
```
Is what I am suggesting. Adjust the expected output as needed.

Do that for RISC-V and AArch64 too and there's no need for an extra method in RISC-V to get all the extension names.


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


More information about the cfe-commits mailing list