[libcxx-commits] [libcxx] 851a335 - [libc++] Add a job running GCC with C++11

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 15 19:13:17 PDT 2021


Author: Louis Dionne
Date: 2021-07-15T22:13:03-04:00
New Revision: 851a335b1e64d0d32e15a8d2ace48c9b0967cd5a

URL: https://github.com/llvm/llvm-project/commit/851a335b1e64d0d32e15a8d2ace48c9b0967cd5a
DIFF: https://github.com/llvm/llvm-project/commit/851a335b1e64d0d32e15a8d2ace48c9b0967cd5a.diff

LOG: [libc++] Add a job running GCC with C++11

This configuration is interesting because GCC has a different level of
strictness for some C++ rules. In particular, it implements the older
standards more stringently than Clang, which can help find places where
we are non-conforming (especially in the test suite).

Differential Revision: https://reviews.llvm.org/D105936

Added: 
    

Modified: 
    libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/A.h
    libcxx/test/std/depr/depr.auto.ptr/auto.ptr/AB.h
    libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
    libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
    libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp
    libcxx/test/support/test_macros.h
    libcxx/utils/ci/buildkite-pipeline.yml
    libcxx/utils/ci/run-buildbot
    libcxxabi/test/unwind_02.pass.cpp
    libcxxabi/test/unwind_03.pass.cpp
    libcxxabi/test/unwind_04.pass.cpp
    libcxxabi/test/unwind_05.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp
index 12d03545d85c2..25d1411834577 100644
--- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp
@@ -27,10 +27,11 @@ template <class T>
 struct TestFn {
   void operator()() const {
     typedef std::atomic<T> A;
-    A t = T();
-    bool b1 = std::atomic_is_lock_free(static_cast<const A*>(&t));
-    volatile A vt = T();
-    bool b2 = std::atomic_is_lock_free(static_cast<const volatile A*>(&vt));
+    T t = T();
+    A a(t);
+    bool b1 = std::atomic_is_lock_free(static_cast<const A*>(&a));
+    volatile A va(t);
+    bool b2 = std::atomic_is_lock_free(static_cast<const volatile A*>(&va));
     assert(b1 == b2);
   }
 };

diff  --git a/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/A.h b/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/A.h
index e452ec545742b..13a45ad1b75b8 100644
--- a/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/A.h
+++ b/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/A.h
@@ -19,6 +19,8 @@ class A
     A(const A& a) : id_(a.id_) {++count;}
     ~A() {assert(id_ >= 0); id_ = -1; --count;}
 
+    A& operator=(const A& other) { id_ = other.id_; return *this; }
+
     int id() const {return id_;}
 
     static int count;

diff  --git a/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/AB.h b/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/AB.h
index 75b4ab88bc18e..fd5c323e3a923 100644
--- a/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/AB.h
+++ b/libcxx/test/std/depr/depr.auto.ptr/auto.ptr/AB.h
@@ -19,6 +19,8 @@ class A
     A(const A& a) : id_(a.id_) {++count;}
     virtual ~A() {assert(id_ >= 0); id_ = -1; --count;}
 
+    A& operator=(const A& other) { id_ = other.id_; return *this; }
+
     static int count;
 };
 

diff  --git a/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp b/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
index f388386819528..008862246fcff 100644
--- a/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
@@ -148,7 +148,10 @@ int main(int, char**)
 #ifndef _LIBCPP_HAS_NO_STDIN
     static_assert((std::is_same<decltype(std::getchar()), int>::value), "");
 #if TEST_STD_VER <= 11
+#   pragma GCC diagnostic push
+#   pragma GCC diagnostic ignored "-Wdeprecated-declarations" // disable the warning from the C library
     static_assert((std::is_same<decltype(std::gets(cp)), char*>::value), "");
+#   pragma GCC diagnostic pop
 #endif
     static_assert((std::is_same<decltype(std::scanf(" ")), int>::value), "");
     static_assert((std::is_same<decltype(std::vscanf(" ",va)), int>::value), "");

diff  --git a/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp b/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
index a68b016a3f6f8..914bc62b82fe2 100644
--- a/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: gcc-10, gcc-11
-//     GCC's __builtin_strlen isn't constexpr yet
+// GCC's __builtin_strlen isn't constexpr yet
+// XFAIL: (gcc-10 || gcc-11) && !(c++11 || c++14 || c++17)
 // UNSUPPORTED: LIBCXX-DEBUG-FIXME
 
 // <string_view>

diff  --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp
index a2e3c4eab3652..4d13ba9c52018 100644
--- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp
+++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp
@@ -36,7 +36,7 @@ int A::count = 0;
 struct B : public A {
   static int count;
   B() { ++count; }
-  B(const B&) { ++count; }
+  B(const B& b) : A(b) { ++count; }
   virtual ~B() { --count; }
 };
 

diff  --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 3d8f933ee8b6f..96c6965ec65d4 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -139,7 +139,7 @@
 # define TEST_NOEXCEPT_COND(...)
 #endif
 
-#if TEST_STD_VER >= 17
+#if TEST_STD_VER >= 11
 # define TEST_THROW_SPEC(...)
 #else
 # define TEST_THROW_SPEC(...) throw(__VA_ARGS__)

diff  --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index 965497c5a8a4a..b1ac2007f0c7e 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -132,7 +132,7 @@ steps:
         - exit_status: -1  # Agent was lost
           limit: 2
 
-  - label: "GCC 11"
+  - label: "GCC 11 / C++latest"
     command: "libcxx/utils/ci/run-buildbot generic-gcc"
     artifact_paths:
       - "**/test-results.xml"
@@ -149,6 +149,18 @@ steps:
   #
   - wait
 
+  - label: "GCC 11 / C++11"
+    command: "libcxx/utils/ci/run-buildbot generic-gcc-cxx11"
+    artifact_paths:
+      - "**/test-results.xml"
+    agents:
+      queue: "libcxx-builders"
+      os: "linux"
+    retry:
+      automatic:
+        - exit_status: -1  # Agent was lost
+          limit: 2
+
   - label: "Clang 11"
     command: "libcxx/utils/ci/run-buildbot generic-clang-11"
     artifact_paths:

diff  --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 26552275f5bf4..e37f604c4d8b7 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -278,6 +278,13 @@ generic-gcc)
     generate-cmake
     check-cxx-cxxabi
 ;;
+generic-gcc-cxx11)
+    export CC=gcc-11
+    export CXX=g++-11
+    clean
+    generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
+    check-cxx-cxxabi
+;;
 generic-asan)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake"

diff  --git a/libcxxabi/test/unwind_02.pass.cpp b/libcxxabi/test/unwind_02.pass.cpp
index 050e4afed446e..7c1dea2a1c1dc 100644
--- a/libcxxabi/test/unwind_02.pass.cpp
+++ b/libcxxabi/test/unwind_02.pass.cpp
@@ -13,6 +13,7 @@
 
 #if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wunreachable-code"
+#pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated
 #endif
 
 struct A

diff  --git a/libcxxabi/test/unwind_03.pass.cpp b/libcxxabi/test/unwind_03.pass.cpp
index 154fb6e8ff7e3..0cd5a2bc9652b 100644
--- a/libcxxabi/test/unwind_03.pass.cpp
+++ b/libcxxabi/test/unwind_03.pass.cpp
@@ -15,6 +15,7 @@
 
 #if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wunreachable-code"
+#pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated
 #endif
 
 struct A

diff  --git a/libcxxabi/test/unwind_04.pass.cpp b/libcxxabi/test/unwind_04.pass.cpp
index d85434dc8551c..fcde314768a6e 100644
--- a/libcxxabi/test/unwind_04.pass.cpp
+++ b/libcxxabi/test/unwind_04.pass.cpp
@@ -15,6 +15,7 @@
 
 #if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wunreachable-code"
+#pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated
 #endif
 
 struct A

diff  --git a/libcxxabi/test/unwind_05.pass.cpp b/libcxxabi/test/unwind_05.pass.cpp
index 2f9f8da60325e..670a8eb99e43d 100644
--- a/libcxxabi/test/unwind_05.pass.cpp
+++ b/libcxxabi/test/unwind_05.pass.cpp
@@ -15,6 +15,7 @@
 
 #if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wunreachable-code"
+#pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated
 #endif
 
 struct A


        


More information about the libcxx-commits mailing list