Skip to content

Commit

Permalink
Updated tests for Clang 15
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasfertig committed Feb 3, 2023
1 parent a6dabbb commit 46994a0
Show file tree
Hide file tree
Showing 34 changed files with 190 additions and 228 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
env:
CMAKE_VERSION: 3.16.2
NINJA_VERSION: 1.10.0
LLVM_VERSION: 14.0.0
LLVM_VERSION: 15.0.0

jobs:
checks:
Expand All @@ -29,7 +29,7 @@ jobs:
name: "Linux Clang - Format check",
os: ubuntu-20.04,
build_type: Release,
cformat_name: 'clang-format-14'
cformat_name: 'clang-format-15'
}

steps:
Expand All @@ -42,7 +42,7 @@ jobs:
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 14
sudo ./llvm.sh 15
sudo apt-get install ${{ matrix.config.cformat_name }}
- name: clang-format check
Expand All @@ -64,11 +64,11 @@ jobs:
config:
# AppleClang
- {
name: "Clang 14 / LLVM 14 @ macOS Release",
name: "Clang 15 / LLVM 15 @ macOS Release",
os: macos-11,
build_type: Release,
cxx: "clang++",
llvm_version: "14.0.0",
llvm_version: "15.0.0",
llvm_config: "llvm-config",
coverage: "No",
static: "No",
Expand All @@ -82,11 +82,11 @@ jobs:

# AppleClang
- {
name: "Clang 14 / LLVM 14 @ macOS Debug",
name: "Clang 15 / LLVM 15 @ macOS Debug",
os: macos-11,
build_type: Release,
cxx: "clang++",
llvm_version: "14.0.0",
llvm_version: "15.0.0",
llvm_config: "llvm-config",
coverage: "No",
static: "No",
Expand All @@ -100,11 +100,11 @@ jobs:

# # AppleClang
# - {
# name: "Clang 14 / LLVM 14 @ macOS Coverage & Debug",
# name: "Clang 15 / LLVM 15 @ macOS Coverage & Debug",
# os: macos-11,
# build_type: Release,
# cxx: "clang++",
# llvm_version: "14.0.0",
# llvm_version: "15.0.0",
# llvm_config: "llvm-config",
# coverage: "Yes",
# static: "No",
Expand All @@ -118,11 +118,11 @@ jobs:

# # MSVC 2019
# - {
# name: "MSVC 2022 / LLVM 14 @ Windows Release",
# name: "MSVC 2022 / LLVM 15 @ Windows Release",
# os: windows-2022,
# build_type: Release,
# cxx: "cl",
# llvm_version: "14.0.0",
# llvm_version: "15.0.0",
# llvm_config: "current/bin/llvm-config.exe",
# static: "Yes",
# debug: "No",
Expand All @@ -137,11 +137,11 @@ jobs:

# # MSVC 2019
# - {
# name: "MSVC 2022 / LLVM 14 @ Windows Debug",
# name: "MSVC 2022 / LLVM 15 @ Windows Debug",
# os: windows-2022,
# build_type: Release,
# cxx: "cl",
# llvm_version: "14.0.0",
# llvm_version: "15.0.0",
# llvm_config: "current/bin/llvm-config.exe",
# static: "Yes",
# debug: "Yes",
Expand All @@ -155,11 +155,11 @@ jobs:

# # MSVC 2019
# - {
# name: "MSVC 2022 / LLVM 14 @ Windows Code Coverage & Debug",
# name: "MSVC 2022 / LLVM 15 @ Windows Code Coverage & Debug",
# os: windows-2022,
# build_type: Release,
# cxx: "clang-cl.exe",
# llvm_version: "14.0.0",
# llvm_version: "15.0.0",
# llvm_config: "current/bin/llvm-config.exe",
# coverage: "Yes",
# static: "Yes",
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
export HOMEBREW_NO_AUTO_UPDATE=1
brew update > /dev/null
brew install lcov || brew upgrade lcov
brew install gcc@10 || brew upgrade gcc@10 # for Clang 14 and newer gcov
brew install gcc@10 || brew upgrade gcc@10 # for Clang 15 and newer gcov
- name: Setup MSVC Dev
if: "startsWith(matrix.config.os, 'Windows')"
Expand Down Expand Up @@ -465,13 +465,13 @@ jobs:
fail-fast: false
matrix:
config:
# GCC 11 / LLVM 14
# GCC 11 / LLVM 15
- {
name: "GCC 11 / LLVM 14 @ Ubuntu Release @docker",
name: "GCC 11 / LLVM 15 @ Ubuntu Release @docker",
build_type: Release,
cxx: "g++-11",
llvm_version: "14.0.0",
llvm_config: "/usr/bin/llvm-config-14",
llvm_version: "15.0.0",
llvm_config: "/usr/bin/llvm-config-15",
coverage: "No",
static: "Yes",
debug: "No",
Expand All @@ -484,13 +484,13 @@ jobs:
docs: "Yes",
}

# GCC 11 / LLVM 14
# GCC 11 / LLVM 15
- {
name: "GCC 11 / LLVM 14 @ Ubuntu Code Coverage & Debug @docker",
name: "GCC 11 / LLVM 15 @ Ubuntu Code Coverage & Debug @docker",
build_type: Release,
cxx: "g++-11",
llvm_version: "14.0.0",
llvm_config: "/usr/bin/llvm-config-14",
llvm_version: "15.0.0",
llvm_config: "/usr/bin/llvm-config-15",
coverage: "Yes",
static: "No",
debug: "Yes",
Expand All @@ -501,13 +501,13 @@ jobs:
archive_name: "insights-ubuntu-14.04",
}

# GCC 11 / LLVM 14
# GCC 11 / LLVM 15
- {
name: "GCC 11 / LLVM 14 @ Ubuntu Code Coverage (libc++) @docker",
name: "GCC 11 / LLVM 15 @ Ubuntu Code Coverage (libc++) @docker",
build_type: Release,
cxx: "g++-11",
llvm_version: "14.0.0",
llvm_config: "/usr/bin/llvm-config-14",
llvm_version: "15.0.0",
llvm_config: "/usr/bin/llvm-config-15",
coverage: "Yes",
static: "No",
debug: "Yes",
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ option(INSIGHTS_STATIC "Use static linking" Off)

set(INSIGHTS_LLVM_CONFIG "llvm-config" CACHE STRING "LLVM config executable to use")

set(INSIGHTS_MIN_LLVM_MAJOR_VERSION 14)
set(INSIGHTS_MIN_LLVM_MAJOR_VERSION 15)
set(INSIGHTS_MIN_LLVM_VERSION ${INSIGHTS_MIN_LLVM_MAJOR_VERSION}.0)

if(NOT DEFINED LLVM_VERSION_MAJOR) # used when build inside the clang tool/extra folder
Expand Down
14 changes: 8 additions & 6 deletions CoroutinesCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,16 @@ struct DeclsHolder
mThisExprs.push_back(thisExpr);

} else if(const auto* declStmt = dyn_cast_or_null<DeclStmt>(stmt)) {
const auto* singleDecl = declStmt->getSingleDecl();
if(declStmt->isSingleDecl()) {
const auto* singleDecl = declStmt->getSingleDecl();

if(const auto* vd = dyn_cast_or_null<VarDecl>(singleDecl)) {
push_back(vd);
return;
if(const auto* vd = dyn_cast_or_null<VarDecl>(singleDecl)) {
push_back(vd);
return;

} else if(const auto* recordDecl = dyn_cast_or_null<CXXRecordDecl>(singleDecl)) {
mRecordDecls.push_back(recordDecl);
} else if(const auto* recordDecl = dyn_cast_or_null<CXXRecordDecl>(singleDecl)) {
mRecordDecls.push_back(recordDecl);
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/prepare-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
def main():
versionH = open('version.h.in', 'r').read()

oldClangStable = '13'
newClangStable = '14'
newInsightsVersion = '0.9'
oldClangStable = '14'
newClangStable = '15'
newInsightsVersion = '0.10'
oldInsightsVersion = re.search('INSIGHTS_VERSION\s+"(.*?)"', versionH, re.DOTALL | re.MULTILINE).group(1)


Expand Down
2 changes: 1 addition & 1 deletion tests/AutoHandler3Test.expect
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct T


template<typename T>
decltype(T({}).f()) f(T, int)
decltype(T{}.f()) f(T, int)
{
}

Expand Down
9 changes: 2 additions & 7 deletions tests/EduCoroutineAllocFailureTest.expect
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ struct generator<int>
// inline constexpr promise_type() noexcept = default;
};

inline generator(generator<int> && rhs)
: p{{std::exchange(rhs.p, nullptr)}}
{
}
inline generator(generator<int> && rhs);

inline ~generator() noexcept
{
Expand Down Expand Up @@ -183,8 +180,6 @@ generator<int> fun<int>()
/* Construct the promise. */
new (&__f->__promise)std::__coroutine_traits_sfinae<generator<int> >::promise_type{};

generator<int> __coro_gro = __f->__promise.get_return_object() /* NRVO variable */;

/* Forward declare the resume and destroy function. */
void __fun_intResume(__fun_intFrame * __f);
void __fun_intDestroy(__fun_intFrame * __f);
Expand All @@ -199,7 +194,7 @@ generator<int> fun<int>()
__fun_intResume(__f);


return __coro_gro;
return __promise.get_return_object();
}

/* This function invoked by coroutine_handle<>::resume() */
Expand Down
15 changes: 9 additions & 6 deletions tests/EduCoroutineBinaryExprTest.cerr
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
.tmp.cpp:153:138: error: unknown type name 'coroutine_handle'
.tmp.cpp:131:10: error: use of undeclared identifier '__promise'
return __promise.get_return_object();
^
.tmp.cpp:151:138: error: unknown type name 'coroutine_handle'
__f->__suspend_35_11.await_suspend(std::coroutine_handle<generator::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
.tmp.cpp:167:139: error: unknown type name 'coroutine_handle'
.tmp.cpp:165:139: error: unknown type name 'coroutine_handle'
__f->__suspend_42_5.await_suspend(std::coroutine_handle<generator::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
.tmp.cpp:178:140: error: unknown type name 'coroutine_handle'
.tmp.cpp:176:140: error: unknown type name 'coroutine_handle'
__f->__suspend_43_12.await_suspend(std::coroutine_handle<generator::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
.tmp.cpp:189:139: error: unknown type name 'coroutine_handle'
.tmp.cpp:187:139: error: unknown type name 'coroutine_handle'
__f->__suspend_44_5.await_suspend(std::coroutine_handle<generator::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
.tmp.cpp:212:138: error: unknown type name 'coroutine_handle'
.tmp.cpp:210:138: error: unknown type name 'coroutine_handle'
__f->__suspend_35_11_1.await_suspend(std::coroutine_handle<generator::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
5 errors generated.
6 errors generated.
4 changes: 1 addition & 3 deletions tests/EduCoroutineBinaryExprTest.expect
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ generator seq(int start)
/* Construct the promise. */
new (&__f->__promise)std::__coroutine_traits_sfinae<generator>::promise_type{};

generator __coro_gro = __f->__promise.get_return_object() /* NRVO variable */;

/* Forward declare the resume and destroy function. */
void __seqResume(__seqFrame * __f);
void __seqDestroy(__seqFrame * __f);
Expand All @@ -130,7 +128,7 @@ generator seq(int start)
__seqResume(__f);


return __coro_gro;
return __promise.get_return_object();
}

/* This function invoked by coroutine_handle<>::resume() */
Expand Down
11 changes: 7 additions & 4 deletions tests/EduCoroutineCaptureConstTest.cerr
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
.tmp.cpp:96:15: note: non-static data member 'start' declared const here
const int & start;
~~~~~~~~~~~~^~~~~
.tmp.cpp:146:138: error: unknown type name 'coroutine_handle'
.tmp.cpp:127:10: error: use of undeclared identifier '__promise'
return __promise.get_return_object();
^
.tmp.cpp:144:138: error: unknown type name 'coroutine_handle'
__f->__suspend_35_11.await_suspend(std::coroutine_handle<generator::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
.tmp.cpp:154:12: error: no viable overloaded '='
.tmp.cpp:152:12: error: no viable overloaded '='
__f->s = {0, '\0'};
~~~~~~ ^ ~~~~~~~~~
.tmp.cpp:89:10: note: candidate function (the implicit copy assignment operator) not viable: 'this' argument has type 'const __seqFrame::S', but method is not marked const
struct S
^
.tmp.cpp:89:10: note: candidate function (the implicit move assignment operator) not viable: 'this' argument has type 'const __seqFrame::S', but method is not marked const
.tmp.cpp:171:138: error: unknown type name 'coroutine_handle'
.tmp.cpp:169:138: error: unknown type name 'coroutine_handle'
__f->__suspend_35_11_1.await_suspend(std::coroutine_handle<generator::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
4 errors generated.
5 errors generated.
4 changes: 1 addition & 3 deletions tests/EduCoroutineCaptureConstTest.expect
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ generator seq(const int & start)
/* Construct the promise. */
new (&__f->__promise)std::__coroutine_traits_sfinae<generator>::promise_type{};

generator __coro_gro = __f->__promise.get_return_object() /* NRVO variable */;

/* Forward declare the resume and destroy function. */
void __seqResume(__seqFrame * __f);
void __seqDestroy(__seqFrame * __f);
Expand All @@ -126,7 +124,7 @@ generator seq(const int & start)
__seqResume(__f);


return __coro_gro;
return __promise.get_return_object();
}

/* This function invoked by coroutine_handle<>::resume() */
Expand Down
15 changes: 9 additions & 6 deletions tests/EduCoroutineCoAwaitOperatorTest.cerr
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
.tmp.cpp:175:3: error: unknown type name 'awaiter'
.tmp.cpp:174:3: error: unknown type name 'awaiter'
awaiter __suspend_54_5;
^
.tmp.cpp:226:143: error: unknown type name 'coroutine_handle'
.tmp.cpp:204:10: error: use of undeclared identifier '__promise'
return __promise.get_return_object();
^
.tmp.cpp:223:143: error: unknown type name 'coroutine_handle'
__f->__suspend_51_16.await_suspend(std::coroutine_handle<my_future<int>::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
.tmp.cpp:239:142: error: unknown type name 'coroutine_handle'
.tmp.cpp:236:142: error: unknown type name 'coroutine_handle'
__f->__suspend_54_5.await_suspend(std::coroutine_handle<my_future<int>::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
.tmp.cpp:251:143: error: unknown type name 'coroutine_handle'
.tmp.cpp:248:143: error: unknown type name 'coroutine_handle'
__f->__suspend_56_14.await_suspend(std::coroutine_handle<my_future<int>::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
.tmp.cpp:272:143: error: unknown type name 'coroutine_handle'
.tmp.cpp:269:143: error: unknown type name 'coroutine_handle'
__f->__suspend_51_16_1.await_suspend(std::coroutine_handle<my_future<int>::promise_type>::from_address(static_cast<void *>(__f)).operator coroutine_handle());
^
5 errors generated.
6 errors generated.
5 changes: 1 addition & 4 deletions tests/EduCoroutineCoAwaitOperatorTest.expect
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ struct my_future<int>

int await_resume();

// inline constexpr my_future(my_future<int> &&) noexcept = default;
};

#endif
Expand Down Expand Up @@ -188,8 +187,6 @@ my_future<int> g()
/* Construct the promise. */
new (&__f->__promise)std::__coroutine_traits_sfinae<my_future<int> >::promise_type{};

my_future<int> __coro_gro = __f->__promise.get_return_object() /* NRVO variable */;

/* Forward declare the resume and destroy function. */
void __gResume(__gFrame * __f);
void __gDestroy(__gFrame * __f);
Expand All @@ -204,7 +201,7 @@ my_future<int> g()
__gResume(__f);


return __coro_gro;
return __promise.get_return_object();
}

/* This function invoked by coroutine_handle<>::resume() */
Expand Down
Loading

0 comments on commit 46994a0

Please sign in to comment.