[test-suite] r374176 - [test-suite] Add Architecture Detection for RISC-V

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 08:33:29 PDT 2019


Author: lenary
Date: Wed Oct  9 08:33:29 2019
New Revision: 374176

URL: http://llvm.org/viewvc/llvm-project?rev=374176&view=rev
Log:
[test-suite] Add Architecture Detection for RISC-V

Summary:
The LLVM test suite has its own way of detecting the system
architecture. This adds support in that file for detecting RISC-V.

This will eventually cause the ARCH variable to be populated.

We use ARCH="riscv64" to identify 64-bit RISC-V, and ARCH="riscv32" to identify 32-bit
RISC-V, so that attempting to detect "riscv" in the ARCH variable will match any version of RISC-V.

Reviewers: asb, luismarques

Reviewed By: luismarques

Subscribers: mgorny, simoncook, kito-cheng, shiva0217, rogfer01, rkruppe, PkmX, s.egerton, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68698

Modified:
    test-suite/trunk/cmake/modules/DetectArchitecture.c

Modified: test-suite/trunk/cmake/modules/DetectArchitecture.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/DetectArchitecture.c?rev=374176&r1=374175&r2=374176&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/DetectArchitecture.c (original)
+++ test-suite/trunk/cmake/modules/DetectArchitecture.c Wed Oct  9 08:33:29 2019
@@ -8,6 +8,12 @@ const char *str = "ARCHITECTURE IS Alpha
 const char *str = "ARCHITECTURE IS Mips";
 #elif defined(__powerpc__) || defined(__ppc__) || defined(__power__)
 const char *str = "ARCHITECTURE IS PowerPC";
+#elif defined(__riscv)
+#if __riscv_xlen == 64
+const char *str = "ARCHITECTURE IS riscv64";
+#elif __riscv_xlen == 32
+const char *str = "ARCHITECTURE IS riscv32";
+#endif
 #elif defined(__s390__)
 const char *str = "ARCHITECTURE IS SystemZ";
 #elif defined(__sparc__)




More information about the llvm-commits mailing list