[clang] 3f0d3fd - [clang][test][RISCV] Add simple litmus test for --print-enabled-extensions

Alex Bradbury via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 06:09:52 PDT 2024


Author: Alex Bradbury
Date: 2024-08-14T14:09:17+01:00
New Revision: 3f0d3fd3dea659330025712ea7fa914fd6af038b

URL: https://github.com/llvm/llvm-project/commit/3f0d3fd3dea659330025712ea7fa914fd6af038b
DIFF: https://github.com/llvm/llvm-project/commit/3f0d3fd3dea659330025712ea7fa914fd6af038b.diff

LOG: [clang][test][RISCV] Add simple litmus test for --print-enabled-extensions

There's some coverage in RISCVISAInfoTest, but it's worth adding a quick
test to ensure nothing happens to the frontend handling of this option.

Added: 
    clang/test/Driver/print-enabled-extensions/riscv-rocket-rv64.c

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/print-enabled-extensions/riscv-rocket-rv64.c b/clang/test/Driver/print-enabled-extensions/riscv-rocket-rv64.c
new file mode 100644
index 00000000000000..f8dd58cd74d6db
--- /dev/null
+++ b/clang/test/Driver/print-enabled-extensions/riscv-rocket-rv64.c
@@ -0,0 +1,13 @@
+// REQUIRES: riscv-registered-target
+// RUN: %clang --target=riscv64 --print-enabled-extensions -mcpu=rocket-rv64 | FileCheck --strict-whitespace %s
+
+// Simple litmus test to check the frontend handling of this option is
+// enabled.
+
+// CHECK: Extensions enabled for the given RISC-V target 
+// CHECK-EMPTY:
+// CHECK-NEXT: Name                 Version   Description 
+// CHECK-NEXT:     i                    2.1       'I' (Base Integer Instruction Set) 
+// CHECK-NEXT:     zicsr                2.0       'zicsr' (CSRs) 
+// CHECK-NEXT:     zifencei             2.0       'Zifencei' (fence.i) 
+// CHECK-EMPTY:


        


More information about the cfe-commits mailing list