I want to do some test for riscv intrinsic functions, including clang and llvm;
based on test-suite Guide — LLVM 18.0.0git documentation
First, I will compile my LLVM (16.0.4) with the following configuration:
cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_TARGETS_TO_BUILD="RISCV" \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DLLVM_ENABLE_LLD=ON \
-DCMAKE_BUILD_TYPE="Release" \
-DLLVM_INCLUDE_TESTS=ON \
-DLLVM_BUILD_TESTS=ON \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_ENABLE_ASSERTIONS=ON \
../llvm
Then use the command to test clang :
llvm it clang/test/CodeGen/RISCV/rvv intrinsics automated/policy/overloaded/vfsub. c
The error message is as follows :
llvm-lit: /home/code/llvm/llvm-project/llvm/utils/lit/lit/llvm/config.py:459: note: using clang: /home/llvm/xpu/llvm-project/build/bin/clang
llvm-lit: /home/code/llvm/llvm-project/llvm/utils/lit/lit/llvm/config.py:324: fatal: Could not turn '' into Itanium ABI triple
because I am testing on an x86 machine, I suspect this may be related to cross compilation testing, but I don’t know how to configure it to make llvm lit recognize riscv;
Currently, I have found a way to update the configuration - DLLVM_ TARGET_ TO_ BUILD=“RISCV; X86” , then recompiled and this testcase passed , so what the reason is?
llvm-lit: /home/code/llvm/llvm-project/llvm/utils/lit/lit/llvm/config.py:459: note: using clang: /home/code/llvm/llvm-project/build/bin/clang
-- Testing: 1 tests, 1 workers --
PASS: Clang :: CodeGen/RISCV/rvv-intrinsics-autogenerated/policy/overloaded/vfsub.c (1 of 1)
Testing Time: 0.22s
Passed: 1
hope to receive your answer, thank you !