-
Notifications
You must be signed in to change notification settings - Fork 9
165 lines (151 loc) · 6.35 KB
/
linux.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
163
164
165
name: Linux Test Suite
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
linux-tests-opt:
name: "LLVM/OPT ${{ matrix.llvm-version[0] }} Linux"
runs-on: ubuntu-latest
env:
LLVM_INSTALL_PATH: ~/llvm
PLUGINS_PATH: tests/plugins/target/debug
strategy:
matrix:
llvm-version:
- ["10", "10-0", "v10.0.1-rust-1.46/llvm-10.0.1-rust-1.46-linux.tar.gz"]
- ["11", "11-0", "v11.0.1-rust-1.51/llvm-lld-11.0.1-rust-1.51-linux.tar.gz"]
- ["12", "12-0", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-linux.tar.gz"]
- ["13", "13-0", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-linux.tar.gz"]
- ["14", "14-0", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-linux.tar.gz"]
- ["15", "15-0", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-linux.tar.gz"]
- ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-linux.tar.gz"]
- ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-linux.tar.gz"]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup LLVM Installation Path
run: |
mkdir ${{ env.LLVM_INSTALL_PATH }}
echo "$HOME/llvm/bin" >> $GITHUB_PATH
- name: Check LLVM Artifacts In Cache
id: cache-llvm
uses: actions/cache@v3
with:
path: |
${{ env.LLVM_INSTALL_PATH }}/bin/llvm-config
${{ env.LLVM_INSTALL_PATH }}/bin/opt
${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM-${{ matrix.llvm-version[0] }}.so
${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM.so
${{ 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: |
wget --user-agent='GithubCI' -O llvm.tar.gz https://github.com/jamesmth/llvm-project/releases/download/${{ matrix.llvm-version[2] }}
tar -C ~ -xf llvm.tar.gz
- 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] }}
- name: Run Tests
run: |
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin1.so" \
--passes="mpass,function(fpass)" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin2.so" \
--passes="mpass1,mpass2" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin3.so" \
--passes="mpass1,mpass2" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin4.so" \
--passes="mpass,function(fpass)" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin5.so" \
--passes="mpass,function(fpass)" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin6.so" \
--passes="default<O3>" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin7.so" \
--passes="lto<O3>" \
tests/test.ll \
-disable-output
linux-tests-lld:
name: "LLVM/LLD ${{ matrix.llvm-version[0] }} Linux"
runs-on: ubuntu-latest
env:
LLVM_INSTALL_PATH: ~/llvm
PLUGINS_PATH: tests/plugins/target/debug
strategy:
matrix:
llvm-version:
- ["11", "11-0", "1.51", "v11.0.1-rust-1.51/llvm-lld-11.0.1-rust-1.51-linux.tar.gz"]
- ["12", "12-0", "1.55", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-linux.tar.gz"]
- ["13", "13-0", "1.59", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-linux.tar.gz"]
- ["14", "14-0", "1.64", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-linux.tar.gz"]
- ["15", "15-0", "1.65", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-linux.tar.gz"]
- ["16", "16-0", "1.71", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-linux.tar.gz"]
- ["17", "17-0", "1.75", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-linux.tar.gz"]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup LLVM Installation Path
run: |
mkdir ${{ env.LLVM_INSTALL_PATH }}
echo "$HOME/llvm/bin" >> $GITHUB_PATH
- name: Check LLVM Artifacts In Cache
id: cache-llvm
uses: actions/cache@v3
with:
path: |
${{ env.LLVM_INSTALL_PATH }}/bin/llvm-config
${{ env.LLVM_INSTALL_PATH }}/bin/lld
${{ env.LLVM_INSTALL_PATH }}/bin/ld.lld
${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM-${{ matrix.llvm-version[0] }}.so
${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM.so
${{ 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: |
wget --user-agent='GithubCI' -O llvm.tar.gz https://github.com/jamesmth/llvm-project/releases/download/${{ matrix.llvm-version[3] }}
tar -C ~ -xf llvm.tar.gz
- 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] }}
- name: Run Tests
run: |
rustup install ${{ matrix.llvm-version[2] }}
rustup default ${{ matrix.llvm-version[2] }}
RUSTFLAGS=" \
-Clinker-plugin-lto \
-Clink-arg=-B${{ env.LLVM_INSTALL_PATH }}/bin \
-Clink-arg=-fuse-ld=lld \
-Clink-arg=-Xlinker \
-Clink-arg=--load-pass-plugin="$GITHUB_WORKSPACE/${{ env.PLUGINS_PATH }}/libplugin1_lld.so" \
-Clink-arg=-Xlinker \
-Clink-arg=--lto-newpm-passes=mpass \
" \
cargo b --manifest-path tests/test-rust/Cargo.toml --release
[ $(cat ~/rust.ll) == "1" ]