[clang] [llvm] [AArch64][RISCV] Improve the tests for --print-enabled-extensions and --print-supported-extensions (PR #97829)
Tomas Matheson via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 5 07:41:22 PDT 2024
https://github.com/tmatheson-arm created https://github.com/llvm/llvm-project/pull/97829
For AArch64, we have existing tests for `--print-enabled-extensions` for each architecture. However:
- These are added to the end of the existing tests which check for `"-target-feature"`, which complicates them slightly.
- They do not test the descriptions printed next to each feature.
- Part of the output was tested separately in `TargetParserTest`.
Similarly, the tests for `--print-supported-extensions` do not give complete coverage of either the full list of features or the descriptions.
In my opinion we should be testing the full output, as this is what the user sees. Descriptions and formatting can contain errors and be accidentally broken.
These outputs are unlikely to change much in future. If they do need updated, it will be relatively easy to do because the new tests are so simple.
The new tests are autogenerated, but I am not merging the script that creates them because there isn't a good place for it. Updating these tests could be helped in future with the use of an automated test updater, something like `update_*_test_checks.py` that simply considers stdout/stderr (which would be useful for other things too). But that would need to be written.
>From 6761b566558a62533158514820dd7b9172970d15 Mon Sep 17 00:00:00 2001
From: Tomas Matheson <tomas.matheson at arm.com>
Date: Fri, 5 Jul 2024 15:22:35 +0100
Subject: [PATCH 1/3] [AArch64] Improve print-enabled-extensions tests
---
clang/test/Driver/aarch64-v81a.c | 14 ----
clang/test/Driver/aarch64-v82a.c | 18 -----
clang/test/Driver/aarch64-v83a.c | 23 -------
clang/test/Driver/aarch64-v84a.c | 34 ---------
clang/test/Driver/aarch64-v85a.c | 42 -----------
clang/test/Driver/aarch64-v86a.c | 47 -------------
clang/test/Driver/aarch64-v87a.c | 50 --------------
clang/test/Driver/aarch64-v88a.c | 53 --------------
clang/test/Driver/aarch64-v89a.c | 59 ----------------
clang/test/Driver/aarch64-v8a.c | 8 ---
clang/test/Driver/aarch64-v91a.c | 52 --------------
clang/test/Driver/aarch64-v92a.c | 55 ---------------
clang/test/Driver/aarch64-v93a.c | 58 ----------------
clang/test/Driver/aarch64-v94a.c | 64 -----------------
clang/test/Driver/aarch64-v95a.c | 67 ------------------
clang/test/Driver/aarch64-v9a.c | 47 -------------
.../print-enabled-extensions/aarch64-a64fx.c | 24 +++++++
.../aarch64-ampere1.c | 54 +++++++++++++++
.../aarch64-ampere1a.c | 56 +++++++++++++++
.../aarch64-ampere1b.c | 60 ++++++++++++++++
.../aarch64-apple-a10.c | 16 +++++
.../aarch64-apple-a11.c | 22 ++++++
.../aarch64-apple-a12.c | 27 ++++++++
.../aarch64-apple-a13.c | 40 +++++++++++
.../aarch64-apple-a14.c | 47 +++++++++++++
.../aarch64-apple-a15.c | 53 ++++++++++++++
.../aarch64-apple-a16.c | 54 +++++++++++++++
.../aarch64-apple-a17.c | 54 +++++++++++++++
.../aarch64-apple-a7.c | 11 +++
.../aarch64-apple-m4.c | 60 ++++++++++++++++
.../aarch64-armv8-a.c | 10 +++
.../aarch64-armv8-r.c | 35 ++++++++++
.../aarch64-armv8.1-a.c | 16 +++++
.../aarch64-armv8.2-a.c | 20 ++++++
.../aarch64-armv8.3-a.c | 25 +++++++
.../aarch64-armv8.4-a.c | 36 ++++++++++
.../aarch64-armv8.5-a.c | 44 ++++++++++++
.../aarch64-armv8.6-a.c | 49 +++++++++++++
.../aarch64-armv8.7-a.c | 52 ++++++++++++++
.../aarch64-armv8.8-a.c | 55 +++++++++++++++
.../aarch64-armv8.9-a.c | 61 ++++++++++++++++
.../aarch64-armv9-a.c | 49 +++++++++++++
.../aarch64-armv9.1-a.c | 54 +++++++++++++++
.../aarch64-armv9.2-a.c | 57 +++++++++++++++
.../aarch64-armv9.3-a.c | 60 ++++++++++++++++
.../aarch64-armv9.4-a.c | 66 ++++++++++++++++++
.../aarch64-armv9.5-a.c | 69 +++++++++++++++++++
.../print-enabled-extensions/aarch64-carmel.c | 21 ++++++
.../aarch64-cortex-a34.c | 12 ++++
.../aarch64-cortex-a35.c | 12 ++++
.../aarch64-cortex-a510.c | 55 +++++++++++++++
.../aarch64-cortex-a520.c | 61 ++++++++++++++++
.../aarch64-cortex-a520ae.c | 61 ++++++++++++++++
.../aarch64-cortex-a53.c | 12 ++++
.../aarch64-cortex-a55.c | 24 +++++++
.../aarch64-cortex-a57.c | 12 ++++
.../aarch64-cortex-a65.c | 25 +++++++
.../aarch64-cortex-a65ae.c | 25 +++++++
.../aarch64-cortex-a710.c | 55 +++++++++++++++
.../aarch64-cortex-a715.c | 56 +++++++++++++++
.../aarch64-cortex-a72.c | 12 ++++
.../aarch64-cortex-a720.c | 63 +++++++++++++++++
.../aarch64-cortex-a720ae.c | 63 +++++++++++++++++
.../aarch64-cortex-a725.c | 63 +++++++++++++++++
.../aarch64-cortex-a73.c | 12 ++++
.../aarch64-cortex-a75.c | 24 +++++++
.../aarch64-cortex-a76.c | 25 +++++++
.../aarch64-cortex-a76ae.c | 25 +++++++
.../aarch64-cortex-a77.c | 25 +++++++
.../aarch64-cortex-a78.c | 26 +++++++
.../aarch64-cortex-a78ae.c | 26 +++++++
.../aarch64-cortex-a78c.c | 28 ++++++++
.../aarch64-cortex-r82.c | 36 ++++++++++
.../aarch64-cortex-r82ae.c | 36 ++++++++++
.../aarch64-cortex-x1.c | 26 +++++++
.../aarch64-cortex-x1c.c | 30 ++++++++
.../aarch64-cortex-x2.c | 55 +++++++++++++++
.../aarch64-cortex-x3.c | 56 +++++++++++++++
.../aarch64-cortex-x4.c | 63 +++++++++++++++++
.../aarch64-cortex-x925.c | 63 +++++++++++++++++
.../aarch64-exynos-m3.c | 12 ++++
.../aarch64-exynos-m4.c | 23 +++++++
.../aarch64-exynos-m5.c | 23 +++++++
.../print-enabled-extensions/aarch64-falkor.c | 13 ++++
.../aarch64-generic.c | 10 +++
.../print-enabled-extensions/aarch64-kryo.c | 12 ++++
.../aarch64-neoverse-512tvb.c | 48 +++++++++++++
.../aarch64-neoverse-e1.c | 25 +++++++
.../aarch64-neoverse-n1.c | 26 +++++++
.../aarch64-neoverse-n2.c | 55 +++++++++++++++
.../aarch64-neoverse-n3.c | 64 +++++++++++++++++
.../aarch64-neoverse-v1.c | 48 +++++++++++++
.../aarch64-neoverse-v2.c | 57 +++++++++++++++
.../aarch64-neoverse-v3.c | 66 ++++++++++++++++++
.../aarch64-neoverse-v3ae.c | 66 ++++++++++++++++++
.../aarch64-oryon-1.c | 56 +++++++++++++++
.../aarch64-saphira.c | 38 ++++++++++
.../aarch64-thunderx.c | 12 ++++
.../aarch64-thunderx2t99.c | 16 +++++
.../aarch64-thunderx3t110.c | 26 +++++++
.../aarch64-thunderxt81.c | 12 ++++
.../aarch64-thunderxt83.c | 12 ++++
.../aarch64-thunderxt88.c | 12 ++++
.../print-enabled-extensions/aarch64-tsv110.c | 27 ++++++++
104 files changed, 3283 insertions(+), 691 deletions(-)
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-a64fx.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-ampere1.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-ampere1a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-ampere1b.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-a10.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-a11.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-a12.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-a13.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-a14.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-a15.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-a16.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-a17.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-a7.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-apple-m4.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8-r.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8.1-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8.2-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8.3-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8.4-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8.5-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8.6-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8.7-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8.8-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv8.9-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv9-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv9.1-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv9.2-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv9.3-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv9.4-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-armv9.5-a.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-carmel.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a34.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a35.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a510.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a520.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a520ae.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a53.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a55.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a57.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a65.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a65ae.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a710.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a715.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a72.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a720.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a720ae.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a725.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a73.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a75.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a76.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a76ae.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a77.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78ae.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78c.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82ae.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-x1.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-x1c.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-x2.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-x3.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-x4.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-cortex-x925.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-exynos-m3.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-exynos-m4.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-exynos-m5.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-falkor.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-generic.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-kryo.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-neoverse-512tvb.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-neoverse-e1.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n1.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n2.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n3.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v1.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v2.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v3.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v3ae.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-oryon-1.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-saphira.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-thunderx.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-thunderx2t99.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-thunderx3t110.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-thunderxt81.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-thunderxt83.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-thunderxt88.c
create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-tsv110.c
diff --git a/clang/test/Driver/aarch64-v81a.c b/clang/test/Driver/aarch64-v81a.c
index f3873b3ab1864..e84652ec7f11e 100644
--- a/clang/test/Driver/aarch64-v81a.c
+++ b/clang/test/Driver/aarch64-v81a.c
@@ -19,17 +19,3 @@
// RUN: %clang --target=arm64 -mlittle-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s
// RUN: %clang --target=arm64 -mlittle-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s
// ARM64-GENERICV81A: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic"{{.*}} "-target-feature" "+v8.1a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8.1-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_VHE
diff --git a/clang/test/Driver/aarch64-v82a.c b/clang/test/Driver/aarch64-v82a.c
index 318c270cad396..9dd355934c105 100644
--- a/clang/test/Driver/aarch64-v82a.c
+++ b/clang/test/Driver/aarch64-v82a.c
@@ -13,21 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-BE %s
// GENERICV82A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v8.2a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8.2-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
diff --git a/clang/test/Driver/aarch64-v83a.c b/clang/test/Driver/aarch64-v83a.c
index f35c500ee0a9b..b0ff9fb3abc24 100644
--- a/clang/test/Driver/aarch64-v83a.c
+++ b/clang/test/Driver/aarch64-v83a.c
@@ -13,26 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s
// GENERICV83A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v8.3a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8.3-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
diff --git a/clang/test/Driver/aarch64-v84a.c b/clang/test/Driver/aarch64-v84a.c
index d72c79fc14cec..030990bfe5131 100644
--- a/clang/test/Driver/aarch64-v84a.c
+++ b/clang/test/Driver/aarch64-v84a.c
@@ -13,37 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s
// GENERICV84A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v8.4a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8.4-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
diff --git a/clang/test/Driver/aarch64-v85a.c b/clang/test/Driver/aarch64-v85a.c
index 06c0989bc8e9b..3e1e921dcc013 100644
--- a/clang/test/Driver/aarch64-v85a.c
+++ b/clang/test/Driver/aarch64-v85a.c
@@ -13,45 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s
// GENERICV85A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v8.5a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8.5-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
diff --git a/clang/test/Driver/aarch64-v86a.c b/clang/test/Driver/aarch64-v86a.c
index 04d372e762a37..ba2b57979b518 100644
--- a/clang/test/Driver/aarch64-v86a.c
+++ b/clang/test/Driver/aarch64-v86a.c
@@ -13,50 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.6a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV86A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.6-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV86A-BE %s
// GENERICV86A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v8.6a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8.6-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AMUv1p1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BF16
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ECV
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FGT
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_I8MM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
diff --git a/clang/test/Driver/aarch64-v87a.c b/clang/test/Driver/aarch64-v87a.c
index b385e7cfb2ad6..ee4b68882739a 100644
--- a/clang/test/Driver/aarch64-v87a.c
+++ b/clang/test/Driver/aarch64-v87a.c
@@ -13,53 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.7a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV87A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.7-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV87A-BE %s
// GENERICV87A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v8.7a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8.7-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AMUv1p1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BF16
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ECV
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FGT
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_HCX
-// ARCH-EXTENSION: FEAT_I8MM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
-// ARCH-EXTENSION: FEAT_WFxT
-// ARCH-EXTENSION: FEAT_XS
diff --git a/clang/test/Driver/aarch64-v88a.c b/clang/test/Driver/aarch64-v88a.c
index 438796b91fff6..b680c1f567134 100644
--- a/clang/test/Driver/aarch64-v88a.c
+++ b/clang/test/Driver/aarch64-v88a.c
@@ -13,56 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.8a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV88A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.8-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV88A-BE %s
// GENERICV88A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v8.8a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8.8-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AMUv1p1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BF16
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ECV
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FGT
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_HBC
-// ARCH-EXTENSION: FEAT_HCX
-// ARCH-EXTENSION: FEAT_I8MM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MOPS
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NMI, FEAT_GICv3_NMI
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
-// ARCH-EXTENSION: FEAT_WFxT
-// ARCH-EXTENSION: FEAT_XS
diff --git a/clang/test/Driver/aarch64-v89a.c b/clang/test/Driver/aarch64-v89a.c
index 42bcb127cd3bd..903b793d046ba 100644
--- a/clang/test/Driver/aarch64-v89a.c
+++ b/clang/test/Driver/aarch64-v89a.c
@@ -12,62 +12,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.9a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV89A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv8.9-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV89A-BE %s
// GENERICV89A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v8.9a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8.9-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AMUv1p1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BF16
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CHK
-// ARCH-EXTENSION: FEAT_CLRBHB
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSSC
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ECV
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FGT
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_HBC
-// ARCH-EXTENSION: FEAT_HCX
-// ARCH-EXTENSION: FEAT_I8MM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MOPS
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NMI, FEAT_GICv3_NMI
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_PRFMSLC
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RASv2
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SPECRES2
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
-// ARCH-EXTENSION: FEAT_WFxT
-// ARCH-EXTENSION: FEAT_XS
diff --git a/clang/test/Driver/aarch64-v8a.c b/clang/test/Driver/aarch64-v8a.c
index a3b01560b22a6..d58e1c29cf2eb 100644
--- a/clang/test/Driver/aarch64-v8a.c
+++ b/clang/test/Driver/aarch64-v8a.c
@@ -19,11 +19,3 @@
// RUN: %clang --target=arm64 -mlittle-endian -march=armv8a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV8A %s
// RUN: %clang --target=arm64 -mlittle-endian -march=armv8-a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV8A %s
// ARM64-GENERICV8A: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic"{{.*}} "-target-feature" "+v8a"{{.*}} "-target-feature" "+neon"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv8-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_TRBE
diff --git a/clang/test/Driver/aarch64-v91a.c b/clang/test/Driver/aarch64-v91a.c
index c5667f8fb3bcd..80853a59d0153 100644
--- a/clang/test/Driver/aarch64-v91a.c
+++ b/clang/test/Driver/aarch64-v91a.c
@@ -13,55 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV91A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV91A-BE %s
// GENERICV91A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.1a"{{.*}} "-target-feature" "+sve" "-target-feature" "+sve2"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv9.1-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AMUv1p1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BF16
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ECV
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FGT
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FP16
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_I8MM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MEC
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_RME
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_SVE
-// ARCH-EXTENSION: FEAT_SVE2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
diff --git a/clang/test/Driver/aarch64-v92a.c b/clang/test/Driver/aarch64-v92a.c
index 6088a69312dc4..ee644cc6f3c62 100644
--- a/clang/test/Driver/aarch64-v92a.c
+++ b/clang/test/Driver/aarch64-v92a.c
@@ -13,58 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV92A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV92A-BE %s
// GENERICV92A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.2a"{{.*}} "-target-feature" "+sve" "-target-feature" "+sve2"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv9.2-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AMUv1p1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BF16
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ECV
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FGT
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FP16
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_HCX
-// ARCH-EXTENSION: FEAT_I8MM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MEC
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_RME
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_SVE
-// ARCH-EXTENSION: FEAT_SVE2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
-// ARCH-EXTENSION: FEAT_WFxT
-// ARCH-EXTENSION: FEAT_XS
diff --git a/clang/test/Driver/aarch64-v93a.c b/clang/test/Driver/aarch64-v93a.c
index 5db3034078ea8..817559e28ccf4 100644
--- a/clang/test/Driver/aarch64-v93a.c
+++ b/clang/test/Driver/aarch64-v93a.c
@@ -13,61 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV93A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV93A-BE %s
// GENERICV93A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.3a"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv9.3-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AMUv1p1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BF16
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ECV
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FGT
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FP16
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_HBC
-// ARCH-EXTENSION: FEAT_HCX
-// ARCH-EXTENSION: FEAT_I8MM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MEC
-// ARCH-EXTENSION: FEAT_MOPS
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NMI, FEAT_GICv3_NMI
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_RME
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_SVE
-// ARCH-EXTENSION: FEAT_SVE2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
-// ARCH-EXTENSION: FEAT_WFxT
-// ARCH-EXTENSION: FEAT_XS
diff --git a/clang/test/Driver/aarch64-v94a.c b/clang/test/Driver/aarch64-v94a.c
index d9f991fc95d3d..9998cc8a4a216 100644
--- a/clang/test/Driver/aarch64-v94a.c
+++ b/clang/test/Driver/aarch64-v94a.c
@@ -13,67 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV94A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV94A-BE %s
// GENERICV94A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.4a"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv9.4-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AMUv1p1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BF16
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CHK
-// ARCH-EXTENSION: FEAT_CLRBHB
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSSC
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ECV
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FGT
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FP16
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_HBC
-// ARCH-EXTENSION: FEAT_HCX
-// ARCH-EXTENSION: FEAT_I8MM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MEC
-// ARCH-EXTENSION: FEAT_MOPS
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NMI, FEAT_GICv3_NMI
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_PRFMSLC
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RASv2
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_RME
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SPECRES2
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_SVE
-// ARCH-EXTENSION: FEAT_SVE2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
-// ARCH-EXTENSION: FEAT_WFxT
-// ARCH-EXTENSION: FEAT_XS
diff --git a/clang/test/Driver/aarch64-v95a.c b/clang/test/Driver/aarch64-v95a.c
index e3e97d2bef13f..62878f2127626 100644
--- a/clang/test/Driver/aarch64-v95a.c
+++ b/clang/test/Driver/aarch64-v95a.c
@@ -25,70 +25,3 @@
// RUN: %clang -target aarch64 -march=armv9.5a+tlbiw -### -c %s 2>&1 | FileCheck -check-prefix=V95A-TLBIW %s
// RUN: %clang -target aarch64 -march=armv9.5-a+tlbiw -### -c %s 2>&1 | FileCheck -check-prefix=V95A-TLBIW %s
// V95A-TLBIW: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9.5a"{{.*}} "-target-feature" "+tlbiw"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv9.5-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AMUv1p1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BF16
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CHK
-// ARCH-EXTENSION: FEAT_CLRBHB
-// ARCH-EXTENSION: FEAT_CPA
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSSC
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ECV
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FAMINMAX
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FGT
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FP16
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_HBC
-// ARCH-EXTENSION: FEAT_HCX
-// ARCH-EXTENSION: FEAT_I8MM
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_LUT
-// ARCH-EXTENSION: FEAT_MEC
-// ARCH-EXTENSION: FEAT_MOPS
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NMI, FEAT_GICv3_NMI
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_PRFMSLC
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RASv2
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_RME
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SPECRES2
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_SVE
-// ARCH-EXTENSION: FEAT_SVE2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
-// ARCH-EXTENSION: FEAT_WFxT
-// ARCH-EXTENSION: FEAT_XS
diff --git a/clang/test/Driver/aarch64-v9a.c b/clang/test/Driver/aarch64-v9a.c
index f85e1c409010d..6732f51996d47 100644
--- a/clang/test/Driver/aarch64-v9a.c
+++ b/clang/test/Driver/aarch64-v9a.c
@@ -13,50 +13,3 @@
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV9A-BE %s
// RUN: %clang --target=aarch64_be -mbig-endian -march=armv9-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV9A-BE %s
// GENERICV9A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+v9a"{{.*}} "-target-feature" "+sve" "-target-feature" "+sve2"
-
-// ===== Architecture extensions =====
-
-// RUN: %if aarch64-registered-target %{ %clang -target aarch64 -march=armv9-a --print-enabled-extensions | FileCheck -check-prefix=ARCH-EXTENSION --implicit-check-not FEAT_ %s %}
-// ARCH-EXTENSION: FEAT_AMUv1
-// ARCH-EXTENSION: FEAT_AdvSIMD
-// ARCH-EXTENSION: FEAT_BTI
-// ARCH-EXTENSION: FEAT_CCIDX
-// ARCH-EXTENSION: FEAT_CRC32
-// ARCH-EXTENSION: FEAT_CSV2_2
-// ARCH-EXTENSION: FEAT_DIT
-// ARCH-EXTENSION: FEAT_DPB
-// ARCH-EXTENSION: FEAT_DPB2
-// ARCH-EXTENSION: FEAT_DotProd
-// ARCH-EXTENSION: FEAT_ETE
-// ARCH-EXTENSION: FEAT_FCMA
-// ARCH-EXTENSION: FEAT_FP
-// ARCH-EXTENSION: FEAT_FP16
-// ARCH-EXTENSION: FEAT_FRINTTS
-// ARCH-EXTENSION: FEAT_FlagM
-// ARCH-EXTENSION: FEAT_FlagM2
-// ARCH-EXTENSION: FEAT_JSCVT
-// ARCH-EXTENSION: FEAT_LOR
-// ARCH-EXTENSION: FEAT_LRCPC
-// ARCH-EXTENSION: FEAT_LRCPC2
-// ARCH-EXTENSION: FEAT_LSE
-// ARCH-EXTENSION: FEAT_LSE2
-// ARCH-EXTENSION: FEAT_MEC
-// ARCH-EXTENSION: FEAT_MPAM
-// ARCH-EXTENSION: FEAT_NV, FEAT_NV2
-// ARCH-EXTENSION: FEAT_PAN
-// ARCH-EXTENSION: FEAT_PAN2
-// ARCH-EXTENSION: FEAT_PAuth
-// ARCH-EXTENSION: FEAT_RAS, FEAT_RASv1p1
-// ARCH-EXTENSION: FEAT_RDM
-// ARCH-EXTENSION: FEAT_RME
-// ARCH-EXTENSION: FEAT_SB
-// ARCH-EXTENSION: FEAT_SEL2
-// ARCH-EXTENSION: FEAT_SPECRES
-// ARCH-EXTENSION: FEAT_SSBS, FEAT_SSBS2
-// ARCH-EXTENSION: FEAT_SVE
-// ARCH-EXTENSION: FEAT_SVE2
-// ARCH-EXTENSION: FEAT_TLBIOS, FEAT_TLBIRANGE
-// ARCH-EXTENSION: FEAT_TRBE
-// ARCH-EXTENSION: FEAT_TRF
-// ARCH-EXTENSION: FEAT_UAO
-// ARCH-EXTENSION: FEAT_VHE
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-a64fx.c b/clang/test/Driver/print-enabled-extensions/aarch64-a64fx.c
new file mode 100644
index 0000000000000..fc7bd14a70945
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-a64fx.c
@@ -0,0 +1,24 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=a64fx | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-ampere1.c b/clang/test/Driver/print-enabled-extensions/aarch64-ampere1.c
new file mode 100644
index 0000000000000..1001a308fe9e7
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-ampere1.c
@@ -0,0 +1,54 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=ampere1 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-ampere1a.c b/clang/test/Driver/print-enabled-extensions/aarch64-ampere1a.c
new file mode 100644
index 0000000000000..15613e7ca7a18
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-ampere1a.c
@@ -0,0 +1,56 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=ampere1a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SM4, FEAT_SM3 Enable SM3 and SM4 support
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-ampere1b.c b/clang/test/Driver/print-enabled-extensions/aarch64-ampere1b.c
new file mode 100644
index 0000000000000..73520cc7c18a1
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-ampere1b.c
@@ -0,0 +1,60 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=ampere1b | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSSC Enable Common Short Sequence Compression (CSSC) instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SM4, FEAT_SM3 Enable SM3 and SM4 support
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-a10.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a10.c
new file mode 100644
index 0000000000000..10da7640a1ea5
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a10.c
@@ -0,0 +1,16 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-a10 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-a11.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a11.c
new file mode 100644
index 0000000000000..05a547599c95c
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a11.c
@@ -0,0 +1,22 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-a11 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-a12.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a12.c
new file mode 100644
index 0000000000000..31b4b73004a0a
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a12.c
@@ -0,0 +1,27 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-a12 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-a13.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a13.c
new file mode 100644
index 0000000000000..198d0181a00ef
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a13.c
@@ -0,0 +1,40 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-a13 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-a14.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a14.c
new file mode 100644
index 0000000000000..c485fb9f1483e
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a14.c
@@ -0,0 +1,47 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-a14 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-a15.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a15.c
new file mode 100644
index 0000000000000..729f8efd01564
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a15.c
@@ -0,0 +1,53 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-a15 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-a16.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a16.c
new file mode 100644
index 0000000000000..7490739c6f4cf
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a16.c
@@ -0,0 +1,54 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-a16 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-a17.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a17.c
new file mode 100644
index 0000000000000..6b82e1ad68bef
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a17.c
@@ -0,0 +1,54 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-a17 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-a7.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a7.c
new file mode 100644
index 0000000000000..72bcc86baca4b
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-a7.c
@@ -0,0 +1,11 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-a7 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-apple-m4.c b/clang/test/Driver/print-enabled-extensions/aarch64-apple-m4.c
new file mode 100644
index 0000000000000..a6daa12b47ed2
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-apple-m4.c
@@ -0,0 +1,60 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=apple-m4 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SME Enable Scalable Matrix Extension (SME)
+// CHECK-NEXT: FEAT_SME2 Enable Scalable Matrix Extension 2 (SME2) instructions
+// CHECK-NEXT: FEAT_SME_F64F64 Enable Scalable Matrix Extension (SME) F64F64 instructions
+// CHECK-NEXT: FEAT_SME_I16I64 Enable Scalable Matrix Extension (SME) I16I64 instructions
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8-a.c
new file mode 100644
index 0000000000000..05f5abffb42a6
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8-a.c
@@ -0,0 +1,10 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8-r.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8-r.c
new file mode 100644
index 0000000000000..52f05fb97c6f0
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8-r.c
@@ -0,0 +1,35 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8-r | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8.1-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.1-a.c
new file mode 100644
index 0000000000000..b96340847fc2f
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.1-a.c
@@ -0,0 +1,16 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8.1-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8.2-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.2-a.c
new file mode 100644
index 0000000000000..a97a26dac1955
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.2-a.c
@@ -0,0 +1,20 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8.2-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8.3-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.3-a.c
new file mode 100644
index 0000000000000..ad85dbc6a1b65
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.3-a.c
@@ -0,0 +1,25 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8.3-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8.4-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.4-a.c
new file mode 100644
index 0000000000000..ef6155c8e40f7
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.4-a.c
@@ -0,0 +1,36 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8.4-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8.5-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.5-a.c
new file mode 100644
index 0000000000000..0a9daced1ebef
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.5-a.c
@@ -0,0 +1,44 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8.5-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8.6-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.6-a.c
new file mode 100644
index 0000000000000..53385ab208910
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.6-a.c
@@ -0,0 +1,49 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8.6-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8.7-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.7-a.c
new file mode 100644
index 0000000000000..dfb867bbf0c1c
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.7-a.c
@@ -0,0 +1,52 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8.7-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8.8-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.8-a.c
new file mode 100644
index 0000000000000..b6e726ecdf484
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.8-a.c
@@ -0,0 +1,55 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8.8-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HBC Enable Armv8.8-A Hinted Conditional Branches Extension
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MOPS Enable Armv8.8-A memcpy and memset acceleration instructions
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NMI, FEAT_GICv3_NMI Enable Armv8.8-A Non-maskable Interrupts
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv8.9-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.9-a.c
new file mode 100644
index 0000000000000..89df53e12d4ba
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv8.9-a.c
@@ -0,0 +1,61 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv8.9-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CHK Enable Armv8.0-A Check Feature Status Extension
+// CHECK-NEXT: FEAT_CLRBHB Enable Clear BHB instruction
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSSC Enable Common Short Sequence Compression (CSSC) instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HBC Enable Armv8.8-A Hinted Conditional Branches Extension
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MOPS Enable Armv8.8-A memcpy and memset acceleration instructions
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NMI, FEAT_GICv3_NMI Enable Armv8.8-A Non-maskable Interrupts
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PRFMSLC Enable SLC target for PRFM instruction
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RASv2 Enable ARMv8.9-A Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPECRES2 Enable Speculation Restriction Instruction
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv9-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv9-a.c
new file mode 100644
index 0000000000000..cd26351a0267c
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv9-a.c
@@ -0,0 +1,49 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv9-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv9.1-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.1-a.c
new file mode 100644
index 0000000000000..31fb009f61c28
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.1-a.c
@@ -0,0 +1,54 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv9.1-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv9.2-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.2-a.c
new file mode 100644
index 0000000000000..7f4348366db8b
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.2-a.c
@@ -0,0 +1,57 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv9.2-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv9.3-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.3-a.c
new file mode 100644
index 0000000000000..919a239b497d3
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.3-a.c
@@ -0,0 +1,60 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv9.3-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HBC Enable Armv8.8-A Hinted Conditional Branches Extension
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MOPS Enable Armv8.8-A memcpy and memset acceleration instructions
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NMI, FEAT_GICv3_NMI Enable Armv8.8-A Non-maskable Interrupts
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv9.4-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.4-a.c
new file mode 100644
index 0000000000000..f0c9c59661414
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.4-a.c
@@ -0,0 +1,66 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv9.4-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CHK Enable Armv8.0-A Check Feature Status Extension
+// CHECK-NEXT: FEAT_CLRBHB Enable Clear BHB instruction
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSSC Enable Common Short Sequence Compression (CSSC) instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HBC Enable Armv8.8-A Hinted Conditional Branches Extension
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MOPS Enable Armv8.8-A memcpy and memset acceleration instructions
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NMI, FEAT_GICv3_NMI Enable Armv8.8-A Non-maskable Interrupts
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PRFMSLC Enable SLC target for PRFM instruction
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RASv2 Enable ARMv8.9-A Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPECRES2 Enable Speculation Restriction Instruction
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv9.5-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.5-a.c
new file mode 100644
index 0000000000000..1550b43cae5cd
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.5-a.c
@@ -0,0 +1,69 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -march=armv9.5-a | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CHK Enable Armv8.0-A Check Feature Status Extension
+// CHECK-NEXT: FEAT_CLRBHB Enable Clear BHB instruction
+// CHECK-NEXT: FEAT_CPA Enable Armv9.5-A Checked Pointer Arithmetic
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSSC Enable Common Short Sequence Compression (CSSC) instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FAMINMAX Enable FAMIN and FAMAX instructions
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HBC Enable Armv8.8-A Hinted Conditional Branches Extension
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_LUT Enable Lookup Table instructions
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MOPS Enable Armv8.8-A memcpy and memset acceleration instructions
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NMI, FEAT_GICv3_NMI Enable Armv8.8-A Non-maskable Interrupts
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PRFMSLC Enable SLC target for PRFM instruction
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RASv2 Enable ARMv8.9-A Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPECRES2 Enable Speculation Restriction Instruction
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-carmel.c b/clang/test/Driver/print-enabled-extensions/aarch64-carmel.c
new file mode 100644
index 0000000000000..8f2b1f3f42c30
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-carmel.c
@@ -0,0 +1,21 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=carmel | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a34.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a34.c
new file mode 100644
index 0000000000000..6299ed620370c
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a34.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a34 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a35.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a35.c
new file mode 100644
index 0000000000000..cdf446463c647
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a35.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a35 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a510.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a510.c
new file mode 100644
index 0000000000000..54068338a9858
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a510.c
@@ -0,0 +1,55 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a510 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a520.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a520.c
new file mode 100644
index 0000000000000..29cec5d2d73af
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a520.c
@@ -0,0 +1,61 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a520 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a520ae.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a520ae.c
new file mode 100644
index 0000000000000..0f3b181c395c6
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a520ae.c
@@ -0,0 +1,61 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a520ae | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a53.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a53.c
new file mode 100644
index 0000000000000..d978321011032
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a53.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a53 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a55.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a55.c
new file mode 100644
index 0000000000000..6ddb7cedcd2df
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a55.c
@@ -0,0 +1,24 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a55 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a57.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a57.c
new file mode 100644
index 0000000000000..ddd0492e5d33b
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a57.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a57 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a65.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a65.c
new file mode 100644
index 0000000000000..49025bd615d8f
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a65.c
@@ -0,0 +1,25 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a65 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a65ae.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a65ae.c
new file mode 100644
index 0000000000000..632c8d1fae9e5
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a65ae.c
@@ -0,0 +1,25 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a65ae | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a710.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a710.c
new file mode 100644
index 0000000000000..f073db5ea7441
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a710.c
@@ -0,0 +1,55 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a710 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a715.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a715.c
new file mode 100644
index 0000000000000..359ca76a243fb
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a715.c
@@ -0,0 +1,56 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a715 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a72.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a72.c
new file mode 100644
index 0000000000000..548bd395cd2f1
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a72.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a72 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a720.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a720.c
new file mode 100644
index 0000000000000..41fa2756188b7
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a720.c
@@ -0,0 +1,63 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a720 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPEv1p2 Enable extra register in the Statistical Profiling Extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a720ae.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a720ae.c
new file mode 100644
index 0000000000000..b9ac21aa256f7
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a720ae.c
@@ -0,0 +1,63 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a720ae | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPEv1p2 Enable extra register in the Statistical Profiling Extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a725.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a725.c
new file mode 100644
index 0000000000000..823319f108e28
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a725.c
@@ -0,0 +1,63 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a725 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPEv1p2 Enable extra register in the Statistical Profiling Extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a73.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a73.c
new file mode 100644
index 0000000000000..b0beca829a94e
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a73.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a73 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a75.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a75.c
new file mode 100644
index 0000000000000..df0e13653a65e
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a75.c
@@ -0,0 +1,24 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a75 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a76.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a76.c
new file mode 100644
index 0000000000000..6e2ca4a7cc18f
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a76.c
@@ -0,0 +1,25 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a76 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a76ae.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a76ae.c
new file mode 100644
index 0000000000000..a58da56fc6661
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a76ae.c
@@ -0,0 +1,25 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a76ae | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a77.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a77.c
new file mode 100644
index 0000000000000..8e81465ea3ad5
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a77.c
@@ -0,0 +1,25 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a77 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78.c
new file mode 100644
index 0000000000000..32a21c1bde159
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78.c
@@ -0,0 +1,26 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a78 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78ae.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78ae.c
new file mode 100644
index 0000000000000..309cd8715a43f
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78ae.c
@@ -0,0 +1,26 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a78ae | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78c.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78c.c
new file mode 100644
index 0000000000000..30725109fdda9
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-a78c.c
@@ -0,0 +1,28 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-a78c | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82.c
new file mode 100644
index 0000000000000..63368f32da8cd
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82.c
@@ -0,0 +1,36 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-r82 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82ae.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82ae.c
new file mode 100644
index 0000000000000..e9ac390283ad4
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-r82ae.c
@@ -0,0 +1,36 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-r82ae | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x1.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x1.c
new file mode 100644
index 0000000000000..e2d42447db26a
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x1.c
@@ -0,0 +1,26 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-x1 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x1c.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x1c.c
new file mode 100644
index 0000000000000..0d8b33f075c2c
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x1c.c
@@ -0,0 +1,30 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-x1c | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x2.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x2.c
new file mode 100644
index 0000000000000..9a8a4f41c1310
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x2.c
@@ -0,0 +1,55 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-x2 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x3.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x3.c
new file mode 100644
index 0000000000000..7fd1cc9de7821
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x3.c
@@ -0,0 +1,56 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-x3 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x4.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x4.c
new file mode 100644
index 0000000000000..10b13a0052c76
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x4.c
@@ -0,0 +1,63 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-x4 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPEv1p2 Enable extra register in the Statistical Profiling Extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x925.c b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x925.c
new file mode 100644
index 0000000000000..09ceb0b358b91
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-cortex-x925.c
@@ -0,0 +1,63 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=cortex-x925 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPEv1p2 Enable extra register in the Statistical Profiling Extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-exynos-m3.c b/clang/test/Driver/print-enabled-extensions/aarch64-exynos-m3.c
new file mode 100644
index 0000000000000..2945fa20a9821
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-exynos-m3.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=exynos-m3 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-exynos-m4.c b/clang/test/Driver/print-enabled-extensions/aarch64-exynos-m4.c
new file mode 100644
index 0000000000000..2739ac4be74e3
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-exynos-m4.c
@@ -0,0 +1,23 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=exynos-m4 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-exynos-m5.c b/clang/test/Driver/print-enabled-extensions/aarch64-exynos-m5.c
new file mode 100644
index 0000000000000..4856a6b338a74
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-exynos-m5.c
@@ -0,0 +1,23 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=exynos-m5 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-falkor.c b/clang/test/Driver/print-enabled-extensions/aarch64-falkor.c
new file mode 100644
index 0000000000000..ea867f2bf3f38
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-falkor.c
@@ -0,0 +1,13 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=falkor | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-generic.c b/clang/test/Driver/print-enabled-extensions/aarch64-generic.c
new file mode 100644
index 0000000000000..25856f120aa37
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-generic.c
@@ -0,0 +1,10 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=generic | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-kryo.c b/clang/test/Driver/print-enabled-extensions/aarch64-kryo.c
new file mode 100644
index 0000000000000..3124f85d097d9
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-kryo.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=kryo | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-512tvb.c b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-512tvb.c
new file mode 100644
index 0000000000000..64e0f2eb4f55a
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-512tvb.c
@@ -0,0 +1,48 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=neoverse-512tvb | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SM4, FEAT_SM3 Enable SM3 and SM4 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-e1.c b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-e1.c
new file mode 100644
index 0000000000000..cdb67fe513469
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-e1.c
@@ -0,0 +1,25 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=neoverse-e1 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n1.c b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n1.c
new file mode 100644
index 0000000000000..beb5573323618
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n1.c
@@ -0,0 +1,26 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=neoverse-n1 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n2.c b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n2.c
new file mode 100644
index 0000000000000..31ca041fc692f
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n2.c
@@ -0,0 +1,55 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=neoverse-n2 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n3.c b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n3.c
new file mode 100644
index 0000000000000..2662adf677691
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-n3.c
@@ -0,0 +1,64 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=neoverse-n3 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPEv1p2 Enable extra register in the Statistical Profiling Extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v1.c b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v1.c
new file mode 100644
index 0000000000000..467847a575b28
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v1.c
@@ -0,0 +1,48 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=neoverse-v1 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SM4, FEAT_SM3 Enable SM3 and SM4 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v2.c b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v2.c
new file mode 100644
index 0000000000000..420be38d454f5
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v2.c
@@ -0,0 +1,57 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=neoverse-v2 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v3.c b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v3.c
new file mode 100644
index 0000000000000..d9a7d2f570cd2
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v3.c
@@ -0,0 +1,66 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=neoverse-v3 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BRBE Enable Branch Record Buffer Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA Enable Armv8.7-A LD64B/ST64B Accelerator Extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPEv1p2 Enable extra register in the Statistical Profiling Extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v3ae.c b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v3ae.c
new file mode 100644
index 0000000000000..21686e5631cb7
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-neoverse-v3ae.c
@@ -0,0 +1,66 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=neoverse-v3ae | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BRBE Enable Branch Record Buffer Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_ETE Enable Embedded Trace Extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_HCX Enable Armv8.7-A HCRX_EL2 system register
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA Enable Armv8.7-A LD64B/ST64B Accelerator Extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SPEv1p2 Enable extra register in the Statistical Profiling Extension
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRBE Enable Trace Buffer Extension
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
+// CHECK-NEXT: FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
+// CHECK-NEXT: FEAT_XS Enable Armv8.7-A limited-TLB-maintenance instruction
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-oryon-1.c b/clang/test/Driver/print-enabled-extensions/aarch64-oryon-1.c
new file mode 100644
index 0000000000000..7a9b838b08f3f
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-oryon-1.c
@@ -0,0 +1,56 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=oryon-1 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AMUv1p1 Enable v8.6-A Activity Monitors Virtualization support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_CSV2_2 Enable architectural speculation restriction
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DPB2 Enable v8.5 Cache Clean to Point of Deep Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_ECV Enable enhanced counter virtualization extension
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FGT Enable fine grained virtualization traps extension
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_FRINTTS Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_FlagM2 Enable alternative NZCV format for floating point comparisons
+// CHECK-NEXT: FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: FEAT_SM4, FEAT_SM3 Enable SM3 and SM4 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-saphira.c b/clang/test/Driver/print-enabled-extensions/aarch64-saphira.c
new file mode 100644
index 0000000000000..dcea3cf3cedf1
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-saphira.c
@@ -0,0 +1,38 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=saphira | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AMUv1 Enable v8.4-A Activity Monitors extension
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
+// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
+// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_TLBIOS, FEAT_TLBIRANGE Enable v8.4-A TLB Range and Maintenance Instructions
+// CHECK-NEXT: FEAT_TRF Enable v8.4-A Trace extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-thunderx.c b/clang/test/Driver/print-enabled-extensions/aarch64-thunderx.c
new file mode 100644
index 0000000000000..e01903fe6be2f
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-thunderx.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=thunderx | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-thunderx2t99.c b/clang/test/Driver/print-enabled-extensions/aarch64-thunderx2t99.c
new file mode 100644
index 0000000000000..301b8ea880836
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-thunderx2t99.c
@@ -0,0 +1,16 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=thunderx2t99 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-thunderx3t110.c b/clang/test/Driver/print-enabled-extensions/aarch64-thunderx3t110.c
new file mode 100644
index 0000000000000..6396cc70579e9
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-thunderx3t110.c
@@ -0,0 +1,26 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=thunderx3t110 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CCIDX Enable v8.3-A Extend of the CCSIDR number of sets
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-thunderxt81.c b/clang/test/Driver/print-enabled-extensions/aarch64-thunderxt81.c
new file mode 100644
index 0000000000000..2f10f3925d47d
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-thunderxt81.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=thunderxt81 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-thunderxt83.c b/clang/test/Driver/print-enabled-extensions/aarch64-thunderxt83.c
new file mode 100644
index 0000000000000..2e84250d346d4
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-thunderxt83.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=thunderxt83 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-thunderxt88.c b/clang/test/Driver/print-enabled-extensions/aarch64-thunderxt88.c
new file mode 100644
index 0000000000000..b5fe390cb7284
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-thunderxt88.c
@@ -0,0 +1,12 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=thunderxt88 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-tsv110.c b/clang/test/Driver/print-enabled-extensions/aarch64-tsv110.c
new file mode 100644
index 0000000000000..8617fbad2afa1
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-tsv110.c
@@ -0,0 +1,27 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64 --print-enabled-extensions -mcpu=tsv110 | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: Extensions enabled for the given AArch64 target
+// CHECK-EMPTY:
+// CHECK-NEXT: Architecture Feature(s) Description
+// CHECK-NEXT: FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: FEAT_DPB Enable v8.2 data Cache Clean to Point of Persistence
+// CHECK-NEXT: FEAT_DotProd Enable dot product support
+// CHECK-NEXT: FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: FEAT_FP Enable ARMv8
+// CHECK-NEXT: FEAT_FP16 Full FP16
+// CHECK-NEXT: FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: FEAT_LOR Enables ARM v8.1 Limited Ordering Regions extension
+// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: FEAT_PAN Enables ARM v8.1 Privileged Access-Never extension
+// CHECK-NEXT: FEAT_PAN2 Enable v8.2 PAN s1e1R and s1e1W Variants
+// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: FEAT_UAO Enable v8.2 UAO PState
+// CHECK-NEXT: FEAT_VHE Enables ARM v8.1 Virtual Host extension
>From 6e840ce0068281d66da8b64d1780a50f259d0352 Mon Sep 17 00:00:00 2001
From: Tomas Matheson <tomas.matheson at arm.com>
Date: Fri, 5 Jul 2024 15:23:37 +0100
Subject: [PATCH 2/3] Increase print-supported-extensions test coverage
---
.../print-supported-extensions-aarch64.c | 83 ++++++++
.../Driver/print-supported-extensions-arm.c | 30 +++
.../Driver/print-supported-extensions-riscv.c | 197 ++++++++++++++++++
.../test/Driver/print-supported-extensions.c | 23 +-
4 files changed, 312 insertions(+), 21 deletions(-)
create mode 100644 clang/test/Driver/print-supported-extensions-aarch64.c
create mode 100644 clang/test/Driver/print-supported-extensions-arm.c
create mode 100644 clang/test/Driver/print-supported-extensions-riscv.c
diff --git a/clang/test/Driver/print-supported-extensions-aarch64.c b/clang/test/Driver/print-supported-extensions-aarch64.c
new file mode 100644
index 0000000000000..1af1bd0833d4f
--- /dev/null
+++ b/clang/test/Driver/print-supported-extensions-aarch64.c
@@ -0,0 +1,83 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang --target=aarch64-linux-gnu --print-supported-extensions | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: All available -march extensions for AArch64
+// CHECK-EMPTY:
+// CHECK-NEXT: Name Architecture Feature(s) Description
+// CHECK-NEXT: aes FEAT_AES, FEAT_PMULL Enable AES support
+// CHECK-NEXT: b16b16 FEAT_SVE_B16B16 Enable SVE2.1 or SME2.1 non-widening BFloat16 to BFloat16 instructions
+// CHECK-NEXT: bf16 FEAT_BF16 Enable BFloat16 Extension
+// CHECK-NEXT: brbe FEAT_BRBE Enable Branch Record Buffer Extension
+// CHECK-NEXT: bti FEAT_BTI Enable Branch Target Identification
+// CHECK-NEXT: fcma FEAT_FCMA Enable v8.3-A Floating-point complex number support
+// CHECK-NEXT: cpa FEAT_CPA Enable Armv9.5-A Checked Pointer Arithmetic
+// CHECK-NEXT: crc FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions
+// CHECK-NEXT: crypto FEAT_Crypto Enable cryptographic instructions
+// CHECK-NEXT: cssc FEAT_CSSC Enable Common Short Sequence Compression (CSSC) instructions
+// CHECK-NEXT: d128 FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, FEAT_SYSINSTR128 Enable Armv9.4-A 128-bit Page Table Descriptors, System Registers and Instructions
+// CHECK-NEXT: dit FEAT_DIT Enable v8.4-A Data Independent Timing instructions
+// CHECK-NEXT: dotprod FEAT_DotProd Enable dot product support
+// CHECK-NEXT: f32mm FEAT_F32MM Enable Matrix Multiply FP32 Extension
+// CHECK-NEXT: f64mm FEAT_F64MM Enable Matrix Multiply FP64 Extension
+// CHECK-NEXT: faminmax FEAT_FAMINMAX Enable FAMIN and FAMAX instructions
+// CHECK-NEXT: flagm FEAT_FlagM Enable v8.4-A Flag Manipulation Instructions
+// CHECK-NEXT: fp FEAT_FP Enable ARMv8
+// CHECK-NEXT: fp16fml FEAT_FHM Enable FP16 FML instructions
+// CHECK-NEXT: fp8 FEAT_FP8 Enable FP8 instructions
+// CHECK-NEXT: fp8dot2 FEAT_FP8DOT2 Enable fp8 2-way dot instructions
+// CHECK-NEXT: fp8dot4 FEAT_FP8DOT4 Enable fp8 4-way dot instructions
+// CHECK-NEXT: fp8fma FEAT_FP8FMA Enable fp8 multiply-add instructions
+// CHECK-NEXT: fp16 FEAT_FP16 Full FP16
+// CHECK-NEXT: gcs FEAT_GCS Enable Armv9.4-A Guarded Call Stack Extension
+// CHECK-NEXT: hbc FEAT_HBC Enable Armv8.8-A Hinted Conditional Branches Extension
+// CHECK-NEXT: i8mm FEAT_I8MM Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: ite FEAT_ITE Enable Armv9.4-A Instrumentation Extension
+// CHECK-NEXT: jscvt FEAT_JSCVT Enable v8.3-A JavaScript FP conversion instructions
+// CHECK-NEXT: ls64 FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA Enable Armv8.7-A LD64B/ST64B Accelerator Extension
+// CHECK-NEXT: lse FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
+// CHECK-NEXT: lse128 FEAT_LSE128 Enable Armv9.4-A 128-bit Atomic Instructions
+// CHECK-NEXT: lut FEAT_LUT Enable Lookup Table instructions
+// CHECK-NEXT: mops FEAT_MOPS Enable Armv8.8-A memcpy and memset acceleration instructions
+// CHECK-NEXT: memtag FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
+// CHECK-NEXT: simd FEAT_AdvSIMD Enable Advanced SIMD instructions
+// CHECK-NEXT: pauth FEAT_PAuth Enable v8.3-A Pointer Authentication extension
+// CHECK-NEXT: pauth-lr FEAT_PAuth_LR Enable Armv9.5-A PAC enhancements
+// CHECK-NEXT: pmuv3 FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
+// CHECK-NEXT: predres FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
+// CHECK-NEXT: rng FEAT_RNG Enable Random Number generation instructions
+// CHECK-NEXT: ras FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: rasv2 FEAT_RASv2 Enable ARMv8.9-A Reliability, Availability and Serviceability Extensions
+// CHECK-NEXT: rcpc FEAT_LRCPC Enable support for RCPC extension
+// CHECK-NEXT: rcpc3 FEAT_LRCPC3 Enable Armv8.9-A RCPC instructions for A64 and Advanced SIMD and floating-point instruction set
+// CHECK-NEXT: rdm FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
+// CHECK-NEXT: sb FEAT_SB Enable v8.5 Speculation Barrier
+// CHECK-NEXT: sha2 FEAT_SHA1, FEAT_SHA256 Enable SHA1 and SHA256 support
+// CHECK-NEXT: sha3 FEAT_SHA3, FEAT_SHA512 Enable SHA512 and SHA3 support
+// CHECK-NEXT: sm4 FEAT_SM4, FEAT_SM3 Enable SM3 and SM4 support
+// CHECK-NEXT: sme FEAT_SME Enable Scalable Matrix Extension (SME)
+// CHECK-NEXT: sme-f16f16 FEAT_SME_F16F16 Enable SME non-widening Float16 instructions
+// CHECK-NEXT: sme-f64f64 FEAT_SME_F64F64 Enable Scalable Matrix Extension (SME) F64F64 instructions
+// CHECK-NEXT: sme-f8f16 FEAT_SME_F8F16 Enable Scalable Matrix Extension (SME) F8F16 instructions
+// CHECK-NEXT: sme-f8f32 FEAT_SME_F8F32 Enable Scalable Matrix Extension (SME) F8F32 instructions
+// CHECK-NEXT: sme-fa64 FEAT_SME_FA64 Enable the full A64 instruction set in streaming SVE mode
+// CHECK-NEXT: sme-i16i64 FEAT_SME_I16I64 Enable Scalable Matrix Extension (SME) I16I64 instructions
+// CHECK-NEXT: sme-lutv2 FEAT_SME_LUTv2 Enable Scalable Matrix Extension (SME) LUTv2 instructions
+// CHECK-NEXT: sme2 FEAT_SME2 Enable Scalable Matrix Extension 2 (SME2) instructions
+// CHECK-NEXT: sme2p1 FEAT_SME2p1 Enable Scalable Matrix Extension 2.1 instructions
+// CHECK-NEXT: profile FEAT_SPE Enable Statistical Profiling extension
+// CHECK-NEXT: predres2 FEAT_SPECRES2 Enable Speculation Restriction Instruction
+// CHECK-NEXT: ssbs FEAT_SSBS, FEAT_SSBS2 Enable Speculative Store Bypass Safe bit
+// CHECK-NEXT: ssve-fp8dot2 FEAT_SSVE_FP8DOT2 Enable SVE2 fp8 2-way dot product instructions
+// CHECK-NEXT: ssve-fp8dot4 FEAT_SSVE_FP8DOT4 Enable SVE2 fp8 4-way dot product instructions
+// CHECK-NEXT: ssve-fp8fma FEAT_SSVE_FP8FMA Enable SVE2 fp8 multiply-add instructions
+// CHECK-NEXT: sve FEAT_SVE Enable Scalable Vector Extension (SVE) instructions
+// CHECK-NEXT: sve2 FEAT_SVE2 Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT: sve2-aes FEAT_SVE_AES, FEAT_SVE_PMULL128 Enable AES SVE2 instructions
+// CHECK-NEXT: sve2-bitperm FEAT_SVE_BitPerm Enable bit permutation SVE2 instructions
+// CHECK-NEXT: sve2-sha3 FEAT_SVE_SHA3 Enable SHA3 SVE2 instructions
+// CHECK-NEXT: sve2-sm4 FEAT_SVE_SM4 Enable SM4 SVE2 instructions
+// CHECK-NEXT: sve2p1 FEAT_SVE2p1 Enable Scalable Vector Extension 2.1 instructions
+// CHECK-NEXT: the FEAT_THE Enable Armv8.9-A Translation Hardening Extension
+// CHECK-NEXT: tlbiw FEAT_TLBIW Enable ARMv9.5-A TLBI VMALL for Dirty State
+// CHECK-NEXT: tme FEAT_TME Enable Transactional Memory Extension
+// CHECK-NEXT: wfxt FEAT_WFxT Enable Armv8.7-A WFET and WFIT instruction
diff --git a/clang/test/Driver/print-supported-extensions-arm.c b/clang/test/Driver/print-supported-extensions-arm.c
new file mode 100644
index 0000000000000..0dc2e9fc69738
--- /dev/null
+++ b/clang/test/Driver/print-supported-extensions-arm.c
@@ -0,0 +1,30 @@
+// REQUIRES: arm-registered-target
+// RUN: %clang --target=arm-linux-gnu --print-supported-extensions | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: All available -march extensions for ARM
+// CHECK-EMPTY:
+// CHECK-NEXT: Name Description
+// CHECK-NEXT: crc Enable support for CRC instructions
+// CHECK-NEXT: crypto Enable support for Cryptography extensions
+// CHECK-NEXT: sha2 Enable SHA1 and SHA256 support
+// CHECK-NEXT: aes Enable AES support
+// CHECK-NEXT: dotprod Enable support for dot product instructions
+// CHECK-NEXT: dsp Supports DSP instructions in ARM and/or Thumb2
+// CHECK-NEXT: mve Support M-Class Vector Extension with integer ops
+// CHECK-NEXT: mve.fp Support M-Class Vector Extension with integer and floating ops
+// CHECK-NEXT: fp16 Enable half-precision floating point
+// CHECK-NEXT: ras Enable Reliability, Availability and Serviceability extensions
+// CHECK-NEXT: fp16fml Enable full half-precision floating point fml instructions
+// CHECK-NEXT: bf16 Enable support for BFloat16 instructions
+// CHECK-NEXT: sb Enable v8.5a Speculation Barrier
+// CHECK-NEXT: i8mm Enable Matrix Multiply Int8 Extension
+// CHECK-NEXT: lob Enable Low Overhead Branch extensions
+// CHECK-NEXT: cdecp0 Coprocessor 0 ISA is CDEv1
+// CHECK-NEXT: cdecp1 Coprocessor 1 ISA is CDEv1
+// CHECK-NEXT: cdecp2 Coprocessor 2 ISA is CDEv1
+// CHECK-NEXT: cdecp3 Coprocessor 3 ISA is CDEv1
+// CHECK-NEXT: cdecp4 Coprocessor 4 ISA is CDEv1
+// CHECK-NEXT: cdecp5 Coprocessor 5 ISA is CDEv1
+// CHECK-NEXT: cdecp6 Coprocessor 6 ISA is CDEv1
+// CHECK-NEXT: cdecp7 Coprocessor 7 ISA is CDEv1
+// CHECK-NEXT: pacbti Enable Pointer Authentication and Branch Target Identification
diff --git a/clang/test/Driver/print-supported-extensions-riscv.c b/clang/test/Driver/print-supported-extensions-riscv.c
new file mode 100644
index 0000000000000..b58e1514bbfc2
--- /dev/null
+++ b/clang/test/Driver/print-supported-extensions-riscv.c
@@ -0,0 +1,197 @@
+// REQUIRES: riscv-registered-target
+// RUN: %clang --target=riscv64-linux-gnu --print-supported-extensions | FileCheck --strict-whitespace --implicit-check-not=FEAT_ %s
+
+// CHECK: All available -march extensions for RISC-V
+// CHECK-EMPTY:
+// CHECK-NEXT: Name Version Description
+// CHECK-NEXT: i 2.1 'I' (Base Integer Instruction Set)
+// CHECK-NEXT: e 2.0 Implements RV{32,64}E (provides 16 rather than 32 GPRs)
+// CHECK-NEXT: m 2.0 'M' (Integer Multiplication and Division)
+// CHECK-NEXT: a 2.1 'A' (Atomic Instructions)
+// CHECK-NEXT: f 2.2 'F' (Single-Precision Floating-Point)
+// CHECK-NEXT: d 2.2 'D' (Double-Precision Floating-Point)
+// CHECK-NEXT: c 2.0 'C' (Compressed Instructions)
+// CHECK-NEXT: b 1.0 'B' (the collection of the Zba, Zbb, Zbs extensions)
+// CHECK-NEXT: v 1.0 'V' (Vector Extension for Application Processors)
+// CHECK-NEXT: h 1.0 'H' (Hypervisor)
+// CHECK-NEXT: zic64b 1.0 'Zic64b' (Cache Block Size Is 64 Bytes)
+// CHECK-NEXT: zicbom 1.0 'Zicbom' (Cache-Block Management Instructions)
+// CHECK-NEXT: zicbop 1.0 'Zicbop' (Cache-Block Prefetch Instructions)
+// CHECK-NEXT: zicboz 1.0 'Zicboz' (Cache-Block Zero Instructions)
+// CHECK-NEXT: ziccamoa 1.0 'Ziccamoa' (Main Memory Supports All Atomics in A)
+// CHECK-NEXT: ziccif 1.0 'Ziccif' (Main Memory Supports Instruction Fetch with Atomicity Requirement)
+// CHECK-NEXT: zicclsm 1.0 'Zicclsm' (Main Memory Supports Misaligned Loads/Stores)
+// CHECK-NEXT: ziccrse 1.0 'Ziccrse' (Main Memory Supports Forward Progress on LR/SC Sequences)
+// CHECK-NEXT: zicntr 2.0 'Zicntr' (Base Counters and Timers)
+// CHECK-NEXT: zicond 1.0 'Zicond' (Integer Conditional Operations)
+// CHECK-NEXT: zicsr 2.0 'zicsr' (CSRs)
+// CHECK-NEXT: zifencei 2.0 'Zifencei' (fence.i)
+// CHECK-NEXT: zihintntl 1.0 'Zihintntl' (Non-Temporal Locality Hints)
+// CHECK-NEXT: zihintpause 2.0 'Zihintpause' (Pause Hint)
+// CHECK-NEXT: zihpm 2.0 'Zihpm' (Hardware Performance Counters)
+// CHECK-NEXT: zimop 1.0 'Zimop' (May-Be-Operations)
+// CHECK-NEXT: zmmul 1.0 'Zmmul' (Integer Multiplication)
+// CHECK-NEXT: za128rs 1.0 'Za128rs' (Reservation Set Size of at Most 128 Bytes)
+// CHECK-NEXT: za64rs 1.0 'Za64rs' (Reservation Set Size of at Most 64 Bytes)
+// CHECK-NEXT: zaamo 1.0 'Zaamo' (Atomic Memory Operations)
+// CHECK-NEXT: zabha 1.0 'Zabha' (Byte and Halfword Atomic Memory Operations)
+// CHECK-NEXT: zacas 1.0 'Zacas' (Atomic Compare-And-Swap Instructions)
+// CHECK-NEXT: zalrsc 1.0 'Zalrsc' (Load-Reserved/Store-Conditional)
+// CHECK-NEXT: zama16b 1.0 'Zama16b' (Atomic 16-byte misaligned loads, stores and AMOs)
+// CHECK-NEXT: zawrs 1.0 'Zawrs' (Wait on Reservation Set)
+// CHECK-NEXT: zfa 1.0 'Zfa' (Additional Floating-Point)
+// CHECK-NEXT: zfh 1.0 'Zfh' (Half-Precision Floating-Point)
+// CHECK-NEXT: zfhmin 1.0 'Zfhmin' (Half-Precision Floating-Point Minimal)
+// CHECK-NEXT: zfinx 1.0 'Zfinx' (Float in Integer)
+// CHECK-NEXT: zdinx 1.0 'Zdinx' (Double in Integer)
+// CHECK-NEXT: zca 1.0 'Zca' (part of the C extension, excluding compressed floating point loads/stores)
+// CHECK-NEXT: zcb 1.0 'Zcb' (Compressed basic bit manipulation instructions)
+// CHECK-NEXT: zcd 1.0 'Zcd' (Compressed Double-Precision Floating-Point Instructions)
+// CHECK-NEXT: zce 1.0 'Zce' (Compressed extensions for microcontrollers)
+// CHECK-NEXT: zcf 1.0 'Zcf' (Compressed Single-Precision Floating-Point Instructions)
+// CHECK-NEXT: zcmop 1.0 'Zcmop' (Compressed May-Be-Operations)
+// CHECK-NEXT: zcmp 1.0 'Zcmp' (sequenced instuctions for code-size reduction)
+// CHECK-NEXT: zcmt 1.0 'Zcmt' (table jump instuctions for code-size reduction)
+// CHECK-NEXT: zba 1.0 'Zba' (Address Generation Instructions)
+// CHECK-NEXT: zbb 1.0 'Zbb' (Basic Bit-Manipulation)
+// CHECK-NEXT: zbc 1.0 'Zbc' (Carry-Less Multiplication)
+// CHECK-NEXT: zbkb 1.0 'Zbkb' (Bitmanip instructions for Cryptography)
+// CHECK-NEXT: zbkc 1.0 'Zbkc' (Carry-less multiply instructions for Cryptography)
+// CHECK-NEXT: zbkx 1.0 'Zbkx' (Crossbar permutation instructions)
+// CHECK-NEXT: zbs 1.0 'Zbs' (Single-Bit Instructions)
+// CHECK-NEXT: zk 1.0 'Zk' (Standard scalar cryptography extension)
+// CHECK-NEXT: zkn 1.0 'Zkn' (NIST Algorithm Suite)
+// CHECK-NEXT: zknd 1.0 'Zknd' (NIST Suite: AES Decryption)
+// CHECK-NEXT: zkne 1.0 'Zkne' (NIST Suite: AES Encryption)
+// CHECK-NEXT: zknh 1.0 'Zknh' (NIST Suite: Hash Function Instructions)
+// CHECK-NEXT: zkr 1.0 'Zkr' (Entropy Source Extension)
+// CHECK-NEXT: zks 1.0 'Zks' (ShangMi Algorithm Suite)
+// CHECK-NEXT: zksed 1.0 'Zksed' (ShangMi Suite: SM4 Block Cipher Instructions)
+// CHECK-NEXT: zksh 1.0 'Zksh' (ShangMi Suite: SM3 Hash Function Instructions)
+// CHECK-NEXT: zkt 1.0 'Zkt' (Data Independent Execution Latency)
+// CHECK-NEXT: zvbb 1.0 'Zvbb' (Vector basic bit-manipulation instructions)
+// CHECK-NEXT: zvbc 1.0 'Zvbc' (Vector Carryless Multiplication)
+// CHECK-NEXT: zve32f 1.0 'Zve32f' (Vector Extensions for Embedded Processors with maximal 32 EEW and F extension)
+// CHECK-NEXT: zve32x 1.0 'Zve32x' (Vector Extensions for Embedded Processors with maximal 32 EEW)
+// CHECK-NEXT: zve64d 1.0 'Zve64d' (Vector Extensions for Embedded Processors with maximal 64 EEW, F and D extension)
+// CHECK-NEXT: zve64f 1.0 'Zve64f' (Vector Extensions for Embedded Processors with maximal 64 EEW and F extension)
+// CHECK-NEXT: zve64x 1.0 'Zve64x' (Vector Extensions for Embedded Processors with maximal 64 EEW)
+// CHECK-NEXT: zvfh 1.0 'Zvfh' (Vector Half-Precision Floating-Point)
+// CHECK-NEXT: zvfhmin 1.0 'Zvfhmin' (Vector Half-Precision Floating-Point Minimal)
+// CHECK-NEXT: zvkb 1.0 'Zvkb' (Vector Bit-manipulation used in Cryptography)
+// CHECK-NEXT: zvkg 1.0 'Zvkg' (Vector GCM instructions for Cryptography)
+// CHECK-NEXT: zvkn 1.0 'Zvkn' (shorthand for 'Zvkned', 'Zvknhb', 'Zvkb', and 'Zvkt')
+// CHECK-NEXT: zvknc 1.0 'Zvknc' (shorthand for 'Zvknc' and 'Zvbc')
+// CHECK-NEXT: zvkned 1.0 'Zvkned' (Vector AES Encryption & Decryption (Single Round))
+// CHECK-NEXT: zvkng 1.0 'zvkng' (shorthand for 'Zvkn' and 'Zvkg')
+// CHECK-NEXT: zvknha 1.0 'Zvknha' (Vector SHA-2 (SHA-256 only))
+// CHECK-NEXT: zvknhb 1.0 'Zvknhb' (Vector SHA-2 (SHA-256 and SHA-512))
+// CHECK-NEXT: zvks 1.0 'Zvks' (shorthand for 'Zvksed', 'Zvksh', 'Zvkb', and 'Zvkt')
+// CHECK-NEXT: zvksc 1.0 'Zvksc' (shorthand for 'Zvks' and 'Zvbc')
+// CHECK-NEXT: zvksed 1.0 'Zvksed' (SM4 Block Cipher Instructions)
+// CHECK-NEXT: zvksg 1.0 'Zvksg' (shorthand for 'Zvks' and 'Zvkg')
+// CHECK-NEXT: zvksh 1.0 'Zvksh' (SM3 Hash Function Instructions)
+// CHECK-NEXT: zvkt 1.0 'Zvkt' (Vector Data-Independent Execution Latency)
+// CHECK-NEXT: zvl1024b 1.0 'Zvl' (Minimum Vector Length) 1024
+// CHECK-NEXT: zvl128b 1.0 'Zvl' (Minimum Vector Length) 128
+// CHECK-NEXT: zvl16384b 1.0 'Zvl' (Minimum Vector Length) 16384
+// CHECK-NEXT: zvl2048b 1.0 'Zvl' (Minimum Vector Length) 2048
+// CHECK-NEXT: zvl256b 1.0 'Zvl' (Minimum Vector Length) 256
+// CHECK-NEXT: zvl32768b 1.0 'Zvl' (Minimum Vector Length) 32768
+// CHECK-NEXT: zvl32b 1.0 'Zvl' (Minimum Vector Length) 32
+// CHECK-NEXT: zvl4096b 1.0 'Zvl' (Minimum Vector Length) 4096
+// CHECK-NEXT: zvl512b 1.0 'Zvl' (Minimum Vector Length) 512
+// CHECK-NEXT: zvl64b 1.0 'Zvl' (Minimum Vector Length) 64
+// CHECK-NEXT: zvl65536b 1.0 'Zvl' (Minimum Vector Length) 65536
+// CHECK-NEXT: zvl8192b 1.0 'Zvl' (Minimum Vector Length) 8192
+// CHECK-NEXT: zhinx 1.0 'Zhinx' (Half Float in Integer)
+// CHECK-NEXT: zhinxmin 1.0 'Zhinxmin' (Half Float in Integer Minimal)
+// CHECK-NEXT: shcounterenw 1.0 'Shcounterenw' (Support writeable hcounteren enable bit for any hpmcounter that is not read-only zero)
+// CHECK-NEXT: shgatpa 1.0 'Sgatpa' (SvNNx4 mode supported for all modes supported by satp, as well as Bare)
+// CHECK-NEXT: shtvala 1.0 'Shtvala' (htval provides all needed values)
+// CHECK-NEXT: shvsatpa 1.0 'Svsatpa' (vsatp supports all modes supported by satp)
+// CHECK-NEXT: shvstvala 1.0 'Shvstvala' (vstval provides all needed values)
+// CHECK-NEXT: shvstvecd 1.0 'Shvstvecd' (vstvec supports Direct mode)
+// CHECK-NEXT: smaia 1.0 'Smaia' (Advanced Interrupt Architecture Machine Level)
+// CHECK-NEXT: smcdeleg 1.0 'Smcdeleg' (Counter Delegation Machine Level)
+// CHECK-NEXT: smcsrind 1.0 'Smcsrind' (Indirect CSR Access Machine Level)
+// CHECK-NEXT: smepmp 1.0 'Smepmp' (Enhanced Physical Memory Protection)
+// CHECK-NEXT: smstateen 1.0 'Smstateen' (Machine-mode view of the state-enable extension)
+// CHECK-NEXT: ssaia 1.0 'Ssaia' (Advanced Interrupt Architecture Supervisor Level)
+// CHECK-NEXT: ssccfg 1.0 'Ssccfg' (Counter Configuration Supervisor Level)
+// CHECK-NEXT: ssccptr 1.0 'Ssccptr' (Main memory supports page table reads)
+// CHECK-NEXT: sscofpmf 1.0 'Sscofpmf' (Count Overflow and Mode-Based Filtering)
+// CHECK-NEXT: sscounterenw 1.0 'Sscounterenw' (Support writeable scounteren enable bit for any hpmcounter that is not read-only zero)
+// CHECK-NEXT: sscsrind 1.0 'Sscsrind' (Indirect CSR Access Supervisor Level)
+// CHECK-NEXT: ssstateen 1.0 'Ssstateen' (Supervisor-mode view of the state-enable extension)
+// CHECK-NEXT: ssstrict 1.0 'Ssstrict' (No non-conforming extensions are present)
+// CHECK-NEXT: sstc 1.0 'Sstc' (Supervisor-mode timer interrupts)
+// CHECK-NEXT: sstvala 1.0 'Sstvala' (stval provides all needed values)
+// CHECK-NEXT: sstvecd 1.0 'Sstvecd' (stvec supports Direct mode)
+// CHECK-NEXT: ssu64xl 1.0 'Ssu64xl' (UXLEN=64 supported)
+// CHECK-NEXT: svade 1.0 'Svade' (Raise exceptions on improper A/D bits)
+// CHECK-NEXT: svadu 1.0 'Svadu' (Hardware A/D updates)
+// CHECK-NEXT: svbare 1.0 'Svbare' $(satp mode Bare supported)
+// CHECK-NEXT: svinval 1.0 'Svinval' (Fine-Grained Address-Translation Cache Invalidation)
+// CHECK-NEXT: svnapot 1.0 'Svnapot' (NAPOT Translation Contiguity)
+// CHECK-NEXT: svpbmt 1.0 'Svpbmt' (Page-Based Memory Types)
+// CHECK-NEXT: xcvalu 1.0 'XCValu' (CORE-V ALU Operations)
+// CHECK-NEXT: xcvbi 1.0 'XCVbi' (CORE-V Immediate Branching)
+// CHECK-NEXT: xcvbitmanip 1.0 'XCVbitmanip' (CORE-V Bit Manipulation)
+// CHECK-NEXT: xcvelw 1.0 'XCVelw' (CORE-V Event Load Word)
+// CHECK-NEXT: xcvmac 1.0 'XCVmac' (CORE-V Multiply-Accumulate)
+// CHECK-NEXT: xcvmem 1.0 'XCVmem' (CORE-V Post-incrementing Load & Store)
+// CHECK-NEXT: xcvsimd 1.0 'XCVsimd' (CORE-V SIMD ALU)
+// CHECK-NEXT: xsfcease 1.0 'XSfcease' (SiFive sf.cease Instruction)
+// CHECK-NEXT: xsfvcp 1.0 'XSfvcp' (SiFive Custom Vector Coprocessor Interface Instructions)
+// CHECK-NEXT: xsfvfnrclipxfqf 1.0 'XSfvfnrclipxfqf' (SiFive FP32-to-int8 Ranged Clip Instructions)
+// CHECK-NEXT: xsfvfwmaccqqq 1.0 'XSfvfwmaccqqq' (SiFive Matrix Multiply Accumulate Instruction and 4-by-4))
+// CHECK-NEXT: xsfvqmaccdod 1.0 'XSfvqmaccdod' (SiFive Int8 Matrix Multiplication Instructions (2-by-8 and 8-by-2))
+// CHECK-NEXT: xsfvqmaccqoq 1.0 'XSfvqmaccqoq' (SiFive Int8 Matrix Multiplication Instructions (4-by-8 and 8-by-4))
+// CHECK-NEXT: xsifivecdiscarddlone 1.0 'XSiFivecdiscarddlone' (SiFive sf.cdiscard.d.l1 Instruction)
+// CHECK-NEXT: xsifivecflushdlone 1.0 'XSiFivecflushdlone' (SiFive sf.cflush.d.l1 Instruction)
+// CHECK-NEXT: xtheadba 1.0 'xtheadba' (T-Head address calculation instructions)
+// CHECK-NEXT: xtheadbb 1.0 'xtheadbb' (T-Head basic bit-manipulation instructions)
+// CHECK-NEXT: xtheadbs 1.0 'xtheadbs' (T-Head single-bit instructions)
+// CHECK-NEXT: xtheadcmo 1.0 'xtheadcmo' (T-Head cache management instructions)
+// CHECK-NEXT: xtheadcondmov 1.0 'xtheadcondmov' (T-Head conditional move instructions)
+// CHECK-NEXT: xtheadfmemidx 1.0 'xtheadfmemidx' (T-Head FP Indexed Memory Operations)
+// CHECK-NEXT: xtheadmac 1.0 'xtheadmac' (T-Head Multiply-Accumulate Instructions)
+// CHECK-NEXT: xtheadmemidx 1.0 'xtheadmemidx' (T-Head Indexed Memory Operations)
+// CHECK-NEXT: xtheadmempair 1.0 'xtheadmempair' (T-Head two-GPR Memory Operations)
+// CHECK-NEXT: xtheadsync 1.0 'xtheadsync' (T-Head multicore synchronization instructions)
+// CHECK-NEXT: xtheadvdot 1.0 'xtheadvdot' (T-Head Vector Extensions for Dot)
+// CHECK-NEXT: xventanacondops 1.0 'XVentanaCondOps' (Ventana Conditional Ops)
+// CHECK-EMPTY:
+// CHECK-NEXT: Experimental extensions
+// CHECK-NEXT: zicfilp 0.4 'Zicfilp' (Landing pad)
+// CHECK-NEXT: zicfiss 0.4 'Zicfiss' (Shadow stack)
+// CHECK-NEXT: zalasr 0.1 'Zalasr' (Load-Acquire and Store-Release Instructions)
+// CHECK-NEXT: zfbfmin 1.0 'Zfbfmin' (Scalar BF16 Converts)
+// CHECK-NEXT: ztso 0.1 'Ztso' (Memory Model - Total Store Order)
+// CHECK-NEXT: zvfbfmin 1.0 'Zvbfmin' (Vector BF16 Converts)
+// CHECK-NEXT: zvfbfwma 1.0 'Zvfbfwma' (Vector BF16 widening mul-add)
+// CHECK-NEXT: smmpm 1.0 'Smmpm' (Machine-level Pointer Masking for M-mode)
+// CHECK-NEXT: smnpm 1.0 'Smnpm' (Machine-level Pointer Masking for next lower privilege mode)
+// CHECK-NEXT: ssnpm 1.0 'Ssnpm' (Supervisor-level Pointer Masking for next lower privilege mode)
+// CHECK-NEXT: sspm 1.0 'Sspm' (Indicates Supervisor-mode Pointer Masking)
+// CHECK-NEXT: ssqosid 1.0 'Ssqosid' (Quality-of-Service (QoS) Identifiers)
+// CHECK-NEXT: supm 1.0 'Supm' (Indicates User-mode Pointer Masking)
+// CHECK-EMPTY:
+// CHECK-NEXT: Supported Profiles
+// CHECK-NEXT: rva20s64
+// CHECK-NEXT: rva20u64
+// CHECK-NEXT: rva22s64
+// CHECK-NEXT: rva22u64
+// CHECK-NEXT: rvi20u32
+// CHECK-NEXT: rvi20u64
+// CHECK-EMPTY:
+// CHECK-NEXT: Experimental Profiles
+// CHECK-NEXT: rva23s64
+// CHECK-NEXT: rva23u64
+// CHECK-NEXT: rvb23s64
+// CHECK-NEXT: rvb23u64
+// CHECK-NEXT: rvm23u32
+// CHECK-EMPTY:
+// CHECK-NEXT: Use -march to specify the target's extension.
+// CHECK-NEXT: For example, clang -march=rv32i_v1p0
diff --git a/clang/test/Driver/print-supported-extensions.c b/clang/test/Driver/print-supported-extensions.c
index b9b16352f8295..9557802862733 100644
--- a/clang/test/Driver/print-supported-extensions.c
+++ b/clang/test/Driver/print-supported-extensions.c
@@ -1,24 +1,5 @@
-// Test that --print-supported-extensions lists supported -march extensions
-// on supported architectures, and errors on unsupported architectures.
-
-// RUN: %if aarch64-registered-target %{ %clang --target=aarch64-linux-gnu \
-// RUN: --print-supported-extensions 2>&1 | FileCheck %s --check-prefix AARCH64 %}
-// AARCH64: All available -march extensions for AArch64
-// AARCH64: Name Architecture Feature(s) Description
-// AARCH64: aes FEAT_AES, FEAT_PMULL Enable AES support
-
-// RUN: %if riscv-registered-target %{ %clang --target=riscv64-linux-gnu \
-// RUN: --print-supported-extensions 2>&1 | FileCheck %s --check-prefix RISCV %}
-// RISCV: All available -march extensions for RISC-V
-// RISCV: Name Version Description
-// RISCV: i 2.1
-
-// RUN: %if arm-registered-target %{ %clang --target=arm-linux-gnu \
-// RUN: --print-supported-extensions 2>&1 | FileCheck %s --check-prefix ARM %}
-// ARM: All available -march extensions for ARM
-// ARM: Name Description
-// ARM: crc Enable support for CRC instructions
+// Test that --print-supported-extensions errors on unsupported architectures.
// RUN: %if x86-registered-target %{ not %clang --target=x86_64-linux-gnu \
// RUN: --print-supported-extensions 2>&1 | FileCheck %s --check-prefix X86 %}
-// X86: error: option '--print-supported-extensions' cannot be specified on this target
\ No newline at end of file
+// X86: error: option '--print-supported-extensions' cannot be specified on this target
>From 2086ddcaae5e58b1694aba1f766255533023aba3 Mon Sep 17 00:00:00 2001
From: Tomas Matheson <tomas.matheson at arm.com>
Date: Fri, 5 Jul 2024 15:34:22 +0100
Subject: [PATCH 3/3] Remove TargetParserTest test for
--print-enabled-extensions
---
.../unittests/TargetParser/TargetParserTest.cpp | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
index d1c3dcb2f8ee4..8231cfd2ad1c9 100644
--- a/llvm/unittests/TargetParser/TargetParserTest.cpp
+++ b/llvm/unittests/TargetParser/TargetParserTest.cpp
@@ -2255,23 +2255,6 @@ TEST(TargetParserTest, AArch64PrintSupportedExtensions) {
EXPECT_EQ(std::string::npos, captured.find("ssbs2"));
}
-TEST(TargetParserTest, AArch64PrintEnabledExtensions) {
- // Pick a single enabled extension to validate formatting
- std::set<StringRef> EnabledExtensions = {"crc"};
- std::string ExpectedOutput =
- "Extensions enabled for the given AArch64 target\n\n"
- " Architecture Feature(s) Description\n"
- " FEAT_CRC32 Enable ARMv8 CRC-32 checksum instructions\n";
-
- outs().flush();
- testing::internal::CaptureStdout();
- AArch64::printEnabledExtensions(EnabledExtensions);
- outs().flush();
- std::string CapturedOutput = testing::internal::GetCapturedStdout();
-
- EXPECT_EQ(CapturedOutput, ExpectedOutput);
-}
-
struct AArch64ExtensionDependenciesBaseArchTestParams {
const llvm::AArch64::ArchInfo &Arch;
std::vector<StringRef> Modifiers;
More information about the cfe-commits
mailing list