[flang-commits] [clang] [flang] [flang][Driver] Support -print-supported-cpus and associated aliases (PR #117199)

Andrzej WarzyƄski via flang-commits flang-commits at lists.llvm.org
Thu Nov 21 13:12:51 PST 2024


================
@@ -0,0 +1,43 @@
+! Test --print-supported-cpus and associated aliases, -mcpu=help and
+! -mtune=help
+
+! RUN: %if x86-registered-target %{ \
+! RUN:   %flang --target=x86_64-unknown-linux-gnu --print-supported-cpus 2>&1 \
+! RUN:     | FileCheck %s --check-prefixes=X86,CHECK \
+! RUN: %}
+! RUN: %if x86-registered-target %{ \
+! RUN:   %flang --target=x86_64-unknown-linux-gnu -mcpu=help 2>&1 \
+! RUN:     | FileCheck %s --check-prefixes=X86,CHECK \
+! RUN: %}
+! RUN: %if x86-registered-target %{ \
+! RUN:   %flang --target=x86_64-unknown-linux-gnu -mtune=help 2>&1 \
+! RUN:     | FileCheck %s --check-prefixes=X86,CHECK \
+! RUN: %}
+
+! RUN: %if aarch64-registered-target %{ \
+! RUN:   %flang --target=aarch64-unknown-linux-gnu --print-supported-cpus 2>&1 \
+! RUN:     | FileCheck %s --check-prefixes=AARCH64,CHECK \
+! RUN: %}
+! RUN: %if x86-registered-target %{ \
+! RUN:   %flang --target=aarch64-unknown-linux-gnu -mcpu=help 2>&1 \
+! RUN:     | FileCheck %s --check-prefixes=AARCH64,CHECK \
+! RUN: %}
+! RUN: %if x86-registered-target %{ \
+! RUN:   %flang --target=aarch64-unknown-linux-gnu -mtune=help 2>&1 \
+! RUN:     | FileCheck %s --check-prefixes=AARCH64,CHECK \
+! RUN: %}
+
+! CHECK-NOT: warning: argument unused during compilation
+
+! X86: Target: x86_64-unknown-linux-gnu
+! X86: corei7
+
+! AARCH64: Target: aarch64-unknown-linux-gnu
+! AARCH64: cortex-a73
+! AARCH64: cortex-a75
+
+! TODO: This is a line that is printed at the end of the output. The full line
+! also includes an example that references clang. That needs to be fixed and a
+! a check added here to make sure that it references flang, not clang.
----------------
banach-space wrote:

[nit] I would add that bit with clang invocation. Once this is fixed, the test will fail and we will know that we don't need to write a new test (sometimes less is more)

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


More information about the flang-commits mailing list