[libc++] Promote GCC 11 to mandatory CI

Also, fix the last issue that prevented GCC 11 from passing the test
suite. Thanks to everyone else who fixed issues.

Differential Revision: https://reviews.llvm.org/D104315
This commit is contained in:
Louis Dionne 2021-06-15 15:07:03 -04:00
parent 80b2da42d2
commit 4f194d0db7
5 changed files with 24 additions and 33 deletions

View File

@ -12,12 +12,10 @@
// <atomic> // <atomic>
// template <class T> // template <class T>
// bool // bool atomic_is_lock_free(const volatile atomic<T>* obj);
// atomic_is_lock_free(const volatile atomic<T>* obj);
// //
// template <class T> // template <class T>
// bool // bool atomic_is_lock_free(const atomic<T>* obj);
// atomic_is_lock_free(const atomic<T>* obj);
#include <atomic> #include <atomic>
#include <cassert> #include <cassert>
@ -29,23 +27,20 @@ template <class T>
struct TestFn { struct TestFn {
void operator()() const { void operator()() const {
typedef std::atomic<T> A; typedef std::atomic<T> A;
A t; A t = T();
bool b1 = std::atomic_is_lock_free(static_cast<const A*>(&t)); bool b1 = std::atomic_is_lock_free(static_cast<const A*>(&t));
volatile A vt; volatile A vt = T();
bool b2 = std::atomic_is_lock_free(static_cast<const volatile A*>(&vt)); bool b2 = std::atomic_is_lock_free(static_cast<const volatile A*>(&vt));
assert(b1 == b2); assert(b1 == b2);
} }
}; };
struct A struct A {
{ char x[4];
char _[4];
}; };
int main(int, char**) int main(int, char**) {
{ TestFn<A>()();
TestFn<A>()(); TestEachAtomicType<TestFn>()();
TestEachAtomicType<TestFn>()();
return 0; return 0;
} }

View File

@ -58,11 +58,9 @@ RUN . /tmp/env.sh && apt-get install -y clang-format-$LLVM_VERSION
RUN ln -s $(find /usr/bin -regex '^.+/clang-format-[0-9.]+$') /usr/bin/clang-format && [ -e $(readlink /usr/bin/clang-format) ] RUN ln -s $(find /usr/bin -regex '^.+/clang-format-[0-9.]+$') /usr/bin/clang-format && [ -e $(readlink /usr/bin/clang-format) ]
RUN ln -s $(find /usr/bin -regex '^.+/git-clang-format-[0-9.]+$') /usr/bin/git-clang-format && [ -e $(readlink /usr/bin/git-clang-format) ] RUN ln -s $(find /usr/bin -regex '^.+/git-clang-format-[0-9.]+$') /usr/bin/git-clang-format && [ -e $(readlink /usr/bin/git-clang-format) ]
# Install a recent GCC # Install the most recent GCC version and the previous one (which are the two we support)
RUN add-apt-repository ppa:ubuntu-toolchain-r/test RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt install -y gcc-10 g++-10 gcc-11 g++-11 RUN apt-get update && apt install -y gcc-10 g++-10 gcc-11 g++-11
RUN ln -f -s /usr/bin/g++-10 /usr/bin/g++ && [ -e $(readlink /usr/bin/g++) ]
RUN ln -f -s /usr/bin/gcc-10 /usr/bin/gcc && [ -e $(readlink /usr/bin/gcc) ]
# Install a recent CMake # Install a recent CMake
RUN wget https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.sh -O /tmp/install-cmake.sh RUN wget https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.sh -O /tmp/install-cmake.sh

View File

@ -124,7 +124,7 @@ steps:
- exit_status: -1 # Agent was lost - exit_status: -1 # Agent was lost
limit: 2 limit: 2
- label: "GCC/C++20" - label: "GCC Current/C++20"
command: "libcxx/utils/ci/run-buildbot generic-gcc" command: "libcxx/utils/ci/run-buildbot generic-gcc"
artifact_paths: artifact_paths:
- "**/test-results.xml" - "**/test-results.xml"
@ -135,8 +135,13 @@ steps:
- exit_status: -1 # Agent was lost - exit_status: -1 # Agent was lost
limit: 2 limit: 2
- label: "GCC-next/C++20" #
command: "libcxx/utils/ci/run-buildbot generic-gcc-next" # All other supported configurations of libc++.
#
- wait
- label: "GCC Previous/C++20"
command: "libcxx/utils/ci/run-buildbot generic-gcc-prev"
artifact_paths: artifact_paths:
- "**/test-results.xml" - "**/test-results.xml"
agents: agents:
@ -145,13 +150,6 @@ steps:
automatic: automatic:
- exit_status: -1 # Agent was lost - exit_status: -1 # Agent was lost
limit: 2 limit: 2
soft_fail:
- exit_status: 1
#
# All other supported configurations of libc++.
#
- wait
- label: "-fno-exceptions" - label: "-fno-exceptions"
command: "libcxx/utils/ci/run-buildbot generic-noexceptions" command: "libcxx/utils/ci/run-buildbot generic-noexceptions"

View File

@ -279,15 +279,15 @@ generic-32bit)
check-cxx-cxxabi check-cxx-cxxabi
;; ;;
generic-gcc) generic-gcc)
export CC=gcc export CC=gcc-11
export CXX=g++ export CXX=g++-11
clean clean
generate-cmake generate-cmake
check-cxx-cxxabi check-cxx-cxxabi
;; ;;
generic-gcc-next) generic-gcc-prev)
export CC=gcc-11 export CC=gcc-10
export CXX=g++-11 export CXX=g++-10
clean clean
generate-cmake generate-cmake
check-cxx-cxxabi check-cxx-cxxabi

View File

@ -12,7 +12,7 @@
// GCC 7 and 8 support noexcept function types but this test still fails. // GCC 7 and 8 support noexcept function types but this test still fails.
// This is likely a bug in their implementation. Investigation needed. // This is likely a bug in their implementation. Investigation needed.
// XFAIL: gcc-7, gcc-8, gcc-9, gcc-10 // XFAIL: gcc-7, gcc-8, gcc-9, gcc-10, gcc-11
#include <cassert> #include <cassert>