Skip to content

Commit 020dd3d

Browse files
committed
WIP: Run compiler-rt tests with llvm-mingw
1 parent f5ae102 commit 020dd3d

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/compiler-rt.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Run compiler-rt tests
2+
on:
3+
push:
4+
5+
jobs:
6+
llvm-mingw:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
arch:
11+
- x86_64
12+
- i686
13+
- aarch64
14+
runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}}
15+
steps:
16+
- name: Install llvm-mingw
17+
run: |
18+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/nightly/llvm-mingw-nightly-ucrt-${{matrix.arch}}.zip
19+
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
20+
del llvm-mingw*.zip
21+
mv llvm-mingw* c:\llvm-mingw
22+
echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
23+
- name: Configure Git core.autocrlf
24+
run: |
25+
git config --global core.autocrlf false
26+
- uses: actions/checkout@v4
27+
- name: Build test executables
28+
run: |
29+
mkdir build-tools
30+
cd build-tools
31+
cmake ../llvm `
32+
-G Ninja `
33+
-DCMAKE_BUILD_TYPE=Release `
34+
-DLLVM_TARGETS_TO_BUILD=host `
35+
-DCMAKE_C_COMPILER=clang `
36+
-DCMAKE_CXX_COMPILER=clang++
37+
ninja not FileCheck llvm-config KillTheDoctor count split-file
38+
echo "LLVM_CONFIG=$PWD\bin\llvm-config.exe" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
39+
echo "CMAKE_DIR=$PWD\lib\cmake\llvm" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
40+
- name: Build and test compiler-rt
41+
# Skipping libfuzzer; all tests fail since the clang mingw driver
42+
# doesn't support -fsanitize=fuzzer.
43+
# Skipping ORC; the tests rely on llvm-jitlink being available,
44+
# which requires building a large part of LLVM among the test
45+
# tools above, and jitlink requires an MSVC toolchain to be available.
46+
run: |
47+
mkdir build-compiler-rt
48+
cd build-compiler-rt
49+
cmake ../compiler-rt `
50+
-G Ninja `
51+
-DCMAKE_BUILD_TYPE=Release `
52+
-DCMAKE_C_COMPILER=clang `
53+
-DCMAKE_CXX_COMPILER=clang++ `
54+
-DCMAKE_C_COMPILER_TARGET=${{matrix.arch}}-w64-windows-gnu `
55+
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE `
56+
-DCOMPILER_RT_USE_BUILTINS_LIBRARY=TRUE `
57+
-DLLVM_CONFIG_PATH="$Env:LLVM_CONFIG" `
58+
-DLLVM_CMAKE_DIR="$Env:CMAKE_DIR" `
59+
-DSANITIZER_CXX_ABI=libc++ `
60+
-DCOMPILER_RT_INCLUDE_TESTS=ON `
61+
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF `
62+
-DCOMPILER_RT_BUILD_ORC=OFF `
63+
-DLLVM_LIT_ARGS="-v --time-tests"
64+
ninja
65+
ninja check-compiler-rt

0 commit comments

Comments
 (0)