-
Notifications
You must be signed in to change notification settings - Fork 9
162 lines (148 loc) · 6.39 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Windows Test Suite
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
windows-tests-opt:
name: "LLVM/OPT ${{ matrix.llvm-version[0] }} Windows"
runs-on: windows-latest
env:
LLVM_INSTALL_PATH: C:\LLVM
PLUGINS_PATH: tests\plugins\target\debug
strategy:
matrix:
llvm-version:
- ["11", "11-0", "v11.0.1-rust-1.51/llvm-lld-11.0.1-rust-1.51-windows-x86_64.7z"]
- ["12", "12-0", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-windows-x86_64.7z"]
- ["13", "13-0", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-windows-x86_64.7z"]
- ["14", "14-0", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-windows-x86_64.7z"]
- ["15", "15-0", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-windows-x86_64.7z"]
- ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-windows-x86_64.7z"]
- ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-windows-x86_64.7z"]
- ["18", "18-0", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-windows-x86_64.7z"]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup LLVM Installation Path
run: |
mkdir ${{ env.LLVM_INSTALL_PATH }}
echo ${{ env.LLVM_INSTALL_PATH }}\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Check LLVM Artifacts In Cache
id: cache-llvm
uses: actions/cache@v3
with:
path: |
${{ env.LLVM_INSTALL_PATH }}\bin\llvm-config.exe
${{ env.LLVM_INSTALL_PATH }}\bin\opt.exe
${{ env.LLVM_INSTALL_PATH }}\bin\LLVM-C.dll
${{ env.LLVM_INSTALL_PATH }}\lib\opt.lib
${{ env.LLVM_INSTALL_PATH }}\lib\LLVM-C.lib
${{ env.LLVM_INSTALL_PATH }}\include
key: ${{ runner.os }}-llvm-${{ matrix.llvm-version[0] }}-opt
- name: Download LLVM Binaries
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -UserAgent 'GithubCI' -outfile llvm.7z https://github.com/jamesmth/llvm-project/releases/download/${{ matrix.llvm-version[2] }}
7z x -oC: llvm.7z
- name: Build Tests
run: |
cargo b `
--manifest-path tests\plugins\Cargo.toml `
-p plugin* `
--no-default-features `
--features target-x86,llvm${{ matrix.llvm-version[1] }},win-link-opt
- name: Run Tests
run: |
opt `
--load-pass-plugin="${{ env.PLUGINS_PATH }}\plugin1.dll" `
--passes="mpass,function(fpass)" `
tests/test.ll `
-disable-output
opt `
--load-pass-plugin="${{ env.PLUGINS_PATH }}\plugin2.dll" `
--passes="mpass1,mpass2" `
tests/test.ll `
-disable-output
opt `
--load-pass-plugin="${{ env.PLUGINS_PATH }}\plugin3.dll" `
--passes="mpass1,mpass2" `
tests/test.ll `
-disable-output
opt `
--load-pass-plugin="${{ env.PLUGINS_PATH }}\plugin4.dll" `
--passes="mpass,function(fpass)" `
tests/test.ll `
-disable-output
opt `
--load-pass-plugin="${{ env.PLUGINS_PATH }}\plugin5.dll" `
--passes="mpass,function(fpass)" `
tests/test.ll `
-disable-output
opt `
--load-pass-plugin="${{ env.PLUGINS_PATH }}\plugin6.dll" `
--passes="default<O3>" `
tests/test.ll `
-disable-output
opt `
--load-pass-plugin="${{ env.PLUGINS_PATH }}\plugin7.dll" `
--passes="lto<O3>" `
tests/test.ll `
-disable-output
windows-tests-lld:
name: "LLVM/LLD ${{ matrix.llvm-version[0] }} Windows"
runs-on: windows-latest
env:
LLVM_INSTALL_PATH: C:\LLVM
PLUGINS_PATH: tests\plugins\target\debug
strategy:
matrix:
llvm-version:
- ["13", "13-0", "1.59", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-windows-x86_64.7z"]
- ["14", "14-0", "1.64", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-windows-x86_64.7z"]
- ["15", "15-0", "1.65", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-windows-x86_64.7z"]
- ["16", "16-0", "1.71", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-windows-x86_64.7z"]
- ["17", "17-0", "1.75", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-windows-x86_64.7z"]
- ["18", "18-0", "1.78", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-windows-x86_64.7z"]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup LLVM Installation Path
run: |
mkdir ${{ env.LLVM_INSTALL_PATH }}
echo ${{ env.LLVM_INSTALL_PATH }}\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Check LLVM Artifacts In Cache
id: cache-llvm
uses: actions/cache@v3
with:
path: |
${{ env.LLVM_INSTALL_PATH }}\bin\llvm-config.exe
${{ env.LLVM_INSTALL_PATH }}\bin\lld.exe
${{ env.LLVM_INSTALL_PATH }}\bin\LLVM-C.dll
${{ env.LLVM_INSTALL_PATH }}\lib\lld.lib
${{ env.LLVM_INSTALL_PATH }}\lib\LLVM-C.lib
${{ env.LLVM_INSTALL_PATH }}\include
key: ${{ runner.os }}-llvm-${{ matrix.llvm-version[0] }}-lld
- name: Download LLVM Binaries
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -UserAgent 'GithubCI' -outfile llvm.7z https://github.com/jamesmth/llvm-project/releases/download/${{ matrix.llvm-version[3] }}
7z x -oC: llvm.7z
- name: Build Tests
run: |
cargo b `
--manifest-path tests\plugins\Cargo.toml `
-p plugin*-lld `
--no-default-features `
--features target-x86,llvm${{ matrix.llvm-version[1] }},win-link-lld
- name: Run Tests
run: |
rustup install ${{ matrix.llvm-version[2] }}
rustup default ${{ matrix.llvm-version[2] }}
$env:RUSTFLAGS=" `
-Clinker-plugin-lto `
-Clinker=${{ env.LLVM_INSTALL_PATH }}\bin\lld.exe `
-Clink-arg=/load-pass-plugin:$env:GITHUB_WORKSPACE\${{ env.PLUGINS_PATH }}\plugin1_lld.dll `
-Clink-arg=/lto-newpm-passes:mpass `
"
cargo b --manifest-path tests\test-rust\Cargo.toml --release
$(cat C:\rust.ll) -eq "1"