Skip to content

Commit f0018d7

Browse files
authored
CI: Add Clang 15 support in regression tests (#974)
* CI: Add Clang 15 support in regression tests * CI: Select Xcode 14 on MacOS
1 parent d97552a commit f0018d7

File tree

233 files changed

+681
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+681
-20
lines changed

.github/workflows/regression-tests.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,26 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu-latest]
20-
compiler: [g++-10, g++-13]
20+
compiler: [g++-10, g++-13, clang++-15]
2121
include:
2222
- os: ubuntu-20.04
2323
compiler: clang++-12
2424
- os: macos-13
2525
compiler: clang++
26+
- os: macos-13
27+
compiler: clang++-15
2628
- os: windows-latest
2729
compiler: cl.exe
2830
steps:
2931
- name: Checkout repo
3032
uses: actions/checkout@v4
3133

34+
- name: Prepare compilers
35+
if: matrix.os == 'macos-13'
36+
run: |
37+
sudo xcode-select --switch /Applications/Xcode_14.3.1.app
38+
sudo ln -s "$(brew --prefix llvm@15)/bin/clang" /usr/local/bin/clang++-15
39+
3240
- name: Run regression tests - Linux and macOS version
3341
if: startsWith(matrix.os, 'ubuntu') || matrix.os == 'macos-13'
3442
run: |

regression-tests/run-tests.sh

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,31 +129,39 @@ if [[ "$cxx_compiler" == *"cl.exe"* ]]; then
129129
exec_out_dir="$expected_results_dir/msvc-2022"
130130
compiler_version=$(cl.exe)
131131
else
132-
compiler_cmd="$cxx_compiler -I../../../include -std=c++20 -pthread -o "
133-
compiler_version=$("$cxx_compiler" --version)
134-
135-
# We don't currently support Apple Clang 15 so try and switch to 14
136-
if [[ "$compiler_version" == *"Apple clang version 15.0"* ]]; then
137-
printf "Found Apple Clang 15, attempting to switch to Apple Clang 14"
138-
cxx_compiler=$(xcodebuild -find clang++)
139-
compiler_version=$("$cxx_compiler" --version)
132+
# Verify the compiler command
133+
which "$cxx_compiler" > /dev/null
134+
if [[ $? != 0 ]]; then
135+
printf "The compiler '$cxx_compiler' is not installed\n\n"
136+
exit 2
140137
fi
141138

142-
if [[ "$compiler_version" == *"Apple clang version 14.0"* ]]; then
139+
cpp_std=c++2b
140+
compiler_version=$("$cxx_compiler" --version)
141+
142+
if [[ "$compiler_version" == *"Apple clang version 14.0"* ||
143+
"$compiler_version" == *"Homebrew clang version 15.0"* ]]; then
143144
exec_out_dir="$expected_results_dir/apple-clang-14"
144145
elif [[ "$compiler_version" == *"clang version 12.0"* ]]; then
145146
exec_out_dir="$expected_results_dir/clang-12"
146147
elif [[ "$compiler_version" == *"clang version 15.0"* ]]; then
147148
exec_out_dir="$expected_results_dir/clang-15"
149+
# c++2b causes starge issues on GitHub ubuntu-latest runner
150+
cpp_std="c++20"
148151
elif [[ "$compiler_version" == *"g++-10"* ]]; then
149152
exec_out_dir="$expected_results_dir/gcc-10"
153+
# GCC 10 does not support c++2b
154+
cpp_std=c++20
150155
elif [[ "$compiler_version" == *"g++-12"* ||
151156
"$compiler_version" == *"g++-13"*
152157
]]; then
153158
exec_out_dir="$expected_results_dir/gcc-13"
154159
else
155160
printf "Unhandled compiler version:\n$compiler_version\n\n"
161+
exit 2
156162
fi
163+
164+
compiler_cmd="$cxx_compiler -I../../../include -std=$cpp_std -pthread -o "
157165
fi
158166

159167
if [[ -d "$exec_out_dir" ]]; then
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Ubuntu clang version 15.0.7
2+
Target: x86_64-pc-linux-gnu
3+
Thread model: posix
4+
InstalledDir: /usr/bin
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello world

regression-tests/test-results/clang-15/mixed-allcpp1-hello.cpp.output

Whitespace-only changes.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
v as X< 0> = 0
2+
v as X< 1> = 1
3+
v as X< 2> = 2
4+
v as X< 3> = 3
5+
v as X< 4> = 4
6+
v as X< 5> = 5
7+
v as X< 6> = 6
8+
v as X< 7> = 7
9+
v as X< 8> = 8
10+
v as X< 9> = 9
11+
v as X<10> = 10
12+
v as X<11> = 11
13+
v as X<12> = 12
14+
v as X<13> = 13
15+
v as X<14> = 14
16+
v as X<15> = 15
17+
v as X<16> = 16
18+
v as X<17> = 17
19+
v as X<18> = 18
20+
v as X<19> = 19
21+
as_const(v) as X< 0> = 0
22+
as_const(v) as X< 1> = 1
23+
as_const(v) as X< 2> = 2
24+
as_const(v) as X< 3> = 3
25+
as_const(v) as X< 4> = 4
26+
as_const(v) as X< 5> = 5
27+
as_const(v) as X< 6> = 6
28+
as_const(v) as X< 7> = 7
29+
as_const(v) as X< 8> = 8
30+
as_const(v) as X< 9> = 9
31+
as_const(v) as X<10> = 10
32+
as_const(v) as X<11> = 11
33+
as_const(v) as X<12> = 12
34+
as_const(v) as X<13> = 13
35+
as_const(v) as X<14> = 14
36+
as_const(v) as X<15> = 15
37+
as_const(v) as X<16> = 16
38+
as_const(v) as X<17> = 17
39+
as_const(v) as X<18> = 18
40+
as_const(v) as X<19> = 19
41+
move(v) as X< 0> = 0
42+
move(v) as X< 1> = 1
43+
move(v) as X< 2> = 2
44+
move(v) as X< 3> = 3
45+
move(v) as X< 4> = 4
46+
move(v) as X< 5> = 5
47+
move(v) as X< 6> = 6
48+
move(v) as X< 7> = 7
49+
move(v) as X< 8> = 8
50+
move(v) as X< 9> = 9
51+
move(v) as X<10> = 10
52+
move(v) as X<11> = 11
53+
move(v) as X<12> = 12
54+
move(v) as X<13> = 13
55+
move(v) as X<14> = 14
56+
move(v) as X<15> = 15
57+
move(v) as X<16> = 16
58+
move(v) as X<17> = 17
59+
move(v) as X<18> = 18
60+
move(v) as X<19> = 19

regression-tests/test-results/clang-15/mixed-as-for-variant-20-types.cpp.output

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4]

regression-tests/test-results/clang-15/mixed-bounds-check.cpp.output

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
1
2+
44
3+
45
4+
46
5+
5

0 commit comments

Comments
 (0)