[clang] [flang] [flang][Driver] Support -print-supported-extensions (PR #117402)

Tarun Prabhu via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 07:05:51 PST 2024


================
@@ -0,0 +1,34 @@
+! REQUIRES: arm-registered-target
+
+! RUN: %flang --target=arm-linux-gnu --print-supported-extensions 2>&1 \
+! RUN:   | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+! CHECK: All available -march extensions for ARM
----------------
tarunprabhu wrote:

> IMO, it would be sufficient to only test this line and refer folks to Clang for the rest. Just to avoid duplicating tests. WDYT?

I would be ok with this if the output was produced entirely from code that lived in `clang/` and we just added hooks to drive it. In this case, while the actual output comes from `llvm/`, it is driven by the `printSupportedExtensions()` function that was added in this PR to `flang/tools/flang-driver/fc1_main.cpp`. 

I think we could the driving code, like `printSupportedExtensions` to `libclangDriver` (which `flang-driver` already uses). That way, we only need to keep a single copy of the tests since it is only the one code that drives it. I could do that for this PR, and then an "effectively NFC" one do the same thing for `printSupportedCPUs()`. 

Thoughts?

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


More information about the cfe-commits mailing list