[clang] [llvm] [RISCV] Add -march support for many of the S extensions mentioned in the profile specification. (PR #79399)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 23:35:08 PST 2024


https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/79399

>From 32dcc4d617811a42285958637274c4fb995742c4 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Wed, 24 Jan 2024 22:33:37 -0800
Subject: [PATCH 1/6] [RISCV] Reformat riscv-target-features.c. NFC

Indent line continuations by 2 spaces.
Drop -x c
---
 .../test/Preprocessor/riscv-target-features.c | 1188 ++++++++---------
 1 file changed, 594 insertions(+), 594 deletions(-)

diff --git a/clang/test/Preprocessor/riscv-target-features.c b/clang/test/Preprocessor/riscv-target-features.c
index 39d2c66f14b23ff..4112e7d473d233e 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -1,7 +1,7 @@
-// RUN: %clang --target=riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \
-// RUN: -o - | FileCheck %s
-// RUN: %clang --target=riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \
-// RUN: -o - | FileCheck %s
+// RUN: %clang --target=riscv32-unknown-linux-gnu -march=rv32i -E -dM %s \
+// RUN:   -o - | FileCheck %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu -march=rv64i -E -dM %s \
+// RUN:   -o - | FileCheck %s
 
 // CHECK-NOT: __riscv_32e {{.*$}}
 // CHECK-NOT: __riscv_64e {{.*$}}
@@ -153,152 +153,152 @@
 // CHECK-NOT: __riscv_zvfbfwma {{.*$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ia -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-A-EXT %s
+// RUN:   -march=rv32ia -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-A-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ia -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-A-EXT %s
+// RUN:   -march=rv64ia -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-A-EXT %s
 // CHECK-A-EXT: __riscv_a 2001000{{$}}
 // CHECK-A-EXT: __riscv_atomic 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ic -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-C-EXT %s
+// RUN:   -march=rv32ic -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-C-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ic -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-C-EXT %s
+// RUN:   -march=rv64ic -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-C-EXT %s
 // CHECK-C-EXT: __riscv_c 2000000{{$}}
 // CHECK-C-EXT: __riscv_compressed 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ifd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-D-EXT %s
+// RUN:   -march=rv32ifd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-D-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ifd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-D-EXT %s
+// RUN:   -march=rv64ifd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-D-EXT %s
 // CHECK-D-EXT: __riscv_d 2002000{{$}}
 // CHECK-D-EXT: __riscv_fdiv 1
 // CHECK-D-EXT: __riscv_flen 64
 // CHECK-D-EXT: __riscv_fsqrt 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32e -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefixes=CHECK-E-EXT,CHECK-RV32E %s
+// RUN:   -march=rv32e -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefixes=CHECK-E-EXT,CHECK-RV32E %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64e -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefixes=CHECK-E-EXT,CHECK-RV64E %s
+// RUN:   -march=rv64e -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefixes=CHECK-E-EXT,CHECK-RV64E %s
 // CHECK-RV32E: __riscv_32e 1
 // CHECK-RV64E: __riscv_64e 1
 // CHECK-E-EXT: __riscv_abi_rve 1
 // CHECK-E-EXT: __riscv_e 2000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32if -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-F-EXT %s
+// RUN:   -march=rv32if -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-F-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64if -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-F-EXT %s
+// RUN:   -march=rv64if -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-F-EXT %s
 // CHECK-F-EXT: __riscv_f 2002000{{$}}
 // CHECK-F-EXT: __riscv_fdiv 1
 // CHECK-F-EXT: __riscv_flen 32
 // CHECK-F-EXT: __riscv_fsqrt 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ifd -mabi=ilp32 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SOFT %s
+// RUN:   -march=rv32ifd -mabi=ilp32 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SOFT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ifd -mabi=lp64 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SOFT %s
+// RUN:   -march=rv64ifd -mabi=lp64 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SOFT %s
 // CHECK-SOFT: __riscv_float_abi_soft 1
 // CHECK-SOFT-NOT: __riscv_float_abi_single
 // CHECK-SOFT-NOT: __riscv_float_abi_double
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ifd -mabi=ilp32f -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SINGLE %s
+// RUN:   -march=rv32ifd -mabi=ilp32f -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SINGLE %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ifd -mabi=lp64f -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SINGLE %s
+// RUN:   -march=rv64ifd -mabi=lp64f -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SINGLE %s
 // CHECK-SINGLE: __riscv_float_abi_single 1
 // CHECK-SINGLE-NOT: __riscv_float_abi_soft
 // CHECK-SINGLE-NOT: __riscv_float_abi_double
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ifd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-DOUBLE %s
+// RUN:   -march=rv32ifd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-DOUBLE %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ifd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-DOUBLE %s
+// RUN:   -march=rv64ifd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-DOUBLE %s
 // CHECK-DOUBLE: __riscv_float_abi_double 1
 // CHECK-DOUBLE-NOT: __riscv_float_abi_soft
 // CHECK-DOUBLE-NOT: __riscv_float_abi_single
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32i -mabi=ilp32e -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ILP32E %s
+// RUN:   -march=rv32i -mabi=ilp32e -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ILP32E %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64i -mabi=lp64e -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-LP64E %s
+// RUN:   -march=rv64i -mabi=lp64e -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-LP64E %s
 // CHECK-ILP32E: __riscv_abi_rve 1
 // CHECK-LP64E: __riscv_abi_rve 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ih -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-H-EXT %s
+// RUN:   -march=rv32ih -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-H-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ih -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-H-EXT %s
+// RUN:   -march=rv64ih -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-H-EXT %s
 // CHECK-H-EXT: __riscv_h 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32i -x c -E -dM %s \
-// RUN: -o - | FileCheck %s
+// RUN:   -march=rv32i -E -dM %s \
+// RUN:   -o - | FileCheck %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64i -x c -E -dM %s \
-// RUN: -o - | FileCheck %s
+// RUN:   -march=rv64i -E -dM %s \
+// RUN:   -o - | FileCheck %s
 // CHECK: __riscv_i 2001000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32im -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-M-EXT %s
+// RUN:   -march=rv32im -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-M-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64im -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-M-EXT %s
+// RUN:   -march=rv64im -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-M-EXT %s
 // CHECK-M-EXT: __riscv_div 1
 // CHECK-M-EXT: __riscv_m 2000000{{$}}
 // CHECK-M-EXT: __riscv_mul 1
 // CHECK-M-EXT: __riscv_muldiv 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isvinval -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVINVAL-EXT %s
+// RUN:   -march=rv32isvinval -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVINVAL-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isvinval -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVINVAL-EXT %s
+// RUN:   -march=rv64isvinval -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVINVAL-EXT %s
 // CHECK-SVINVAL-EXT: __riscv_svinval 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isvnapot -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVNAPOT-EXT %s
+// RUN:   -march=rv32isvnapot -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVNAPOT-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isvnapot -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVNAPOT-EXT %s
+// RUN:   -march=rv64isvnapot -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVNAPOT-EXT %s
 // CHECK-SVNAPOT-EXT: __riscv_svnapot 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isvpbmt -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVPBMT-EXT %s
+// RUN:   -march=rv32isvpbmt -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVPBMT-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isvpbmt -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVPBMT-EXT %s
+// RUN:   -march=rv64isvpbmt -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVPBMT-EXT %s
 // CHECK-SVPBMT-EXT: __riscv_svpbmt 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s
+// RUN:   -march=rv32iv1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-V-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s
+// RUN:   -march=rv64iv1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-V-EXT %s
 // CHECK-V-EXT: __riscv_v 1000000{{$}}
 // CHECK-V-EXT: __riscv_v_elen 64
 // CHECK-V-EXT: __riscv_v_elen_fp 64
@@ -307,621 +307,621 @@
 // CHECK-V-EXT: __riscv_vector 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixcvalu -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVALU-EXT %s
+// RUN:   -march=rv32ixcvalu -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVALU-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixcvalu -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVALU-EXT %s
+// RUN:   -march=rv64ixcvalu -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVALU-EXT %s
 // CHECK-XCVALU-EXT: __riscv_xcvalu 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixcvbi -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVBI-EXT %s
+// RUN:   -march=rv32ixcvbi -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVBI-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixcvbi -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVBI-EXT %s
+// RUN:   -march=rv64ixcvbi -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVBI-EXT %s
 // CHECK-XCVBI-EXT: __riscv_xcvbi 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixcvbitmanip -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVBITMANIP-EXT %s
+// RUN:   -march=rv32ixcvbitmanip -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVBITMANIP-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixcvbitmanip -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVBITMANIP-EXT %s
+// RUN:   -march=rv64ixcvbitmanip -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVBITMANIP-EXT %s
 // CHECK-XCVBITMANIP-EXT: __riscv_xcvbitmanip 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixcvmac -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVMAC-EXT %s
+// RUN:   -march=rv32ixcvmac -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVMAC-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixcvmac -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVMAC-EXT %s
+// RUN:   -march=rv64ixcvmac -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVMAC-EXT %s
 // CHECK-XCVMAC-EXT: __riscv_xcvmac 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixcvsimd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVSIMD-EXT %s
+// RUN:   -march=rv32ixcvsimd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVSIMD-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixcvsimd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XCVSIMD-EXT %s
+// RUN:   -march=rv64ixcvsimd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XCVSIMD-EXT %s
 // CHECK-XCVSIMD-EXT: __riscv_xcvsimd 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixsfvcp -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVCP-EXT %s
+// RUN:   -march=rv32ixsfvcp -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVCP-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixsfvcp -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVCP-EXT %s
+// RUN:   -march=rv64ixsfvcp -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVCP-EXT %s
 // CHECK-XSFVCP-EXT: __riscv_xsfvcp 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixsfvfnrclipxfqf -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVFNRCLIPXFQF-EXT %s
+// RUN:   -march=rv32ixsfvfnrclipxfqf -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVFNRCLIPXFQF-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixsfvfnrclipxfqf -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVFNRCLIPXFQF-EXT %s
+// RUN:   -march=rv64ixsfvfnrclipxfqf -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVFNRCLIPXFQF-EXT %s
 // CHECK-XSFVFNRCLIPXFQF-EXT: __riscv_xsfvfnrclipxfqf 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixsfvfwmaccqqq -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVFWMACCQQQ-EXT %s
+// RUN:   -march=rv32ixsfvfwmaccqqq -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVFWMACCQQQ-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixsfvfwmaccqqq -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVFWMACCQQQ-EXT %s
+// RUN:   -march=rv64ixsfvfwmaccqqq -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVFWMACCQQQ-EXT %s
 // CHECK-XSFVFWMACCQQQ-EXT: __riscv_xsfvfwmaccqqq 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixsfvqmaccdod -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVQMACCDOD-EXT %s
+// RUN:   -march=rv32ixsfvqmaccdod -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVQMACCDOD-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixsfvqmaccdod -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVQMACCDOD-EXT %s
+// RUN:   -march=rv64ixsfvqmaccdod -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVQMACCDOD-EXT %s
 // CHECK-XSFVQMACCDOD-EXT: __riscv_xsfvqmaccdod 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixsfvqmaccqoq -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVQMACCQOQ-EXT %s
+// RUN:   -march=rv32ixsfvqmaccqoq -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVQMACCQOQ-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixsfvqmaccqoq -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XSFVQMACCQOQ-EXT %s
+// RUN:   -march=rv64ixsfvqmaccqoq -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XSFVQMACCQOQ-EXT %s
 // CHECK-XSFVQMACCQOQ-EXT: __riscv_xsfvqmaccqoq 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadba -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADBA-EXT %s
+// RUN:   -march=rv32ixtheadba -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADBA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadba -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADBA-EXT %s
+// RUN:   -march=rv64ixtheadba -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADBA-EXT %s
 // CHECK-XTHEADBA-EXT: __riscv_xtheadba 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadbb -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADBB-EXT %s
+// RUN:   -march=rv32ixtheadbb -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADBB-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadbb -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADBB-EXT %s
+// RUN:   -march=rv64ixtheadbb -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADBB-EXT %s
 // CHECK-XTHEADBB-EXT: __riscv_xtheadbb 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadbs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADBS-EXT %s
+// RUN:   -march=rv32ixtheadbs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADBS-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadbs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADBS-EXT %s
+// RUN:   -march=rv64ixtheadbs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADBS-EXT %s
 // CHECK-XTHEADBS-EXT: __riscv_xtheadbs 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadcmo -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADCMO-EXT %s
+// RUN:   -march=rv32ixtheadcmo -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADCMO-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadcmo -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADCMO-EXT %s
+// RUN:   -march=rv64ixtheadcmo -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADCMO-EXT %s
 // CHECK-XTHEADCMO-EXT: __riscv_xtheadcmo 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadcondmov -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADCONDMOV-EXT %s
+// RUN:   -march=rv32ixtheadcondmov -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADCONDMOV-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadcondmov -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADCONDMOV-EXT %s
+// RUN:   -march=rv64ixtheadcondmov -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADCONDMOV-EXT %s
 // CHECK-XTHEADCONDMOV-EXT: __riscv_xtheadcondmov 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadfmemidx -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADFMEMIDX-EXT %s
+// RUN:   -march=rv32ixtheadfmemidx -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADFMEMIDX-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadfmemidx -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADFMEMIDX-EXT %s
+// RUN:   -march=rv64ixtheadfmemidx -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADFMEMIDX-EXT %s
 // CHECK-XTHEADFMEMIDX-EXT: __riscv_xtheadfmemidx 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadmac -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADMAC-EXT %s
+// RUN:   -march=rv32ixtheadmac -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADMAC-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadmac -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADMAC-EXT %s
+// RUN:   -march=rv64ixtheadmac -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADMAC-EXT %s
 // CHECK-XTHEADMAC-EXT: __riscv_xtheadmac 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadmemidx -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADMEMIDX-EXT %s
+// RUN:   -march=rv32ixtheadmemidx -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADMEMIDX-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadmemidx -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADMEMIDX-EXT %s
+// RUN:   -march=rv64ixtheadmemidx -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADMEMIDX-EXT %s
 // CHECK-XTHEADMEMIDX-EXT: __riscv_xtheadmemidx 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadmempair -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADMEMPAIR-EXT %s
+// RUN:   -march=rv32ixtheadmempair -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADMEMPAIR-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadmempair -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADMEMPAIR-EXT %s
+// RUN:   -march=rv64ixtheadmempair -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADMEMPAIR-EXT %s
 // CHECK-XTHEADMEMPAIR-EXT: __riscv_xtheadmempair 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadsync -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADSYNC-EXT %s
+// RUN:   -march=rv32ixtheadsync -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADSYNC-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadsync -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADSYNC-EXT %s
+// RUN:   -march=rv64ixtheadsync -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADSYNC-EXT %s
 // CHECK-XTHEADSYNC-EXT: __riscv_xtheadsync 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixtheadvdot -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADVDOT-EXT %s
+// RUN:   -march=rv32ixtheadvdot -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADVDOT-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixtheadvdot -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADVDOT-EXT %s
+// RUN:   -march=rv64ixtheadvdot -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XTHEADVDOT-EXT %s
 // CHECK-XTHEADVDOT-EXT: __riscv_xtheadvdot 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ixventanacondops -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XVENTANACONDOPS-EXT %s
+// RUN:   -march=rv32ixventanacondops -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XVENTANACONDOPS-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ixventanacondops -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-XVENTANACONDOPS-EXT %s
+// RUN:   -march=rv64ixventanacondops -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-XVENTANACONDOPS-EXT %s
 // CHECK-XVENTANACONDOPS-EXT: __riscv_xventanacondops 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iza128rs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZA128RS-EXT %s
+// RUN:   -march=rv32iza128rs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZA128RS-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iza128rs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZA128RS-EXT %s
+// RUN:   -march=rv64iza128rs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZA128RS-EXT %s
 // CHECK-ZA128RS-EXT: __riscv_za128rs 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iza64rs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZA64RS-EXT %s
+// RUN:   -march=rv32iza64rs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZA64RS-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iza64rs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZA64RS-EXT %s
+// RUN:   -march=rv64iza64rs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZA64RS-EXT %s
 // CHECK-ZA64RS-EXT: __riscv_za64rs 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izawrs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZAWRS-EXT %s
+// RUN:   -march=rv32izawrs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZAWRS-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izawrs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZAWRS-EXT %s
+// RUN:   -march=rv64izawrs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZAWRS-EXT %s
 // CHECK-ZAWRS-EXT: __riscv_zawrs 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izba1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
+// RUN:   -march=rv32izba1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izba -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
+// RUN:   -march=rv32izba -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izba1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
+// RUN:   -march=rv64izba1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izba -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
+// RUN:   -march=rv64izba -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
 // CHECK-ZBA-EXT: __riscv_zba 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izbb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
+// RUN:   -march=rv32izbb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izbb -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
+// RUN:   -march=rv32izbb -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izbb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
+// RUN:   -march=rv64izbb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izbb -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
+// RUN:   -march=rv64izbb -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
 // CHECK-ZBB-EXT: __riscv_zbb 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izbc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
+// RUN:   -march=rv32izbc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izbc -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
+// RUN:   -march=rv32izbc -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izbc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
+// RUN:   -march=rv64izbc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izbc -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
+// RUN:   -march=rv64izbc -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
 // CHECK-ZBC-EXT: __riscv_zbc 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izbkb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBKB-EXT %s
+// RUN:   -march=rv32izbkb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBKB-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izbkb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBKB-EXT %s
+// RUN:   -march=rv64izbkb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBKB-EXT %s
 // CHECK-ZBKB-EXT: __riscv_zbkb
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izbkc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBKC-EXT %s
+// RUN:   -march=rv32izbkc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBKC-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izbkc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBKC-EXT %s
+// RUN:   -march=rv64izbkc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBKC-EXT %s
 // CHECK-ZBKC-EXT: __riscv_zbkc
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izbkx1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBKX-EXT %s
+// RUN:   -march=rv32izbkx1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBKX-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izbkx1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBKX-EXT %s
+// RUN:   -march=rv64izbkx1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBKX-EXT %s
 // CHECK-ZBKX-EXT: __riscv_zbkx
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izbs1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
+// RUN:   -march=rv32izbs1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izbs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
+// RUN:   -march=rv32izbs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izbs1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
+// RUN:   -march=rv64izbs1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izbs -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
+// RUN:   -march=rv64izbs -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
 // CHECK-ZBS-EXT: __riscv_zbs 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izca1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCA-EXT %s
+// RUN:   -march=rv32izca1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izca1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCA-EXT %s
+// RUN:   -march=rv64izca1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCA-EXT %s
 // CHECK-ZCA-EXT: __riscv_zca 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izcb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCB-EXT %s
+// RUN:   -march=rv32izcb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCB-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izcb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCB-EXT %s
+// RUN:   -march=rv64izcb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCB-EXT %s
 // CHECK-ZCB-EXT: __riscv_zca 1000000{{$}}
 // CHECK-ZCB-EXT: __riscv_zcb 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izcd1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCD-EXT %s
+// RUN:   -march=rv32izcd1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCD-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izcd1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCD-EXT %s
+// RUN:   -march=rv64izcd1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCD-EXT %s
 // CHECK-ZCD-EXT: __riscv_zcd 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izce1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCE-EXT %s
+// RUN:   -march=rv32izce1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCE-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izce1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCE-EXT %s
+// RUN:   -march=rv64izce1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCE-EXT %s
 // CHECK-ZCE-EXT: __riscv_zce 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izcf1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCF-EXT %s
+// RUN:   -march=rv32izcf1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCF-EXT %s
 // CHECK-ZCF-EXT: __riscv_zcf 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izcmp1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCMP-EXT %s
+// RUN:   -march=rv32izcmp1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCMP-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izcmp1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCMP-EXT %s
+// RUN:   -march=rv64izcmp1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCMP-EXT %s
 // CHECK-ZCMP-EXT: __riscv_zca 1000000{{$}}
 // CHECK-ZCMP-EXT: __riscv_zcmp 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izcmt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCMT-EXT %s
+// RUN:   -march=rv32izcmt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCMT-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izcmt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCMT-EXT %s
+// RUN:   -march=rv64izcmt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCMT-EXT %s
 // CHECK-ZCMT-EXT: __riscv_zca 1000000{{$}}
 // CHECK-ZCMT-EXT: __riscv_zcmt 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izdinx1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZDINX-EXT %s
+// RUN:   -march=rv32izdinx1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZDINX-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izdinx1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZDINX-EXT %s
+// RUN:   -march=rv64izdinx1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZDINX-EXT %s
 // CHECK-ZDINX-EXT: __riscv_zdinx 1000000{{$}}
 // CHECK-ZDINX-EXT: __riscv_zfinx 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izfh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFH-EXT %s
+// RUN:   -march=rv32izfh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFH-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izfh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFH-EXT %s
+// RUN:   -march=rv64izfh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFH-EXT %s
 // CHECK-ZFH-EXT: __riscv_f 2002000{{$}}
 // CHECK-ZFH-EXT: __riscv_zfh 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izfhmin1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFHMIN-EXT %s
+// RUN:   -march=rv32izfhmin1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFHMIN-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izfhmin1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFHMIN-EXT %s
+// RUN:   -march=rv64izfhmin1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFHMIN-EXT %s
 // CHECK-ZFHMIN-EXT: __riscv_f 2002000{{$}}
 // CHECK-ZFHMIN-EXT: __riscv_zfhmin 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izfinx1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFINX-EXT %s
+// RUN:   -march=rv32izfinx1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFINX-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izfinx1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFINX-EXT %s
+// RUN:   -march=rv64izfinx1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFINX-EXT %s
 // CHECK-ZFINX-EXT: __riscv_zfinx 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izhinx1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZHINX-EXT %s
+// RUN:   -march=rv32izhinx1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZHINX-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izhinx1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZHINX-EXT %s
+// RUN:   -march=rv64izhinx1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZHINX-EXT %s
 // CHECK-ZHINX-EXT: __riscv_zhinx 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izhinxmin1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZHINXMIN-EXT %s
-// RUN: %clang --target=riscv64-unknown-linux-gnu -march=rv64izhinxmin1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZHINXMIN-EXT %s
+// RUN:   -march=rv32izhinxmin1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZHINXMIN-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu -march=rv64izhinxmin1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZHINXMIN-EXT %s
 // CHECK-ZHINXMIN-EXT: __riscv_zhinxmin 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izic64b -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIC64B-EXT %s
+// RUN:   -march=rv32izic64b -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIC64B-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izic64b -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIC64B-EXT %s
+// RUN:   -march=rv64izic64b -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIC64B-EXT %s
 // CHECK-ZIC64B-EXT: __riscv_zic64b 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izicbom -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOM-EXT %s
+// RUN:   -march=rv32izicbom -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICBOM-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izicbom -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOM-EXT %s
+// RUN:   -march=rv64izicbom -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICBOM-EXT %s
 // CHECK-ZICBOM-EXT: __riscv_zicbom 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izicbop -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOP-EXT %s
+// RUN:   -march=rv32izicbop -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICBOP-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izicbop -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOP-EXT %s
+// RUN:   -march=rv64izicbop -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICBOP-EXT %s
 // CHECK-ZICBOP-EXT: __riscv_zicbop 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izicboz -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOZ-EXT %s
+// RUN:   -march=rv32izicboz -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICBOZ-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izicboz -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOZ-EXT %s
+// RUN:   -march=rv64izicboz -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICBOZ-EXT %s
 // CHECK-ZICBOZ-EXT: __riscv_zicboz 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iziccamoa -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCAMOA-EXT %s
+// RUN:   -march=rv32iziccamoa -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICCAMOA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iziccamoa -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCAMOA-EXT %s
+// RUN:   -march=rv64iziccamoa -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICCAMOA-EXT %s
 // CHECK-ZICCAMOA-EXT: __riscv_ziccamoa 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iziccif -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCIF-EXT %s
+// RUN:   -march=rv32iziccif -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICCIF-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iziccif -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCIF-EXT %s
+// RUN:   -march=rv64iziccif -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICCIF-EXT %s
 // CHECK-ZICCIF-EXT: __riscv_ziccif 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izicclsm -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCLSM-EXT %s
+// RUN:   -march=rv32izicclsm -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICCLSM-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izicclsm -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCLSM-EXT %s
+// RUN:   -march=rv64izicclsm -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICCLSM-EXT %s
 // CHECK-ZICCLSM-EXT: __riscv_zicclsm 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iziccrse -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCRSE-EXT %s
+// RUN:   -march=rv32iziccrse -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICCRSE-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iziccrse -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICCRSE-EXT %s
+// RUN:   -march=rv64iziccrse -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICCRSE-EXT %s
 // CHECK-ZICCRSE-EXT: __riscv_ziccrse 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izicntr -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICNTR-EXT %s
+// RUN:   -march=rv32izicntr -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICNTR-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izicntr -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICNTR-EXT %s
+// RUN:   -march=rv64izicntr -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICNTR-EXT %s
 // CHECK-ZICNTR-EXT: __riscv_zicntr 2000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izicsr2p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICSR-EXT %s
+// RUN:   -march=rv32izicsr2p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICSR-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izicsr2p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICSR-EXT %s
+// RUN:   -march=rv64izicsr2p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICSR-EXT %s
 // CHECK-ZICSR-EXT: __riscv_zicsr 2000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izifencei2p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIFENCEI-EXT %s
+// RUN:   -march=rv32izifencei2p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIFENCEI-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izifencei2p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIFENCEI-EXT %s
+// RUN:   -march=rv64izifencei2p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIFENCEI-EXT %s
 // CHECK-ZIFENCEI-EXT: __riscv_zifencei 2000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izihintntl1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIHINTNTL-EXT %s
+// RUN:   -march=rv32izihintntl1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIHINTNTL-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izihintntl1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIHINTNTL-EXT %s
+// RUN:   -march=rv64izihintntl1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIHINTNTL-EXT %s
 // CHECK-ZIHINTNTL-EXT: __riscv_zihintntl 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izihintpause2p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIHINTPAUSE-EXT %s
+// RUN:   -march=rv32izihintpause2p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIHINTPAUSE-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izihintpause2p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIHINTPAUSE-EXT %s
+// RUN:   -march=rv64izihintpause2p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIHINTPAUSE-EXT %s
 // CHECK-ZIHINTPAUSE-EXT: __riscv_zihintpause 2000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izihpm -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIHPM-EXT %s
+// RUN:   -march=rv32izihpm -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIHPM-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izihpm -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIHPM-EXT %s
+// RUN:   -march=rv64izihpm -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIHPM-EXT %s
 // CHECK-ZIHPM-EXT: __riscv_zihpm 2000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izk1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZK-EXT %s
+// RUN:   -march=rv32izk1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZK-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izk1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZK-EXT %s
+// RUN:   -march=rv64izk1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZK-EXT %s
 // CHECK-ZK-EXT: __riscv_zk
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32i_zkn_zkt_zkr -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZK %s
+// RUN:   -march=rv32i_zkn_zkt_zkr -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZK %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64i_zkn_zkt_zkr -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZK %s
+// RUN:   -march=rv64i_zkn_zkt_zkr -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZK %s
 // CHECK-COMBINE-INTO-ZK: __riscv_zk 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izkn1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKN-EXT %s
+// RUN:   -march=rv32izkn1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKN-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izkn1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKN-EXT %s
+// RUN:   -march=rv64izkn1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKN-EXT %s
 // CHECK-ZKN-EXT: __riscv_zkn
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32i_zbkb_zbkc_zbkx_zkne_zknd_zknh -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKN %s
+// RUN:   -march=rv32i_zbkb_zbkc_zbkx_zkne_zknd_zknh -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKN %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64i_zbkb_zbkc_zbkx_zkne_zknd_zknh -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKN %s
+// RUN:   -march=rv64i_zbkb_zbkc_zbkx_zkne_zknd_zknh -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKN %s
 // CHECK-COMBINE-INTO-ZKN: __riscv_zkn 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izknd1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKND-EXT %s
+// RUN:   -march=rv32izknd1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKND-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izknd1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKND-EXT %s
+// RUN:   -march=rv64izknd1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKND-EXT %s
 // CHECK-ZKND-EXT: __riscv_zknd
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izkne1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKNE-EXT %s
+// RUN:   -march=rv32izkne1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKNE-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izkne1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKNE-EXT %s
+// RUN:   -march=rv64izkne1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKNE-EXT %s
 // CHECK-ZKNE-EXT: __riscv_zkne
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izknh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKNH-EXT %s
+// RUN:   -march=rv32izknh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKNH-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izknh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKNH-EXT %s
+// RUN:   -march=rv64izknh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKNH-EXT %s
 // CHECK-ZKNH-EXT: __riscv_zknh
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izkr1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKR-EXT %s
+// RUN:   -march=rv32izkr1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKR-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izkr1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKR-EXT %s
+// RUN:   -march=rv64izkr1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKR-EXT %s
 // CHECK-ZKR-EXT: __riscv_zkr
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32i_zbkb_zbkc_zbkx_zksed_zksh -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKS %s
+// RUN:   -march=rv32i_zbkb_zbkc_zbkx_zksed_zksh -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKS %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64i_zbkb_zbkc_zbkx_zksed_zksh -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKS %s
+// RUN:   -march=rv64i_zbkb_zbkc_zbkx_zksed_zksh -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKS %s
 // CHECK-COMBINE-INTO-ZKS: __riscv_zks 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izks1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKS-EXT %s
+// RUN:   -march=rv32izks1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKS-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izks1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKS-EXT %s
+// RUN:   -march=rv64izks1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKS-EXT %s
 // CHECK-ZKS-EXT: __riscv_zks
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izksed1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKSED-EXT %s
+// RUN:   -march=rv32izksed1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKSED-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izksed1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKSED-EXT %s
+// RUN:   -march=rv64izksed1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKSED-EXT %s
 // CHECK-ZKSED-EXT: __riscv_zksed
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izksh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKSH-EXT %s
+// RUN:   -march=rv32izksh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKSH-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izksh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKSH-EXT %s
+// RUN:   -march=rv64izksh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKSH-EXT %s
 // CHECK-ZKSH-EXT: __riscv_zksh
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKT-EXT %s
+// RUN:   -march=rv32izkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKT-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZKT-EXT %s
+// RUN:   -march=rv64izkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZKT-EXT %s
 // CHECK-ZKT-EXT: __riscv_zkt
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izmmul1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZMMUL-EXT %s
+// RUN:   -march=rv32izmmul1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZMMUL-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izmmul1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZMMUL-EXT %s
+// RUN:   -march=rv64izmmul1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZMMUL-EXT %s
 // CHECK-ZMMUL-EXT: __riscv_zmmul
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ifzve32f1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE32F-EXT %s
+// RUN:   -march=rv32ifzve32f1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE32F-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ifzve32f1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE32F-EXT %s
+// RUN:   -march=rv64ifzve32f1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE32F-EXT %s
 // CHECK-ZVE32F-EXT: __riscv_v_elen 32
 // CHECK-ZVE32F-EXT: __riscv_v_elen_fp 32
 // CHECK-ZVE32F-EXT: __riscv_v_intrinsic 12000{{$}}
@@ -931,11 +931,11 @@
 // CHECK-ZVE32F-EXT: __riscv_zve32x 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izve32x1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE32X-EXT %s
+// RUN:   -march=rv32izve32x1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE32X-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izve32x1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE32X-EXT %s
+// RUN:   -march=rv64izve32x1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE32X-EXT %s
 // CHECK-ZVE32X-EXT: __riscv_v_elen 32
 // CHECK-ZVE32X-EXT: __riscv_v_elen_fp 0
 // CHECK-ZVE32X-EXT: __riscv_v_intrinsic 12000{{$}}
@@ -944,11 +944,11 @@
 // CHECK-ZVE32X-EXT: __riscv_zve32x 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ifdzve64d1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE64D-EXT %s
+// RUN:   -march=rv32ifdzve64d1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE64D-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ifdzve64d1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE64D-EXT %s
+// RUN:   -march=rv64ifdzve64d1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE64D-EXT %s
 // CHECK-ZVE64D-EXT: __riscv_v_elen 64
 // CHECK-ZVE64D-EXT: __riscv_v_elen_fp 64
 // CHECK-ZVE64D-EXT: __riscv_v_intrinsic 12000{{$}}
@@ -961,11 +961,11 @@
 // CHECK-ZVE64D-EXT: __riscv_zve64x 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ifzve64f1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE64F-EXT %s
+// RUN:   -march=rv32ifzve64f1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE64F-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ifzve64f1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE64F-EXT %s
+// RUN:   -march=rv64ifzve64f1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE64F-EXT %s
 // CHECK-ZVE64F-EXT: __riscv_v_elen 64
 // CHECK-ZVE64F-EXT: __riscv_v_elen_fp 32
 // CHECK-ZVE64F-EXT: __riscv_v_intrinsic 12000{{$}}
@@ -977,11 +977,11 @@
 // CHECK-ZVE64F-EXT: __riscv_zve64x 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izve64x1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE64X-EXT %s
+// RUN:   -march=rv32izve64x1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE64X-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izve64x1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVE64X-EXT %s
+// RUN:   -march=rv64izve64x1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVE64X-EXT %s
 // CHECK-ZVE64X-EXT: __riscv_v_elen 64
 // CHECK-ZVE64X-EXT: __riscv_v_elen_fp 0
 // CHECK-ZVE64X-EXT: __riscv_v_intrinsic 12000{{$}}
@@ -991,409 +991,409 @@
 // CHECK-ZVE64X-EXT: __riscv_zve64x 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izvfh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVFH-EXT %s
+// RUN:   -march=rv32izvfh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVFH-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izvfh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVFH-EXT %s
+// RUN:   -march=rv64izvfh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVFH-EXT %s
 // CHECK-ZVFH-EXT: __riscv_zvfh
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izve32x1p0_zvl32b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL32b %s
+// RUN:   -march=rv32izve32x1p0_zvl32b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL32b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izve32x1p0_zvl32b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL32b %s
+// RUN:   -march=rv64izve32x1p0_zvl32b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL32b %s
 // CHECK-ZVL32b: __riscv_v_min_vlen 32
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izve32x1p0_zvl64b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL64b %s
+// RUN:   -march=rv32izve32x1p0_zvl64b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL64b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izve32x1p0_zvl64b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL64b %s
+// RUN:   -march=rv64izve32x1p0_zvl64b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL64b %s
 // CHECK-ZVL64b: __riscv_v_min_vlen 64
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl128b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL128b %s
+// RUN:   -march=rv32iv1p0_zvl128b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL128b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl128b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL128b %s
+// RUN:   -march=rv64iv1p0_zvl128b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL128b %s
 // CHECK-ZVL128b: __riscv_v_min_vlen 128
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl256b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL256b %s
+// RUN:   -march=rv32iv1p0_zvl256b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL256b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl256b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL256b %s
+// RUN:   -march=rv64iv1p0_zvl256b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL256b %s
 // CHECK-ZVL256b: __riscv_v_min_vlen 256
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl512b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL512b %s
+// RUN:   -march=rv32iv1p0_zvl512b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL512b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl512b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL512b %s
+// RUN:   -march=rv64iv1p0_zvl512b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL512b %s
 // CHECK-ZVL512b: __riscv_v_min_vlen 512
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl1024b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL1024b %s
+// RUN:   -march=rv32iv1p0_zvl1024b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL1024b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl1024b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL1024b %s
+// RUN:   -march=rv64iv1p0_zvl1024b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL1024b %s
 // CHECK-ZVL1024b: __riscv_v_min_vlen 1024
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl2048b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL2048b %s
+// RUN:   -march=rv32iv1p0_zvl2048b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL2048b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl2048b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL2048b %s
+// RUN:   -march=rv64iv1p0_zvl2048b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL2048b %s
 // CHECK-ZVL2048b: __riscv_v_min_vlen 2048
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl4096b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL4096b %s
+// RUN:   -march=rv32iv1p0_zvl4096b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL4096b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl4096b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL4096b %s
+// RUN:   -march=rv64iv1p0_zvl4096b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL4096b %s
 // CHECK-ZVL4096b: __riscv_v_min_vlen 4096
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl8192b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL8192b %s
+// RUN:   -march=rv32iv1p0_zvl8192b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL8192b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl8192b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL8192b %s
+// RUN:   -march=rv64iv1p0_zvl8192b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL8192b %s
 // CHECK-ZVL8192b: __riscv_v_min_vlen 8192
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl16384b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL16384b %s
+// RUN:   -march=rv32iv1p0_zvl16384b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL16384b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl16384b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL16384b %s
+// RUN:   -march=rv64iv1p0_zvl16384b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL16384b %s
 // CHECK-ZVL16384b: __riscv_v_min_vlen 16384
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl32768b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL32768b %s
+// RUN:   -march=rv32iv1p0_zvl32768b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL32768b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl32768b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL32768b %s
+// RUN:   -march=rv64iv1p0_zvl32768b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL32768b %s
 // CHECK-ZVL32768b: __riscv_v_min_vlen 32768
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32iv1p0_zvl65536b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL65536b %s
+// RUN:   -march=rv32iv1p0_zvl65536b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL65536b %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64iv1p0_zvl65536b1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVL65536b %s
+// RUN:   -march=rv64iv1p0_zvl65536b1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVL65536b %s
 // CHECK-ZVL65536b: __riscv_v_min_vlen 65536
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32ismaia1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SMAIA-EXT %s
+// RUN:   -march=rv32ismaia1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SMAIA-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64ismaia1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SMAIA-EXT %s
+// RUN:   -march=rv64ismaia1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SMAIA-EXT %s
 // CHECK-SMAIA-EXT: __riscv_smaia  1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32issaia1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSAIA-EXT %s
+// RUN:   -march=rv32issaia1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSAIA-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64issaia1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSAIA-EXT %s
+// RUN:   -march=rv64issaia1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSAIA-EXT %s
 // CHECK-SSAIA-EXT: __riscv_ssaia  1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32ismepmp1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SMEPMP-EXT %s
+// RUN:   -march=rv32ismepmp1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SMEPMP-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64ismepmp1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SMEPMP-EXT %s
+// RUN:   -march=rv64ismepmp1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SMEPMP-EXT %s
 // CHECK-SMEPMP-EXT: __riscv_smepmp  1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32izfa -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFA-EXT %s
+// RUN:   -march=rv32izfa -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64izfa -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFA-EXT %s
+// RUN:   -march=rv64izfa -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFA-EXT %s
 // CHECK-ZFA-EXT: __riscv_zfa 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvbb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVBB-EXT %s
+// RUN:   -march=rv32i_zve64x_zvbb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVBB-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvbb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVBB-EXT %s
+// RUN:   -march=rv64i_zve64x_zvbb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVBB-EXT %s
 // CHECK-ZVBB-EXT: __riscv_zvbb  1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvbc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVBC-EXT %s
+// RUN:   -march=rv32i_zve64x_zvbc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVBC-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvbc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVBC-EXT %s
+// RUN:   -march=rv64i_zve64x_zvbc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVBC-EXT %s
 // CHECK-ZVBC-EXT: __riscv_zvbc  1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvkb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKB-EXT %s
+// RUN:   -march=rv32i_zve64x_zvkb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKB-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvkb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKB-EXT %s
+// RUN:   -march=rv64i_zve64x_zvkb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKB-EXT %s
 // CHECK-ZVKB-EXT: __riscv_zvkb  1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve32x_zvkg1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKG-EXT %s
+// RUN:   -march=rv32i_zve32x_zvkg1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKG-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve32x_zvkg1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKG-EXT %s
+// RUN:   -march=rv64i_zve32x_zvkg1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKG-EXT %s
 // CHECK-ZVKG-EXT: __riscv_zvkg  1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvkn1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKN-EXT %s
+// RUN:   -march=rv32i_zve64x_zvkn1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKN-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvkn1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKN-EXT %s
+// RUN:   -march=rv64i_zve64x_zvkn1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKN-EXT %s
 // CHECK-ZVKN-EXT: __riscv_zvkn 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32iv_zvkb1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKN %s
+// RUN:   -march=rv32iv_zvkb1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKN %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64iv_zvkb1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKN %s
+// RUN:   -march=rv64iv_zvkb1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKN %s
 // CHECK-COMBINE-INTO-ZVKN: __riscv_zvkn 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvknc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNC-EXT %s
+// RUN:   -march=rv32i_zve64x_zvknc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNC-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvknc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNC-EXT %s
+// RUN:   -march=rv64i_zve64x_zvknc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNC-EXT %s
 // CHECK-ZVKNC-EXT: __riscv_zvknc 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32iv_zvkb1p0_zvbc1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKNC %s
+// RUN:   -march=rv32iv_zvkb1p0_zvbc1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKNC %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64iv_zvkb1p0_zvbc1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKNC %s
+// RUN:   -march=rv64iv_zvkb1p0_zvbc1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKNC %s
 // CHECK-COMBINE-INTO-ZVKNC: __riscv_zvkn 1000000{{$}}
 // CHECK-COMBINE-INTO-ZVKNC: __riscv_zvknc 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve32x_zvkned1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNED-EXT %s
+// RUN:   -march=rv32i_zve32x_zvkned1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNED-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve32x_zvkned1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNED-EXT %s
+// RUN:   -march=rv64i_zve32x_zvkned1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNED-EXT %s
 // CHECK-ZVKNED-EXT: __riscv_zvkned 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvkng1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNG-EXT %s
+// RUN:   -march=rv32i_zve64x_zvkng1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNG-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvkng1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNG-EXT %s
+// RUN:   -march=rv64i_zve64x_zvkng1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNG-EXT %s
 // CHECK-ZVKNG-EXT: __riscv_zvkng 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32iv_zvkb1p0_zvkg1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKNG %s
+// RUN:   -march=rv32iv_zvkb1p0_zvkg1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKNG %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64iv_zvkb1p0_zvkg1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKNG %s
+// RUN:   -march=rv64iv_zvkb1p0_zvkg1p0_zvkned1p0_zvknhb1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKNG %s
 // CHECK-COMBINE-INTO-ZVKNG: __riscv_zvkn 1000000{{$}}
 // CHECK-COMBINE-INTO-ZVKNG: __riscv_zvkng 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve32x_zvknha1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNHA-EXT %s
+// RUN:   -march=rv32i_zve32x_zvknha1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNHA-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve32x_zvknha1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNHA-EXT %s
+// RUN:   -march=rv64i_zve32x_zvknha1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNHA-EXT %s
 // CHECK-ZVKNHA-EXT: __riscv_zvknha 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvknhb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNHB-EXT %s
+// RUN:   -march=rv32i_zve64x_zvknhb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNHB-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvknhb1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKNHB-EXT %s
+// RUN:   -march=rv64i_zve64x_zvknhb1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKNHB-EXT %s
 // CHECK-ZVKNHB-EXT: __riscv_zvknhb  1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvks1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKS-EXT %s
+// RUN:   -march=rv32i_zve64x_zvks1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKS-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvks1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKS-EXT %s
+// RUN:   -march=rv64i_zve64x_zvks1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKS-EXT %s
 // CHECK-ZVKS-EXT: __riscv_zvks 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32iv_zvkb1p0_zvksed1p0_zvksh1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKS %s
+// RUN:   -march=rv32iv_zvkb1p0_zvksed1p0_zvksh1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKS %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64iv_zvkb1p0_zvksed1p0_zvksh1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKS %s
+// RUN:   -march=rv64iv_zvkb1p0_zvksed1p0_zvksh1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKS %s
 // CHECK-COMBINE-INTO-ZVKS: __riscv_zvks 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvksc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKSC-EXT %s
+// RUN:   -march=rv32i_zve64x_zvksc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKSC-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvksc1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKSC-EXT %s
+// RUN:   -march=rv64i_zve64x_zvksc1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKSC-EXT %s
 // CHECK-ZVKSC-EXT: __riscv_zvksc 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32iv_zvkb1p0_zvbc1p0_zvksed1p0_zvksh1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKSC %s
+// RUN:   -march=rv32iv_zvkb1p0_zvbc1p0_zvksed1p0_zvksh1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKSC %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64iv_zvkb1p0_zvbc1p0_zvksed1p0_zvksh1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKSC %s
+// RUN:   -march=rv64iv_zvkb1p0_zvbc1p0_zvksed1p0_zvksh1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKSC %s
 // CHECK-COMBINE-INTO-ZVKSC: __riscv_zvks 1000000{{$}}
 // CHECK-COMBINE-INTO-ZVKSC: __riscv_zvksc 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve32x_zvksed1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKSED-EXT %s
+// RUN:   -march=rv32i_zve32x_zvksed1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKSED-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve32x_zvksed1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKSED-EXT %s
+// RUN:   -march=rv64i_zve32x_zvksed1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKSED-EXT %s
 // CHECK-ZVKSED-EXT: __riscv_zvksed  1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve64x_zvksg1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKSG-EXT %s
+// RUN:   -march=rv32i_zve64x_zvksg1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKSG-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve64x_zvksg1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKSG-EXT %s
+// RUN:   -march=rv64i_zve64x_zvksg1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKSG-EXT %s
 // CHECK-ZVKSG-EXT: __riscv_zvksg 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32iv_zvkb1p0_zvkg1p0_zvksed1p0_zvksh1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKSG %s
+// RUN:   -march=rv32iv_zvkb1p0_zvkg1p0_zvksed1p0_zvksh1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKSG %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64iv_zvkb1p0_zvkg1p0_zvksed1p0_zvksh1p0_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKSG %s
+// RUN:   -march=rv64iv_zvkb1p0_zvkg1p0_zvksed1p0_zvksh1p0_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZVKSG %s
 // CHECK-COMBINE-INTO-ZVKSG: __riscv_zvks 1000000{{$}}
 // CHECK-COMBINE-INTO-ZVKSG: __riscv_zvksg 1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve32x_zvksh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKSH-EXT %s
+// RUN:   -march=rv32i_zve32x_zvksh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKSH-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve32x_zvksh1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKSH-EXT %s
+// RUN:   -march=rv64i_zve32x_zvksh1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKSH-EXT %s
 // CHECK-ZVKSH-EXT: __riscv_zvksh  1000000{{$}}
 
 // RUN: %clang --target=riscv32 \
-// RUN: -march=rv32i_zve32x_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKT-EXT %s
+// RUN:   -march=rv32i_zve32x_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKT-EXT %s
 // RUN: %clang --target=riscv64 \
-// RUN: -march=rv64i_zve32x_zvkt1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVKT-EXT %s
+// RUN:   -march=rv64i_zve32x_zvkt1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVKT-EXT %s
 // CHECK-ZVKT-EXT: __riscv_zvkt 1000000{{$}}
 
 // Experimental extensions
 
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32i_zacas1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZACAS-EXT %s
+// RUN:   -march=rv32i_zacas1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZACAS-EXT %s
 // RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64i_zacas1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZACAS-EXT %s
+// RUN:   -march=rv64i_zacas1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZACAS-EXT %s
 // CHECK-ZACAS-EXT: __riscv_zacas 1000000{{$}}
 
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32izfbfmin1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFBFMIN-EXT %s
+// RUN:   -march=rv32izfbfmin1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFBFMIN-EXT %s
 // RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64izfbfmin1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZFBFMIN-EXT %s
+// RUN:   -march=rv64izfbfmin1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZFBFMIN-EXT %s
 // CHECK-ZFBFMIN-EXT: __riscv_zfbfmin 1000000{{$}}
 
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32i_zicfilp0p4 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
+// RUN:   -march=rv32i_zicfilp0p4 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
 // RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64i_zicfilp0p4 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
+// RUN:   -march=rv64i_zicfilp0p4 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
 // CHECK-ZICFILP-EXT: __riscv_zicfilp 4000{{$}}
 
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32i_zicond1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// RUN:   -march=rv32i_zicond1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
 // RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64i_zicond1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// RUN:   -march=rv64i_zicond1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
 // CHECK-ZICOND-EXT: __riscv_zicond  1000000{{$}}
 
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32i_zimop0p1 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIMOP-EXT %s
+// RUN:   -march=rv32i_zimop0p1 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIMOP-EXT %s
 // RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64i_zimop0p1 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZIMOP-EXT %s
+// RUN:   -march=rv64i_zimop0p1 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZIMOP-EXT %s
 // CHECK-ZIMOP-EXT: __riscv_zimop  1000{{$}}
 
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32i_zcmop0p2 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCMOP-EXT %s
+// RUN:   -march=rv32i_zcmop0p2 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCMOP-EXT %s
 // RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64i_zcmop0p2 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZCMOP-EXT %s
+// RUN:   -march=rv64i_zcmop0p2 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZCMOP-EXT %s
 // CHECK-ZCMOP-EXT: __riscv_zcmop  2000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu -menable-experimental-extensions \
-// RUN: -march=rv32iztso0p1 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZTSO-EXT %s
+// RUN:   -march=rv32iztso0p1 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZTSO-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu -menable-experimental-extensions \
-// RUN: -march=rv64iztso0p1 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZTSO-EXT %s
+// RUN:   -march=rv64iztso0p1 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZTSO-EXT %s
 // CHECK-ZTSO-EXT: __riscv_ztso 1000{{$}}
 
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32ifzvfbfmin1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVFBFMIN-EXT %s
+// RUN:   -march=rv32ifzvfbfmin1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVFBFMIN-EXT %s
 // RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64ifzvfbfmin1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVFBFMIN-EXT %s
+// RUN:   -march=rv64ifzvfbfmin1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVFBFMIN-EXT %s
 // CHECK-ZVFBFMIN-EXT: __riscv_zvfbfmin 1000000{{$}}
 
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32ifzvfbfwma1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVFBFWMA-EXT %s
+// RUN:   -march=rv32ifzvfbfwma1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVFBFWMA-EXT %s
 // RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64ifzvfbfwma1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZVFBFWMA-EXT %s
+// RUN:   -march=rv64ifzvfbfwma1p0 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZVFBFWMA-EXT %s
 // CHECK-ZVFBFWMA-EXT: __riscv_zvfbfwma 1000000{{$}}
 
 // RUN: %clang -target riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32izicfiss0p4 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICFISS-EXT %s
+// RUN:   -march=rv32izicfiss0p4 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICFISS-EXT %s
 // RUN: %clang -target riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64izicfiss0p4 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICFISS-EXT %s
+// RUN:   -march=rv64izicfiss0p4 -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-ZICFISS-EXT %s
 // CHECK-ZICFISS-EXT: __riscv_zicfiss 4000{{$}}
 
 // Misaligned
 
-// RUN: %clang --target=riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \
-// RUN: -o - | FileCheck %s --check-prefix=CHECK-MISALIGNED-AVOID
-// RUN: %clang --target=riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \
-// RUN: -o - | FileCheck %s --check-prefix=CHECK-MISALIGNED-AVOID
+// RUN: %clang --target=riscv32-unknown-linux-gnu -march=rv32i -E -dM %s \
+// RUN:   -o - | FileCheck %s --check-prefix=CHECK-MISALIGNED-AVOID
+// RUN: %clang --target=riscv64-unknown-linux-gnu -march=rv64i -E -dM %s \
+// RUN:   -o - | FileCheck %s --check-prefix=CHECK-MISALIGNED-AVOID
 // CHECK-MISALIGNED-AVOID: __riscv_misaligned_avoid 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu -march=rv32i -E -dM %s \

>From af26599e6a588d696be6fe8792773117929b043a Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Wed, 24 Jan 2024 18:39:07 -0800
Subject: [PATCH 2/6] [RISCV] Add many of the S extensions mentioned in the
 profile specification.

This is a good portion of the extensions mentioned in the RVA23
profile here https://github.com/riscv/riscv-profiles/blob/main/rva23-profile.adoc

I don't believe these add any new CSRs. Sstc does add new CSRs, but
we already added them without the extension name.
---
 .../test/Preprocessor/riscv-target-features.c | 146 +++++++++++++++++-
 llvm/docs/RISCVUsage.rst                      |  15 ++
 llvm/lib/Support/RISCVISAInfo.cpp             |  16 ++
 llvm/lib/Target/RISCV/RISCVFeatures.td        |  59 +++++++
 llvm/test/CodeGen/RISCV/attributes.ll         |  64 ++++++++
 llvm/test/MC/RISCV/attribute-arch.s           |  48 ++++++
 llvm/unittests/Support/RISCVISAInfoTest.cpp   |  16 ++
 7 files changed, 363 insertions(+), 1 deletion(-)

diff --git a/clang/test/Preprocessor/riscv-target-features.c b/clang/test/Preprocessor/riscv-target-features.c
index 4112e7d473d233e..3a2441004c46d03 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -19,9 +19,25 @@
 // CHECK-NOT: __riscv_m {{.*$}}
 // CHECK-NOT: __riscv_mul {{.*$}}
 // CHECK-NOT: __riscv_muldiv {{.*$}}
+// CHECK-NOT: __riscv_shcounterenw {{.*$}}
+// CHECK-NOT: __riscv_shgatpa {{.*$}}
+// CHECK-NOT: __riscv_shtvala {{.*$}}
+// CHECK-NOT: __riscv_shvsatpa {{.*$}}
+// CHECK-NOT: __riscv_shvstvala {{.*$}}
+// CHECK-NOT: __riscv_shvstvecd {{.*$}}
 // CHECK-NOT: __riscv_smaia {{.*$}}
-// CHECK-NOT: __riscv_ssaia {{.*$}}
 // CHECK-NOT: __riscv_smepmp {{.*$}}
+// CHECK-NOT: __riscv_ssaia {{.*$}}
+// CHECK-NOT: __riscv_ssccptr {{.*$}}
+// CHECK-NOT: __riscv_sscounterenw {{.*$}}
+// CHECK-NOT: __riscv_ssstateen {{.*$}}
+// CHECK-NOT: __riscv_sstc {{.*$}}
+// CHECK-NOT: __riscv_sstvala {{.*$}}
+// CHECK-NOT: __riscv_sstvecd {{.*$}}
+// CHECK-NOT: __riscv_ssu64xl {{.*$}}
+// CHECK-NOT: __riscv_svade {{.*$}}
+// CHECK-NOT: __riscv_svadu {{.*$}}
+// CHECK-NOT: __riscv_svbare {{.*$}}
 // CHECK-NOT: __riscv_svinval {{.*$}}
 // CHECK-NOT: __riscv_svnapot {{.*$}}
 // CHECK-NOT: __riscv_svpbmt {{.*$}}
@@ -269,6 +285,134 @@
 // CHECK-M-EXT: __riscv_mul 1
 // CHECK-M-EXT: __riscv_muldiv 1
 
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32ishcounterenw -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHCOUNTERENW-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64ishcounterenw -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHCOUNTERENW-EXT %s
+// CHECK-SHCOUNTERENW-EXT: __riscv_shcounterenw 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32ishgatpa -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHGATPA-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64ishgatpa -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHGATPA-EXT %s
+// CHECK-SHGATPA-EXT: __riscv_shgatpa 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32ishtvala -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHTVALA-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64ishtvala -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHTVALA-EXT %s
+// CHECK-SHTVALA-EXT: __riscv_shtvala 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32ishvsatpa -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSATPA-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64ishvsatpa -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSATPA-EXT %s
+// CHECK-SHVSATPA-EXT: __riscv_shvsatpa 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32ishvstvala -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSTVALA-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64ishvstvala -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSTVALA-EXT %s
+// CHECK-SHVSTVALA-EXT: __riscv_shvstvala 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32ishvstvecd -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSTVECD-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64ishvstvecd -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSTVECD-EXT %s
+// CHECK-SHVSTVECD-EXT: __riscv_shvstvecd 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32issccptr -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSCCPTR-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64issccptr -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSCCPTR-EXT %s
+// CHECK-SSCCPTR-EXT: __riscv_ssccptr 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32isscounterenw -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSCOUNTERENW-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64isscounterenw -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSCOUNTERENW-EXT %s
+// CHECK-SSCOUNTERENW-EXT: __riscv_sscounterenw 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32issstateen -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSSTATEEN-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64issstateen -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSSTATEEN-EXT %s
+// CHECK-SSSTATEEN-EXT: __riscv_ssstateen 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32isstc -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSTC-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64isstc -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSTC-EXT %s
+// CHECK-SSTC-EXT: __riscv_sstc 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32isstvala -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSTVALA-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64isstvala -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSTVALA-EXT %s
+// CHECK-SSTVALA-EXT: __riscv_sstvala 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32isstvecd -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSTVECD-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64isstvecd -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSTVECD-EXT %s
+// CHECK-SSTVECD-EXT: __riscv_sstvecd 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32issu64xl -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSU64XL-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64issu64xl -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSU64XL-EXT %s
+// CHECK-SSU64XL-EXT: __riscv_ssu64xl 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32isvade -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SVADE-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64isvade -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SVADE-EXT %s
+// CHECK-SVADE-EXT: __riscv_svade 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32isvadu -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SVADU-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64isvadu -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SVADU-EXT %s
+// CHECK-SVADU-EXT: __riscv_svadu 1000000{{$}}
+
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32isvbare -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SVBARE-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64isvbare -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SVBARE-EXT %s
+// CHECK-SVBARE-EXT: __riscv_svbare 1000000{{$}}
+
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
 // RUN:   -march=rv32isvinval -E -dM %s \
 // RUN:   -o - | FileCheck --check-prefix=CHECK-SVINVAL-EXT %s
diff --git a/llvm/docs/RISCVUsage.rst b/llvm/docs/RISCVUsage.rst
index 9dbbc3f04387b65..ef54ee53d7deae6 100644
--- a/llvm/docs/RISCVUsage.rst
+++ b/llvm/docs/RISCVUsage.rst
@@ -91,9 +91,24 @@ on support follow.
      ``E``            Supported (`See note <#riscv-rve-note>`__)
      ``H``            Assembly Support
      ``M``            Supported
+     ``Shcounterenw`` Assembly Support
+     ``Shgatpa``      Assembly Support
+     ``Shtvala``      Assembly Support
+     ``Shvsatpa``    Assembly Support
+     ``Shvstvala``    Assembly Support
+     ``Shvstvecd``    Assembly Support
      ``Smaia``        Supported
      ``Smepmp``       Supported
      ``Ssaia``        Supported
+     ``Ssccptr``      Assembly Support
+     ``Sscounterenw`` Assembly Support
+     ``Sstc``         Assembly Support
+     ``Sstvala``      Assembly Support
+     ``Sstvecd``      Assembly Support
+     ``ssu64xl``      Assembly Support
+     ``Svade``        Assembly Support
+     ``Svadu``        Assembly Support
+     ``Svbare``       Assembly Support
      ``Svinval``      Assembly Support
      ``Svnapot``      Assembly Support
      ``Svpbmt``       Supported
diff --git a/llvm/lib/Support/RISCVISAInfo.cpp b/llvm/lib/Support/RISCVISAInfo.cpp
index 3c02492e99f1db4..073f498d8beef83 100644
--- a/llvm/lib/Support/RISCVISAInfo.cpp
+++ b/llvm/lib/Support/RISCVISAInfo.cpp
@@ -54,9 +54,25 @@ static const RISCVSupportedExtension SupportedExtensions[] = {
     {"i", {2, 1}},
     {"m", {2, 0}},
 
+    {"shcounterenw", {1, 0}},
+    {"shgatpa", {1, 0}},
+    {"shtvala", {1, 0}},
+    {"shvsatpa", {1, 0}},
+    {"shvstvala", {1, 0}},
+    {"shvstvecd", {1, 0}},
     {"smaia", {1, 0}},
     {"smepmp", {1, 0}},
     {"ssaia", {1, 0}},
+    {"ssccptr", {1, 0}},
+    {"sscounterenw", {1, 0}},
+    {"ssstateen", {1, 0}},
+    {"sstc", {1, 0}},
+    {"sstvala", {1, 0}},
+    {"sstvecd", {1, 0}},
+    {"ssu64xl", {1, 0}},
+    {"svade", {1, 0}},
+    {"svadu", {1, 0}},
+    {"svbare", {1, 0}},
     {"svinval", {1, 0}},
     {"svnapot", {1, 0}},
     {"svpbmt", {1, 0}},
diff --git a/llvm/lib/Target/RISCV/RISCVFeatures.td b/llvm/lib/Target/RISCV/RISCVFeatures.td
index 3878be680c04929..e40b1442921c763 100644
--- a/llvm/lib/Target/RISCV/RISCVFeatures.td
+++ b/llvm/lib/Target/RISCV/RISCVFeatures.td
@@ -751,6 +751,13 @@ def HasStdExtH : Predicate<"Subtarget->hasStdExtH()">,
 
 // Supervisor extensions
 
+def FeatureStdExtShgatpa
+    : SubtargetFeature<"shgatpa", "HasStdExtShgatpa", "true",
+                       "'Sgatpa' (SvNNx4 mode supported for all modes supported by satp, as well as Bare)", []>;
+def FeatureStdExtShvsatpa
+    : SubtargetFeature<"shvsatpa", "HasStdExtSvsatpa", "true",
+                       "'Svsatpa' (vsatp supports all modes supported by satp)", []>;
+
 def FeatureStdExtSmaia
     : SubtargetFeature<"smaia", "HasStdExtSmaia", "true",
                        "'Smaia' (Advanced Interrupt Architecture Machine "
@@ -764,6 +771,58 @@ def FeatureStdExtSmepmp
     : SubtargetFeature<"smepmp", "HasStdExtSmepmp", "true",
                        "'Smepmp' (Enhanced Physical Memory Protection)", []>;
 
+def FeatureStdExtSsccptr
+    : SubtargetFeature<"ssccptr", "HasStdExtSsccptr", "true",
+                       "'Ssccptr' (Main memory supports page table reads)", []>;
+
+def FeatureStdExtShcounterenvw
+    : SubtargetFeature<"shcounterenw", "HasStdExtShcounterenw", "true",
+                       "'Shcounterenw' (Support writeable enables for any supproted counter)", []>;
+def FeatureStdExtSscounterenvw
+    : SubtargetFeature<"sscounterenw", "HasStdExtSscounterenw", "true",
+                       "'Sscounterenw' (Support writeable enables for any supproted counter)", []>;
+
+def FeatureStdExtSsstateen
+    : SubtargetFeature<"ssstateen", "HasStdExtSsstateen", "true",
+                       "'Ssstateen' (Supervisor-mode view of the state-enable extension)", []>;
+
+def FeatureStdExtSstc
+    : SubtargetFeature<"sstc", "HasStdExtSstc", "true",
+                       "'Sstc' (Supervisor-mode timer interrupts)", []>;
+
+def FeatureStdExtShtvala
+    : SubtargetFeature<"shtvala", "HasStdExtShtvala", "true",
+                       "'Shtvala' (htval provides all needed values)", []>;
+def FeatureStdExtShvstvala
+    : SubtargetFeature<"shvstvala", "HasStdExtShvstvala", "true",
+                       "'Shvstvala' (vstval provides all needed values)", []>;
+def FeatureStdExtSstvala
+    : SubtargetFeature<"sstvala", "HasStdExtSstvala", "true",
+                       "'Sstvala' (stval provides all needed values)", []>;
+
+def FeatureStdExtShvstvecd
+    : SubtargetFeature<"shvstvecd", "HasStdExtShvstvecd", "true",
+                       "'Shvstvecd' (vstvec supports Direct mode)", []>;
+def FeatureStdExtSstvecd
+    : SubtargetFeature<"sstvecd", "HasStdExtSstvecd", "true",
+                       "'Sstvecd' (stvec supports Direct mode)", []>;
+
+def FeatureStdExtSsu64xl
+    : SubtargetFeature<"ssu64xl", "HasStdExtSsu64xl", "true",
+                       "'Ssu64xl' (UXLEN=64 supported)", []>;
+
+def FeaturesStdExtSvade
+    : SubtargetFeature<"svade", "HasStdExtSvade", "true",
+                       "'Svade' (Raise exceptions on improper A/D bits)", []>;
+
+def FeaturesStdExtSvadu
+    : SubtargetFeature<"svadu", "HasStdExtSvadu", "true",
+                       "'Svadu' (Hardware A/D updates)", []>;
+
+def FeaturesStdExtSvbare
+    : SubtargetFeature<"svbare", "HasStdExtSvbare", "true",
+                       "'Svbare' $(satp mode Bare supported)", []>;
+
 def FeatureStdExtSvinval
     : SubtargetFeature<"svinval", "HasStdExtSvinval", "true",
                        "'Svinval' (Fine-Grained Address-Translation Cache Invalidation)">;
diff --git a/llvm/test/CodeGen/RISCV/attributes.ll b/llvm/test/CodeGen/RISCV/attributes.ll
index b90bef7525379d1..3e009b8208fd3e5 100644
--- a/llvm/test/CodeGen/RISCV/attributes.ll
+++ b/llvm/test/CodeGen/RISCV/attributes.ll
@@ -38,6 +38,22 @@
 ; RUN: llc -mtriple=riscv32 -mattr=+zicbom %s -o - | FileCheck --check-prefixes=CHECK,RV32ZICBOM %s
 ; RUN: llc -mtriple=riscv32 -mattr=+zicboz %s -o - | FileCheck --check-prefixes=CHECK,RV32ZICBOZ %s
 ; RUN: llc -mtriple=riscv32 -mattr=+zicbop %s -o - | FileCheck --check-prefixes=CHECK,RV32ZICBOP %s
+; RUN: llc -mtriple=riscv32 -mattr=+shcounterenw %s -o - | FileCheck --check-prefixes=CHECK,RV32SHCOUNTERENW %s
+; RUN: llc -mtriple=riscv32 -mattr=+shgatpa %s -o - | FileCheck --check-prefixes=CHECK,RV32SHGATPA %s
+; RUN: llc -mtriple=riscv32 -mattr=+shvsatpa %s -o - | FileCheck --check-prefixes=CHECK,RV32SHVSATPA %s
+; RUN: llc -mtriple=riscv32 -mattr=+ssccptr %s -o - | FileCheck --check-prefixes=CHECK,RV32SSCCPTR %s
+; RUN: llc -mtriple=riscv32 -mattr=+sscounterenw %s -o - | FileCheck --check-prefixes=CHECK,RV32SSCOUNTERENW %s
+; RUN: llc -mtriple=riscv32 -mattr=+ssstateen %s -o - | FileCheck --check-prefixes=CHECK,RV32SSSTATEEN %s
+; RUN: llc -mtriple=riscv32 -mattr=+sstc %s -o - | FileCheck --check-prefixes=CHECK,RV32SSTC %s
+; RUN: llc -mtriple=riscv32 -mattr=+shtvala %s -o - | FileCheck --check-prefixes=CHECK,RV32SHTVALA %s
+; RUN: llc -mtriple=riscv32 -mattr=+shvstvala %s -o - | FileCheck --check-prefixes=CHECK,RV32SHVSTVALA %s
+; RUN: llc -mtriple=riscv32 -mattr=+shvstvecd %s -o - | FileCheck --check-prefixes=CHECK,RV32SHVSTVECD %s
+; RUN: llc -mtriple=riscv32 -mattr=+sstvala %s -o - | FileCheck --check-prefixes=CHECK,RV32SSTVALA %s
+; RUN: llc -mtriple=riscv32 -mattr=+sstvecd %s -o - | FileCheck --check-prefixes=CHECK,RV32SSTVECD %s
+; RUN: llc -mtriple=riscv32 -mattr=+ssu64xl %s -o - | FileCheck --check-prefixes=CHECK,RV32SSU64XL %s
+; RUN: llc -mtriple=riscv32 -mattr=+svade %s -o - | FileCheck --check-prefixes=CHECK,RV32SVADE %s
+; RUN: llc -mtriple=riscv32 -mattr=+svadu %s -o - | FileCheck --check-prefixes=CHECK,RV32SVADU %s
+; RUN: llc -mtriple=riscv32 -mattr=+svbare %s -o - | FileCheck --check-prefixes=CHECK,RV32SVBARE %s
 ; RUN: llc -mtriple=riscv32 -mattr=+svnapot %s -o - | FileCheck --check-prefixes=CHECK,RV32SVNAPOT %s
 ; RUN: llc -mtriple=riscv32 -mattr=+svpbmt %s -o - | FileCheck --check-prefixes=CHECK,RV32SVPBMT %s
 ; RUN: llc -mtriple=riscv32 -mattr=+svinval %s -o - | FileCheck --check-prefixes=CHECK,RV32SVINVAL %s
@@ -135,6 +151,22 @@
 ; RUN: llc -mtriple=riscv64 -mattr=+zicbom %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICBOM %s
 ; RUN: llc -mtriple=riscv64 -mattr=+zicboz %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICBOZ %s
 ; RUN: llc -mtriple=riscv64 -mattr=+zicbop %s -o - | FileCheck --check-prefixes=CHECK,RV64ZICBOP %s
+; RUN: llc -mtriple=riscv64 -mattr=+shcounterenw %s -o - | FileCheck --check-prefixes=CHECK,RV64SHCOUNTERENW %s
+; RUN: llc -mtriple=riscv64 -mattr=+shgatpa %s -o - | FileCheck --check-prefixes=CHECK,RV64SHGATPA %s
+; RUN: llc -mtriple=riscv64 -mattr=+shvsatpa %s -o - | FileCheck --check-prefixes=CHECK,RV64SHVSATPA %s
+; RUN: llc -mtriple=riscv64 -mattr=+ssccptr %s -o - | FileCheck --check-prefixes=CHECK,RV64SSCCPTR %s
+; RUN: llc -mtriple=riscv64 -mattr=+sscounterenw %s -o - | FileCheck --check-prefixes=CHECK,RV64SSCOUNTERENW %s
+; RUN: llc -mtriple=riscv64 -mattr=+ssstateen %s -o - | FileCheck --check-prefixes=CHECK,RV64SSSTATEEN %s
+; RUN: llc -mtriple=riscv64 -mattr=+sstc %s -o - | FileCheck --check-prefixes=CHECK,RV64SSTC %s
+; RUN: llc -mtriple=riscv64 -mattr=+shtvala %s -o - | FileCheck --check-prefixes=CHECK,RV64SHTVALA %s
+; RUN: llc -mtriple=riscv64 -mattr=+shvstvala %s -o - | FileCheck --check-prefixes=CHECK,RV64SHVSTVALA %s
+; RUN: llc -mtriple=riscv64 -mattr=+shvstvecd %s -o - | FileCheck --check-prefixes=CHECK,RV64SHVSTVECD %s
+; RUN: llc -mtriple=riscv64 -mattr=+sstvala %s -o - | FileCheck --check-prefixes=CHECK,RV64SSTVALA %s
+; RUN: llc -mtriple=riscv64 -mattr=+sstvecd %s -o - | FileCheck --check-prefixes=CHECK,RV64SSTVECD %s
+; RUN: llc -mtriple=riscv64 -mattr=+ssu64xl %s -o - | FileCheck --check-prefixes=CHECK,RV64SSU64XL %s
+; RUN: llc -mtriple=riscv64 -mattr=+svade %s -o - | FileCheck --check-prefixes=CHECK,RV64SVADE %s
+; RUN: llc -mtriple=riscv64 -mattr=+svadu %s -o - | FileCheck --check-prefixes=CHECK,RV64SVADU %s
+; RUN: llc -mtriple=riscv64 -mattr=+svbare %s -o - | FileCheck --check-prefixes=CHECK,RV64SVBARE %s
 ; RUN: llc -mtriple=riscv64 -mattr=+svnapot %s -o - | FileCheck --check-prefixes=CHECK,RV64SVNAPOT %s
 ; RUN: llc -mtriple=riscv64 -mattr=+svpbmt %s -o - | FileCheck --check-prefixes=CHECK,RV64SVPBMT %s
 ; RUN: llc -mtriple=riscv64 -mattr=+svinval %s -o - | FileCheck --check-prefixes=CHECK,RV64SVINVAL %s
@@ -237,6 +269,22 @@
 ; RV32ZICBOM: .attribute 5, "rv32i2p1_zicbom1p0"
 ; RV32ZICBOZ: .attribute 5, "rv32i2p1_zicboz1p0"
 ; RV32ZICBOP: .attribute 5, "rv32i2p1_zicbop1p0"
+; RV32SHCOUNTERENW: .attribute 5, "rv32i2p1_shcounterenw1p0"
+; RV32SHGATPA: .attribute 5, "rv32i2p1_shgatpa1p0"
+; RV32SHVSATPA: .attribute 5, "rv32i2p1_shvsatpa1p0"
+; RV32SSCCPTR: .attribute 5, "rv32i2p1_ssccptr1p0"
+; RV32SSCOUNTERENW: .attribute 5, "rv32i2p1_sscounterenw1p0"
+; RV32SSSTATEEN: .attribute 5, "rv32i2p1_ssstateen1p0"
+; RV32SSTC: .attribute 5, "rv32i2p1_sstc1p0"
+; RV32SHTVALA: .attribute 5, "rv32i2p1_shtvala1p0"
+; RV32SHVSTVALA: .attribute 5, "rv32i2p1_shvstvala1p0"
+; RV32SHVSTVECD: .attribute 5, "rv32i2p1_shvstvecd1p0"
+; RV32SSTVALA: .attribute 5, "rv32i2p1_sstvala1p0"
+; RV32SSTVECD: .attribute 5, "rv32i2p1_sstvecd1p0"
+; RV32SSU64XL: .attribute 5, "rv32i2p1_ssu64xl1p0"
+; RV32SVADE: .attribute 5, "rv32i2p1_svade1p0"
+; RV32SVADU: .attribute 5, "rv32i2p1_svadu1p0"
+; RV32SVBARE: .attribute 5, "rv32i2p1_svbare1p0"
 ; RV32SVNAPOT: .attribute 5, "rv32i2p1_svnapot1p0"
 ; RV32SVPBMT: .attribute 5, "rv32i2p1_svpbmt1p0"
 ; RV32SVINVAL: .attribute 5, "rv32i2p1_svinval1p0"
@@ -336,6 +384,22 @@
 ; RV64ZA128RS: .attribute 5, "rv64i2p1_za128rs1p0"
 ; RV64ZAWRS: .attribute 5, "rv64i2p1_zawrs1p0"
 ; RV64ZICBOP: .attribute 5, "rv64i2p1_zicbop1p0"
+; RV64SHCOUNTERENW: .attribute 5, "rv64i2p1_shcounterenw1p0"
+; RV64SHGATPA: .attribute 5, "rv64i2p1_shgatpa1p0"
+; RV64SHVSATPA: .attribute 5, "rv64i2p1_shvsatpa1p0"
+; RV64SSCCPTR: .attribute 5, "rv64i2p1_ssccptr1p0"
+; RV64SSCOUNTERENW: .attribute 5, "rv64i2p1_sscounterenw1p0"
+; RV64SSSTATEEN: .attribute 5, "rv64i2p1_ssstateen1p0"
+; RV64SSTC: .attribute 5, "rv64i2p1_sstc1p0"
+; RV64SHTVALA: .attribute 5, "rv64i2p1_shtvala1p0"
+; RV64SHVSTVALA: .attribute 5, "rv64i2p1_shvstvala1p0"
+; RV64SHVSTVECD: .attribute 5, "rv64i2p1_shvstvecd1p0"
+; RV64SSTVALA: .attribute 5, "rv64i2p1_sstvala1p0"
+; RV64SSTVECD: .attribute 5, "rv64i2p1_sstvecd1p0"
+; RV64SSU64XL: .attribute 5, "rv64i2p1_ssu64xl1p0"
+; RV64SVADE: .attribute 5, "rv64i2p1_svade1p0"
+; RV64SVADU: .attribute 5, "rv64i2p1_svadu1p0"
+; RV64SVBARE: .attribute 5, "rv64i2p1_svbare1p0"
 ; RV64SVNAPOT: .attribute 5, "rv64i2p1_svnapot1p0"
 ; RV64SVPBMT: .attribute 5, "rv64i2p1_svpbmt1p0"
 ; RV64SVINVAL: .attribute 5, "rv64i2p1_svinval1p0"
diff --git a/llvm/test/MC/RISCV/attribute-arch.s b/llvm/test/MC/RISCV/attribute-arch.s
index 5f9a7cabcc768ed..086e0cffd487506 100644
--- a/llvm/test/MC/RISCV/attribute-arch.s
+++ b/llvm/test/MC/RISCV/attribute-arch.s
@@ -288,6 +288,24 @@
 .attribute arch, "rv32izicond1p0"
 # CHECK: attribute      5, "rv32i2p1_zicond1p0"
 
+.attribute arch, "rv32i_shcounterenw1p0"
+# CHECK: attribute      5, "rv32i2p1_shcounterenw1p0"
+
+.attribute arch, "rv32i_shgatpa1p0"
+# CHECK: attribute      5, "rv32i2p1_shgatpa1p0"
+
+.attribute arch, "rv32i_shvsatpa1p0"
+# CHECK: attribute      5, "rv32i2p1_shvsatpa1p0"
+
+.attribute arch, "rv32i_shtvala1p0"
+# CHECK: attribute      5, "rv32i2p1_shtvala1p0"
+
+.attribute arch, "rv32i_shvstvala1p0"
+# CHECK: attribute      5, "rv32i2p1_shvstvala1p0"
+
+.attribute arch, "rv32i_shvstvecd1p0"
+# CHECK: attribute      5, "rv32i2p1_shvstvecd1p0"
+
 .attribute arch, "rv32i_smaia1p0"
 # CHECK: attribute      5, "rv32i2p1_smaia1p0"
 
@@ -297,6 +315,36 @@
 .attribute arch, "rv32i_smepmp1p0"
 # CHECK: attribute      5, "rv32i2p1_smepmp1p0"
 
+.attribute arch, "rv32i_ssccptr1p0"
+# CHECK: attribute      5, "rv32i2p1_ssccptr1p0"
+
+.attribute arch, "rv32i_sscounterenw1p0"
+# CHECK: attribute      5, "rv32i2p1_sscounterenw1p0"
+
+.attribute arch, "rv32i_ssstateen1p0"
+# CHECK: attribute      5, "rv32i2p1_ssstateen1p0"
+
+.attribute arch, "rv32i_sstc1p0"
+# CHECK: attribute      5, "rv32i2p1_sstc1p0"
+
+.attribute arch, "rv32i_sstvala1p0"
+# CHECK: attribute      5, "rv32i2p1_sstvala1p0"
+
+.attribute arch, "rv32i_sstvecd1p0"
+# CHECK: attribute      5, "rv32i2p1_sstvecd1p0"
+
+.attribute arch, "rv32i_ssu64xl1p0"
+# CHECK: attribute      5, "rv32i2p1_ssu64xl1p0"
+
+.attribute arch, "rv32i_svade1p0"
+# CHECK: attribute      5, "rv32i2p1_svade1p0"
+
+.attribute arch, "rv32i_svadu1p0"
+# CHECK: attribute      5, "rv32i2p1_svadu1p0"
+
+.attribute arch, "rv32i_svbare1p0"
+# CHECK: attribute      5, "rv32i2p1_svbare1p0"
+
 .attribute arch, "rv32i_zfbfmin1p0"
 # CHECK: .attribute     5, "rv32i2p1_f2p2_zicsr2p0_zfbfmin1p0"
 
diff --git a/llvm/unittests/Support/RISCVISAInfoTest.cpp b/llvm/unittests/Support/RISCVISAInfoTest.cpp
index 9b7112fa2bfeb59..d1b391f7bdd28d8 100644
--- a/llvm/unittests/Support/RISCVISAInfoTest.cpp
+++ b/llvm/unittests/Support/RISCVISAInfoTest.cpp
@@ -759,9 +759,25 @@ R"(All available -march extensions for RISC-V
     zvl8192b            1.0
     zhinx               1.0
     zhinxmin            1.0
+    shcounterenw        1.0
+    shgatpa             1.0
+    shtvala             1.0
+    shvsatpa            1.0
+    shvstvala           1.0
+    shvstvecd           1.0
     smaia               1.0
     smepmp              1.0
     ssaia               1.0
+    ssccptr             1.0
+    sscounterenw        1.0
+    ssstateen           1.0
+    sstc                1.0
+    sstvala             1.0
+    sstvecd             1.0
+    ssu64xl             1.0
+    svade               1.0
+    svadu               1.0
+    svbare              1.0
     svinval             1.0
     svnapot             1.0
     svpbmt              1.0

>From f74d0706ccdad4d434a5137a9f0fd8018e42379a Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Wed, 24 Jan 2024 20:39:12 -0800
Subject: [PATCH 3/6] fixup! Add ssstrict. Add Ssstateen to RISCVUsage.rst. Add
 link to profile spec.

---
 .../test/Preprocessor/riscv-target-features.c |  9 ++++++
 llvm/docs/RISCVUsage.rst                      | 30 ++++++++++---------
 llvm/lib/Support/RISCVISAInfo.cpp             |  1 +
 llvm/lib/Target/RISCV/RISCVFeatures.td        |  4 +++
 llvm/test/CodeGen/RISCV/attributes.ll         |  4 +++
 llvm/test/MC/RISCV/attribute-arch.s           |  3 ++
 llvm/unittests/Support/RISCVISAInfoTest.cpp   |  1 +
 7 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/clang/test/Preprocessor/riscv-target-features.c b/clang/test/Preprocessor/riscv-target-features.c
index 3a2441004c46d03..378f64f165d4a92 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -31,6 +31,7 @@
 // CHECK-NOT: __riscv_ssccptr {{.*$}}
 // CHECK-NOT: __riscv_sscounterenw {{.*$}}
 // CHECK-NOT: __riscv_ssstateen {{.*$}}
+// CHECK-NOT: __riscv_ssstrict {{.*$}}
 // CHECK-NOT: __riscv_sstc {{.*$}}
 // CHECK-NOT: __riscv_sstvala {{.*$}}
 // CHECK-NOT: __riscv_sstvecd {{.*$}}
@@ -357,6 +358,14 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-SSSTATEEN-EXT %s
 // CHECK-SSSTATEEN-EXT: __riscv_ssstateen 1000000{{$}}
 
+// RUN: %clang --target=riscv32-unknown-linux-gnu \
+// RUN: -march=rv32issstrict -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSSTRICT-EXT %s
+// RUN: %clang --target=riscv64-unknown-linux-gnu \
+// RUN: -march=rv64issstrict -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-SSSTRICT-EXT %s
+// CHECK-SSSTRICT-EXT: __riscv_ssstrict 1000000{{$}}
+
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
 // RUN: -march=rv32isstc -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-SSTC-EXT %s
diff --git a/llvm/docs/RISCVUsage.rst b/llvm/docs/RISCVUsage.rst
index ef54ee53d7deae6..722a9ec3e545452 100644
--- a/llvm/docs/RISCVUsage.rst
+++ b/llvm/docs/RISCVUsage.rst
@@ -91,24 +91,26 @@ on support follow.
      ``E``            Supported (`See note <#riscv-rve-note>`__)
      ``H``            Assembly Support
      ``M``            Supported
-     ``Shcounterenw`` Assembly Support
-     ``Shgatpa``      Assembly Support
-     ``Shtvala``      Assembly Support
-     ``Shvsatpa``    Assembly Support
-     ``Shvstvala``    Assembly Support
-     ``Shvstvecd``    Assembly Support
+     ``Shcounterenw`` Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Shgatpa``      Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Shtvala``      Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Shvsatpa``     Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Shvstvala``    Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Shvstvecd``    Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
      ``Smaia``        Supported
      ``Smepmp``       Supported
      ``Ssaia``        Supported
-     ``Ssccptr``      Assembly Support
-     ``Sscounterenw`` Assembly Support
+     ``Ssccptr``      Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Sscounterenw`` Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Ssstateen``    Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Ssstrict``     Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
      ``Sstc``         Assembly Support
-     ``Sstvala``      Assembly Support
-     ``Sstvecd``      Assembly Support
-     ``ssu64xl``      Assembly Support
-     ``Svade``        Assembly Support
+     ``Sstvala``      Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Sstvecd``      Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Ssu64xl``      Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
+     ``Svade``        Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
      ``Svadu``        Assembly Support
-     ``Svbare``       Assembly Support
+     ``Svbare``       Assembly Support (`See note <#riscv-profiles-extensions-note>`__)
      ``Svinval``      Assembly Support
      ``Svnapot``      Assembly Support
      ``Svpbmt``       Supported
@@ -230,7 +232,7 @@ Supported
 
 .. _riscv-profiles-extensions-note:
 
-``Za128rs``, ``Za64rs``, ``Zic64b``, ``Ziccamoa``, ``Ziccif``, ``Zicclsm``, ``Ziccrse``
+``Za128rs``, ``Za64rs``, ``Zic64b``, ``Ziccamoa``, ``Ziccif``, ``Zicclsm``, ``Ziccrse``, ``Shcounterenvw``, ``Shgatpa``, ``Shtvala``, ``Shvsatpa``, ``Shvstvala``, ``Shvstvecd``, ``Ssccptr``, ``Sscounterenw``, ``Ssstateen``, ``Ssstrict``, ``Sstvala``, ``Sstvecd``, ``Ssu64xl``, ``Svade``, ``Svbare``
   These extensions are defined as part of the `RISC-V Profiles specification <https://github.com/riscv/riscv-profiles/releases/tag/v1.0>`_.  They do not introduce any new features themselves, but instead describe existing hardware features.
 
 Experimental Extensions
diff --git a/llvm/lib/Support/RISCVISAInfo.cpp b/llvm/lib/Support/RISCVISAInfo.cpp
index 073f498d8beef83..efaa19858922134 100644
--- a/llvm/lib/Support/RISCVISAInfo.cpp
+++ b/llvm/lib/Support/RISCVISAInfo.cpp
@@ -66,6 +66,7 @@ static const RISCVSupportedExtension SupportedExtensions[] = {
     {"ssccptr", {1, 0}},
     {"sscounterenw", {1, 0}},
     {"ssstateen", {1, 0}},
+    {"ssstrict", {1, 0}},
     {"sstc", {1, 0}},
     {"sstvala", {1, 0}},
     {"sstvecd", {1, 0}},
diff --git a/llvm/lib/Target/RISCV/RISCVFeatures.td b/llvm/lib/Target/RISCV/RISCVFeatures.td
index e40b1442921c763..26a016d6e3e0cc1 100644
--- a/llvm/lib/Target/RISCV/RISCVFeatures.td
+++ b/llvm/lib/Target/RISCV/RISCVFeatures.td
@@ -786,6 +786,10 @@ def FeatureStdExtSsstateen
     : SubtargetFeature<"ssstateen", "HasStdExtSsstateen", "true",
                        "'Ssstateen' (Supervisor-mode view of the state-enable extension)", []>;
 
+def FeatureStdExtSsstrict
+    : SubtargetFeature<"ssstrict", "HasStdExtSsstrict", "true",
+                       "'Ssstrict' (No non-conforming extensions are present.", []>;
+
 def FeatureStdExtSstc
     : SubtargetFeature<"sstc", "HasStdExtSstc", "true",
                        "'Sstc' (Supervisor-mode timer interrupts)", []>;
diff --git a/llvm/test/CodeGen/RISCV/attributes.ll b/llvm/test/CodeGen/RISCV/attributes.ll
index 3e009b8208fd3e5..ed2ddff119cbc6a 100644
--- a/llvm/test/CodeGen/RISCV/attributes.ll
+++ b/llvm/test/CodeGen/RISCV/attributes.ll
@@ -44,6 +44,7 @@
 ; RUN: llc -mtriple=riscv32 -mattr=+ssccptr %s -o - | FileCheck --check-prefixes=CHECK,RV32SSCCPTR %s
 ; RUN: llc -mtriple=riscv32 -mattr=+sscounterenw %s -o - | FileCheck --check-prefixes=CHECK,RV32SSCOUNTERENW %s
 ; RUN: llc -mtriple=riscv32 -mattr=+ssstateen %s -o - | FileCheck --check-prefixes=CHECK,RV32SSSTATEEN %s
+; RUN: llc -mtriple=riscv32 -mattr=+ssstrict %s -o - | FileCheck --check-prefixes=CHECK,RV32SSSTRICT %s
 ; RUN: llc -mtriple=riscv32 -mattr=+sstc %s -o - | FileCheck --check-prefixes=CHECK,RV32SSTC %s
 ; RUN: llc -mtriple=riscv32 -mattr=+shtvala %s -o - | FileCheck --check-prefixes=CHECK,RV32SHTVALA %s
 ; RUN: llc -mtriple=riscv32 -mattr=+shvstvala %s -o - | FileCheck --check-prefixes=CHECK,RV32SHVSTVALA %s
@@ -157,6 +158,7 @@
 ; RUN: llc -mtriple=riscv64 -mattr=+ssccptr %s -o - | FileCheck --check-prefixes=CHECK,RV64SSCCPTR %s
 ; RUN: llc -mtriple=riscv64 -mattr=+sscounterenw %s -o - | FileCheck --check-prefixes=CHECK,RV64SSCOUNTERENW %s
 ; RUN: llc -mtriple=riscv64 -mattr=+ssstateen %s -o - | FileCheck --check-prefixes=CHECK,RV64SSSTATEEN %s
+; RUN: llc -mtriple=riscv64 -mattr=+ssstrict %s -o - | FileCheck --check-prefixes=CHECK,RV64SSSTRICT %s
 ; RUN: llc -mtriple=riscv64 -mattr=+sstc %s -o - | FileCheck --check-prefixes=CHECK,RV64SSTC %s
 ; RUN: llc -mtriple=riscv64 -mattr=+shtvala %s -o - | FileCheck --check-prefixes=CHECK,RV64SHTVALA %s
 ; RUN: llc -mtriple=riscv64 -mattr=+shvstvala %s -o - | FileCheck --check-prefixes=CHECK,RV64SHVSTVALA %s
@@ -275,6 +277,7 @@
 ; RV32SSCCPTR: .attribute 5, "rv32i2p1_ssccptr1p0"
 ; RV32SSCOUNTERENW: .attribute 5, "rv32i2p1_sscounterenw1p0"
 ; RV32SSSTATEEN: .attribute 5, "rv32i2p1_ssstateen1p0"
+; RV32SSSTRICT: .attribute 5, "rv32i2p1_ssstrict1p0"
 ; RV32SSTC: .attribute 5, "rv32i2p1_sstc1p0"
 ; RV32SHTVALA: .attribute 5, "rv32i2p1_shtvala1p0"
 ; RV32SHVSTVALA: .attribute 5, "rv32i2p1_shvstvala1p0"
@@ -390,6 +393,7 @@
 ; RV64SSCCPTR: .attribute 5, "rv64i2p1_ssccptr1p0"
 ; RV64SSCOUNTERENW: .attribute 5, "rv64i2p1_sscounterenw1p0"
 ; RV64SSSTATEEN: .attribute 5, "rv64i2p1_ssstateen1p0"
+; RV64SSSTRICT: .attribute 5, "rv64i2p1_ssstrict1p0"
 ; RV64SSTC: .attribute 5, "rv64i2p1_sstc1p0"
 ; RV64SHTVALA: .attribute 5, "rv64i2p1_shtvala1p0"
 ; RV64SHVSTVALA: .attribute 5, "rv64i2p1_shvstvala1p0"
diff --git a/llvm/test/MC/RISCV/attribute-arch.s b/llvm/test/MC/RISCV/attribute-arch.s
index 086e0cffd487506..439c543d45fa7d5 100644
--- a/llvm/test/MC/RISCV/attribute-arch.s
+++ b/llvm/test/MC/RISCV/attribute-arch.s
@@ -324,6 +324,9 @@
 .attribute arch, "rv32i_ssstateen1p0"
 # CHECK: attribute      5, "rv32i2p1_ssstateen1p0"
 
+.attribute arch, "rv32i_ssstrict1p0"
+# CHECK: attribute      5, "rv32i2p1_ssstrict1p0"
+
 .attribute arch, "rv32i_sstc1p0"
 # CHECK: attribute      5, "rv32i2p1_sstc1p0"
 
diff --git a/llvm/unittests/Support/RISCVISAInfoTest.cpp b/llvm/unittests/Support/RISCVISAInfoTest.cpp
index d1b391f7bdd28d8..b0832c494cca34c 100644
--- a/llvm/unittests/Support/RISCVISAInfoTest.cpp
+++ b/llvm/unittests/Support/RISCVISAInfoTest.cpp
@@ -771,6 +771,7 @@ R"(All available -march extensions for RISC-V
     ssccptr             1.0
     sscounterenw        1.0
     ssstateen           1.0
+    ssstrict            1.0
     sstc                1.0
     sstvala             1.0
     sstvecd             1.0

>From 6422a2fe680c544014cd53b70bfe03ab5082fe11 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Wed, 24 Jan 2024 21:20:48 -0800
Subject: [PATCH 4/6] fixup! Fix documentation build warning

---
 llvm/docs/RISCVUsage.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/docs/RISCVUsage.rst b/llvm/docs/RISCVUsage.rst
index 722a9ec3e545452..b8b91c7a514c15c 100644
--- a/llvm/docs/RISCVUsage.rst
+++ b/llvm/docs/RISCVUsage.rst
@@ -81,9 +81,9 @@ on support follow.
 
   .. table:: Ratified Extensions by Status
 
-     ===============  =========================================================
+     ===============  =================================================================
      Extension        Status
-     ===============  =========================================================
+     ===============  =================================================================
      ``A``            Supported
      ``C``            Supported
      ``D``            Supported

>From 5cbc7eab7ce6f0494065f4f9fb4c5a4932afd52f Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Wed, 24 Jan 2024 22:39:49 -0800
Subject: [PATCH 5/6] fixup! reformat

---
 .../test/Preprocessor/riscv-target-features.c | 128 +++++++++---------
 1 file changed, 64 insertions(+), 64 deletions(-)

diff --git a/clang/test/Preprocessor/riscv-target-features.c b/clang/test/Preprocessor/riscv-target-features.c
index 378f64f165d4a92..5e5ffa297f44f01 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -287,131 +287,131 @@
 // CHECK-M-EXT: __riscv_muldiv 1
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ishcounterenw -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHCOUNTERENW-EXT %s
+// RUN:   -march=rv32ishcounterenw -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHCOUNTERENW-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ishcounterenw -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHCOUNTERENW-EXT %s
+// RUN:   -march=rv64ishcounterenw -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHCOUNTERENW-EXT %s
 // CHECK-SHCOUNTERENW-EXT: __riscv_shcounterenw 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ishgatpa -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHGATPA-EXT %s
+// RUN:   -march=rv32ishgatpa -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHGATPA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ishgatpa -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHGATPA-EXT %s
+// RUN:   -march=rv64ishgatpa -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHGATPA-EXT %s
 // CHECK-SHGATPA-EXT: __riscv_shgatpa 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ishtvala -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHTVALA-EXT %s
+// RUN:   -march=rv32ishtvala -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHTVALA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ishtvala -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHTVALA-EXT %s
+// RUN:   -march=rv64ishtvala -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHTVALA-EXT %s
 // CHECK-SHTVALA-EXT: __riscv_shtvala 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ishvsatpa -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSATPA-EXT %s
+// RUN:   -march=rv32ishvsatpa -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHVSATPA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ishvsatpa -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSATPA-EXT %s
+// RUN:   -march=rv64ishvsatpa -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHVSATPA-EXT %s
 // CHECK-SHVSATPA-EXT: __riscv_shvsatpa 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ishvstvala -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSTVALA-EXT %s
+// RUN:   -march=rv32ishvstvala -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHVSTVALA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ishvstvala -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSTVALA-EXT %s
+// RUN:   -march=rv64ishvstvala -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHVSTVALA-EXT %s
 // CHECK-SHVSTVALA-EXT: __riscv_shvstvala 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32ishvstvecd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSTVECD-EXT %s
+// RUN:   -march=rv32ishvstvecd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHVSTVECD-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64ishvstvecd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SHVSTVECD-EXT %s
+// RUN:   -march=rv64ishvstvecd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SHVSTVECD-EXT %s
 // CHECK-SHVSTVECD-EXT: __riscv_shvstvecd 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32issccptr -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSCCPTR-EXT %s
+// RUN:   -march=rv32issccptr -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSCCPTR-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64issccptr -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSCCPTR-EXT %s
+// RUN:   -march=rv64issccptr -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSCCPTR-EXT %s
 // CHECK-SSCCPTR-EXT: __riscv_ssccptr 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isscounterenw -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSCOUNTERENW-EXT %s
+// RUN:   -march=rv32isscounterenw -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSCOUNTERENW-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isscounterenw -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSCOUNTERENW-EXT %s
+// RUN:   -march=rv64isscounterenw -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSCOUNTERENW-EXT %s
 // CHECK-SSCOUNTERENW-EXT: __riscv_sscounterenw 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32issstateen -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSSTATEEN-EXT %s
+// RUN:   -march=rv32issstateen -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSSTATEEN-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64issstateen -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSSTATEEN-EXT %s
+// RUN:   -march=rv64issstateen -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSSTATEEN-EXT %s
 // CHECK-SSSTATEEN-EXT: __riscv_ssstateen 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32issstrict -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSSTRICT-EXT %s
+// RUN:   -march=rv32issstrict -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSSTRICT-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64issstrict -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSSTRICT-EXT %s
+// RUN:   -march=rv64issstrict -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSSTRICT-EXT %s
 // CHECK-SSSTRICT-EXT: __riscv_ssstrict 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isstc -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSTC-EXT %s
+// RUN:   -march=rv32isstc -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSTC-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isstc -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSTC-EXT %s
+// RUN:   -march=rv64isstc -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSTC-EXT %s
 // CHECK-SSTC-EXT: __riscv_sstc 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isstvala -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSTVALA-EXT %s
+// RUN:   -march=rv32isstvala -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSTVALA-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isstvala -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSTVALA-EXT %s
+// RUN:   -march=rv64isstvala -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSTVALA-EXT %s
 // CHECK-SSTVALA-EXT: __riscv_sstvala 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isstvecd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSTVECD-EXT %s
+// RUN:   -march=rv32isstvecd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSTVECD-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isstvecd -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSTVECD-EXT %s
+// RUN:   -march=rv64isstvecd -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSTVECD-EXT %s
 // CHECK-SSTVECD-EXT: __riscv_sstvecd 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32issu64xl -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSU64XL-EXT %s
+// RUN:   -march=rv32issu64xl -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSU64XL-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64issu64xl -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SSU64XL-EXT %s
+// RUN:   -march=rv64issu64xl -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SSU64XL-EXT %s
 // CHECK-SSU64XL-EXT: __riscv_ssu64xl 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isvade -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVADE-EXT %s
+// RUN:   -march=rv32isvade -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVADE-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isvade -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVADE-EXT %s
+// RUN:   -march=rv64isvade -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVADE-EXT %s
 // CHECK-SVADE-EXT: __riscv_svade 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isvadu -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVADU-EXT %s
+// RUN:   -march=rv32isvadu -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVADU-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isvadu -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVADU-EXT %s
+// RUN:   -march=rv64isvadu -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVADU-EXT %s
 // CHECK-SVADU-EXT: __riscv_svadu 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \

>From 8d2f8584c9d16d4b6ef008a3e477d65b56f45e55 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Wed, 24 Jan 2024 22:40:36 -0800
Subject: [PATCH 6/6] fixup! reformat

---
 clang/test/Preprocessor/riscv-target-features.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang/test/Preprocessor/riscv-target-features.c b/clang/test/Preprocessor/riscv-target-features.c
index 5e5ffa297f44f01..13b8a47b2b42bae 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -415,11 +415,11 @@
 // CHECK-SVADU-EXT: __riscv_svadu 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
-// RUN: -march=rv32isvbare -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVBARE-EXT %s
+// RUN:   -march=rv32isvbare -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVBARE-EXT %s
 // RUN: %clang --target=riscv64-unknown-linux-gnu \
-// RUN: -march=rv64isvbare -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-SVBARE-EXT %s
+// RUN:   -march=rv64isvbare -E -dM %s \
+// RUN:   -o - | FileCheck --check-prefix=CHECK-SVBARE-EXT %s
 // CHECK-SVBARE-EXT: __riscv_svbare 1000000{{$}}
 
 // RUN: %clang --target=riscv32-unknown-linux-gnu \



More information about the cfe-commits mailing list