Skip to content

Conversation

fmayer
Copy link
Contributor

@fmayer fmayer commented Oct 13, 2025

This precommits the mock headers needed for that StatusOr model tests.

Created using spr 1.3.4
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:dataflow Clang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html labels Oct 13, 2025
@fmayer fmayer requested a review from jvoung October 13, 2025 20:23
@llvmbot
Copy link
Member

llvmbot commented Oct 13, 2025

@llvm/pr-subscribers-clang

Author: Florian Mayer (fmayer)

Changes

This precommits the mock headers needed for that StatusOr model tests.


Patch is 39.42 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/163261.diff

1 Files Affected:

  • (modified) clang/unittests/Analysis/FlowSensitive/MockHeaders.cpp (+1036-1)
diff --git a/clang/unittests/Analysis/FlowSensitive/MockHeaders.cpp b/clang/unittests/Analysis/FlowSensitive/MockHeaders.cpp
index c280921930a05..7cb448a709281 100644
--- a/clang/unittests/Analysis/FlowSensitive/MockHeaders.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/MockHeaders.cpp
@@ -27,7 +27,10 @@ using nullptr_t = decltype(nullptr);
 
 } // namespace std
 
-#endif // CSTDDEF_H
+typedef decltype(sizeof(char)) size_t;
+typedef decltype(sizeof(char*)) ptrdiff_t;
+
+#endif // CS
 )";
 
 static constexpr char StdTypeTraitsHeader[] = R"(
@@ -479,12 +482,38 @@ struct conjunction<T, Ts...>
 template <typename T>
 struct conjunction<T> : T {};
 
+template <typename... Ts>
+struct disjunction : std::false_type {};
+
+template <typename T, typename... Ts>
+struct disjunction<T, Ts...>
+    : std::conditional<T::value, T, disjunction<Ts...>>::type {};
+
+template <typename T>
+struct disjunction<T> : T {};
+
 template <typename T>
 struct negation : std::integral_constant<bool, !T::value> {};
 
 template <bool B, typename T = void>
 using enable_if_t = typename std::enable_if<B, T>::type;
 
+
+template <bool B, typename T, typename F>
+using conditional_t = typename std::conditional<B, T, F>::type;
+
+template <typename T>
+using remove_cv_t = typename std::remove_cv<T>::type;
+
+template <typename T>
+using remove_reference_t = typename std::remove_reference<T>::type;
+
+template <typename T>
+using decay_t = typename std::decay<T>::type;
+
+struct in_place_t {};
+
+constexpr in_place_t in_place;
 } // namespace absl
 
 #endif // ABSL_TYPE_TRAITS_H
@@ -499,8 +528,16 @@ namespace std {
 struct string {
   string(const char*);
   ~string();
+  const char *c_str() const;
+  bool empty();
+};
+
+struct string_view {
+  string_view(const char*);
+  ~string_view();
   bool empty();
 };
+
 bool operator!=(const string &LHS, const char *RHS);
 
 } // namespace std
@@ -1240,6 +1277,998 @@ constexpr bool operator!=(const T &value, const Optional<U> &opt);
 } // namespace base
 )";
 
+constexpr const char StatusDefsHeader[] =
+    R"cc(
+#ifndef STATUS_H_
+#define STATUS_H_
+
+#include "absl_type_traits.h"
+#include "std_initializer_list.h"
+#include "std_type_traits.h"
+#include "std_utility.h"
+#include "std_string.h"
+
+  namespace absl {
+  struct SourceLocation {
+    static constexpr SourceLocation current();
+    static constexpr SourceLocation DoNotInvokeDirectlyNoSeriouslyDont(
+        int line, const char* file_name);
+  };
+  }  // namespace absl
+  namespace absl {
+  enum class StatusCode : int {
+    kOk,
+    kCancelled,
+    kUnknown,
+    kInvalidArgument,
+    kDeadlineExceeded,
+    kNotFound,
+    kAlreadyExists,
+    kPermissionDenied,
+    kResourceExhausted,
+    kFailedPrecondition,
+    kAborted,
+    kOutOfRange,
+    kUnimplemented,
+    kInternal,
+    kUnavailable,
+    kDataLoss,
+    kUnauthenticated,
+  };
+  }  // namespace absl
+
+  namespace absl {
+  enum class StatusToStringMode : int {
+    kWithNoExtraData = 0,
+    kWithPayload = 1 << 0,
+    kWithSourceLocation = 1 << 1,
+    kWithEverything = ~kWithNoExtraData,
+    kDefault = kWithPayload,
+  };
+  class Status {
+   public:
+    Status();
+    template <typename Enum>
+    Status(Enum code, std::string_view msg);
+    Status(absl::StatusCode code, std::string_view msg,
+           absl::SourceLocation loc = SourceLocation::current());
+    Status(const Status& base_status, absl::SourceLocation loc);
+    Status(Status&& base_status, absl::SourceLocation loc);
+    ~Status() {}
+
+    Status(const Status&);
+    Status& operator=(const Status& x);
+
+    Status(Status&&) noexcept;
+    Status& operator=(Status&&);
+
+    friend bool operator==(const Status&, const Status&);
+    friend bool operator!=(const Status&, const Status&);
+
+    bool ok() const { return true; }
+    void CheckSuccess() const;
+    void IgnoreError() const;
+    int error_code() const;
+    absl::Status ToCanonical() const;
+    std::string ToString(
+        StatusToStringMode m = StatusToStringMode::kDefault) const;
+    void Update(const Status& new_status);
+    void Update(Status&& new_status);
+  };
+
+  bool operator==(const Status& lhs, const Status& rhs);
+  bool operator!=(const Status& lhs, const Status& rhs);
+
+  Status OkStatus();
+  Status InvalidArgumentError(char*);
+#endif  // STATUS_H
+)cc";
+
+constexpr const char StatusOrDefsHeader[] = R"cc(
+#ifndef STATUSOR_H_
+#define STATUSOR_H_
+#include "absl_type_traits.h"
+#include "std_initializer_list.h"
+#include "std_type_traits.h"
+#include "std_utility.h"
+  #include "status_defs.h"
+  template <typename T>
+  struct StatusOr;
+
+  namespace internal_statusor {
+
+  template <typename T, typename U, typename = void>
+  struct HasConversionOperatorToStatusOr : std::false_type {};
+
+  template <typename T, typename U>
+  void test(char (*)[sizeof(std::declval<U>().operator absl::StatusOr<T>())]);
+
+  template <typename T, typename U>
+  struct HasConversionOperatorToStatusOr<T, U, decltype(test<T, U>(0))>
+      : std::true_type {};
+
+  template <typename T, typename U>
+  using IsConstructibleOrConvertibleFromStatusOr =
+      absl::disjunction<std::is_constructible<T, StatusOr<U>&>,
+                        std::is_constructible<T, const StatusOr<U>&>,
+                        std::is_constructible<T, StatusOr<U>&&>,
+                        std::is_constructible<T, const StatusOr<U>&&>,
+                        std::is_convertible<StatusOr<U>&, T>,
+                        std::is_convertible<const StatusOr<U>&, T>,
+                        std::is_convertible<StatusOr<U>&&, T>,
+                        std::is_convertible<const StatusOr<U>&&, T>>;
+
+  template <typename T, typename U>
+  using IsConstructibleOrConvertibleOrAssignableFromStatusOr =
+      absl::disjunction<IsConstructibleOrConvertibleFromStatusOr<T, U>,
+                        std::is_assignable<T&, StatusOr<U>&>,
+                        std::is_assignable<T&, const StatusOr<U>&>,
+                        std::is_assignable<T&, StatusOr<U>&&>,
+                        std::is_assignable<T&, const StatusOr<U>&&>>;
+
+  template <typename T, typename U>
+  struct IsDirectInitializationAmbiguous
+      : public absl::conditional_t<
+            std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>,
+                         U>::value,
+            std::false_type,
+            IsDirectInitializationAmbiguous<
+                T, absl::remove_cv_t<absl::remove_reference_t<U>>>> {};
+
+  template <typename T, typename V>
+  struct IsDirectInitializationAmbiguous<T, absl::StatusOr<V>>
+      : public IsConstructibleOrConvertibleFromStatusOr<T, V> {};
+
+  template <typename T, typename U>
+  using IsDirectInitializationValid = absl::disjunction<
+      // Short circuits if T is basically U.
+      std::is_same<T, absl::remove_cv_t<absl::remove_reference_t<U>>>,
+      absl::negation<absl::disjunction<
+          std::is_same<absl::StatusOr<T>,
+                       absl::remove_cv_t<absl::remove_reference_t<U>>>,
+          std::is_same<absl::Status,
+                       absl::remove_cv_t<absl::remove_reference_t<U>>>,
+          std::is_same<absl::in_place_t,
+                       absl::remove_cv_t<absl::remove_reference_t<U>>>,
+          IsDirectInitializationAmbiguous<T, U>>>>;
+
+  template <typename T, typename U>
+  struct IsForwardingAssignmentAmbiguous
+      : public absl::conditional_t<
+            std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>,
+                         U>::value,
+            std::false_type,
+            IsForwardingAssignmentAmbiguous<
+                T, absl::remove_cv_t<absl::remove_reference_t<U>>>> {};
+
+  template <typename T, typename U>
+  struct IsForwardingAssignmentAmbiguous<T, absl::StatusOr<U>>
+      : public IsConstructibleOrConvertibleOrAssignableFromStatusOr<T, U> {};
+
+  template <typename T, typename U>
+  using IsForwardingAssignmentValid = absl::disjunction<
+      // Short circuits if T is basically U.
+      std::is_same<T, absl::remove_cv_t<absl::remove_reference_t<U>>>,
+      absl::negation<absl::disjunction<
+          std::is_same<absl::StatusOr<T>,
+                       absl::remove_cv_t<absl::remove_reference_t<U>>>,
+          std::is_same<absl::Status,
+                       absl::remove_cv_t<absl::remove_reference_t<U>>>,
+          std::is_same<absl::in_place_t,
+                       absl::remove_cv_t<absl::remove_reference_t<U>>>,
+          IsForwardingAssignmentAmbiguous<T, U>>>>;
+
+  template <typename T, typename U>
+  using IsForwardingAssignmentValid = absl::disjunction<
+      // Short circuits if T is basically U.
+      std::is_same<T, absl::remove_cv_t<absl::remove_reference_t<U>>>,
+      absl::negation<absl::disjunction<
+          std::is_same<absl::StatusOr<T>,
+                       absl::remove_cv_t<absl::remove_reference_t<U>>>,
+          std::is_same<absl::Status,
+                       absl::remove_cv_t<absl::remove_reference_t<U>>>,
+          std::is_same<absl::in_place_t,
+                       absl::remove_cv_t<absl::remove_reference_t<U>>>,
+          IsForwardingAssignmentAmbiguous<T, U>>>>;
+
+  template <typename T>
+  struct OperatorBase {
+    const T& value() const&;
+    T& value() &;
+    const T&& value() const&&;
+    T&& value() &&;
+
+    const T& operator*() const&;
+    T& operator*() &;
+    const T&& operator*() const&&;
+    T&& operator*() &&;
+
+    // To test that analyses are okay if there is a use of operator*
+    // within this base class.
+    const T* operator->() const { return __builtin_addressof(**this); }
+    T* operator->() { return __builtin_addressof(**this); }
+  };
+
+  }  // namespace internal_statusor
+
+  template <typename T>
+  struct StatusOr : private internal_statusor::OperatorBase<T> {
+    explicit StatusOr();
+
+    StatusOr(const StatusOr&) = default;
+    StatusOr& operator=(const StatusOr&) = default;
+
+    StatusOr(StatusOr&&) = default;
+    StatusOr& operator=(StatusOr&&) = default;
+
+    template <
+        typename U,
+        absl::enable_if_t<
+            absl::conjunction<
+                absl::negation<std::is_same<T, U>>,
+                std::is_constructible<T, const U&>,
+                std::is_convertible<const U&, T>,
+                absl::negation<
+                    internal_statusor::IsConstructibleOrConvertibleFromStatusOr<
+                        T, U>>>::value,
+            int> = 0>
+    StatusOr(const StatusOr<U>&);
+
+    template <
+        typename U,
+        absl::enable_if_t<
+            absl::conjunction<
+                absl::negation<std::is_same<T, U>>,
+                std::is_constructible<T, const U&>,
+                absl::negation<std::is_convertible<const U&, T>>,
+                absl::negation<
+                    internal_statusor::IsConstructibleOrConvertibleFromStatusOr<
+                        T, U>>>::value,
+            int> = 0>
+    explicit StatusOr(const StatusOr<U>&);
+
+    template <
+        typename U,
+        absl::enable_if_t<
+            absl::conjunction<
+                absl::negation<std::is_same<T, U>>,
+                std::is_constructible<T, U&&>, std::is_convertible<U&&, T>,
+                absl::negation<
+                    internal_statusor::IsConstructibleOrConvertibleFromStatusOr<
+                        T, U>>>::value,
+            int> = 0>
+    StatusOr(StatusOr<U>&&);
+
+    template <
+        typename U,
+        absl::enable_if_t<
+            absl::conjunction<
+                absl::negation<std::is_same<T, U>>,
+                std::is_constructible<T, U&&>,
+                absl::negation<std::is_convertible<U&&, T>>,
+                absl::negation<
+                    internal_statusor::IsConstructibleOrConvertibleFromStatusOr<
+                        T, U>>>::value,
+            int> = 0>
+    explicit StatusOr(StatusOr<U>&&);
+
+    template <
+        typename U,
+        absl::enable_if_t<
+            absl::conjunction<
+                absl::negation<std::is_same<T, U>>,
+                std::is_constructible<T, const U&>,
+                std::is_assignable<T, const U&>,
+                absl::negation<
+                    internal_statusor::
+                        IsConstructibleOrConvertibleOrAssignableFromStatusOr<
+                            T, U>>>::value,
+            int> = 0>
+    StatusOr& operator=(const StatusOr<U>&);
+
+    template <
+        typename U,
+        absl::enable_if_t<
+            absl::conjunction<
+                absl::negation<std::is_same<T, U>>,
+                std::is_constructible<T, U&&>, std::is_assignable<T, U&&>,
+                absl::negation<
+                    internal_statusor::
+                        IsConstructibleOrConvertibleOrAssignableFromStatusOr<
+                            T, U>>>::value,
+            int> = 0>
+    StatusOr& operator=(StatusOr<U>&&);
+
+    template <typename U = absl::Status,
+              absl::enable_if_t<
+                  absl::conjunction<
+                      std::is_convertible<U&&, absl::Status>,
+                      std::is_constructible<absl::Status, U&&>,
+                      absl::negation<
+                          std::is_same<absl::decay_t<U>, absl::StatusOr<T>>>,
+                      absl::negation<std::is_same<absl::decay_t<U>, T>>,
+                      absl::negation<
+                          std::is_same<absl::decay_t<U>, absl::in_place_t>>,
+                      absl::negation<
+                          internal_statusor::HasConversionOperatorToStatusOr<
+                              T, U&&>>>::value,
+                  int> = 0>
+    StatusOr(U&&);
+
+    template <typename U = absl::Status,
+              absl::enable_if_t<
+                  absl::conjunction<
+                      absl::negation<std::is_convertible<U&&, absl::Status>>,
+                      std::is_constructible<absl::Status, U&&>,
+                      absl::negation<
+                          std::is_same<absl::decay_t<U>, absl::StatusOr<T>>>,
+                      absl::negation<std::is_same<absl::decay_t<U>, T>>,
+                      absl::negation<
+                          std::is_same<absl::decay_t<U>, absl::in_place_t>>,
+                      absl::negation<
+                          internal_statusor::HasConversionOperatorToStatusOr<
+                              T, U&&>>>::value,
+                  int> = 0>
+    explicit StatusOr(U&&);
+
+    template <typename U = absl::Status,
+              absl::enable_if_t<
+                  absl::conjunction<
+                      std::is_convertible<U&&, absl::Status>,
+                      std::is_constructible<absl::Status, U&&>,
+                      absl::negation<
+                          std::is_same<absl::decay_t<U>, absl::StatusOr<T>>>,
+                      absl::negation<std::is_same<absl::decay_t<U>, T>>,
+                      absl::negation<
+                          std::is_same<absl::decay_t<U>, absl::in_place_t>>,
+                      absl::negation<
+                          internal_statusor::HasConversionOperatorToStatusOr<
+                              T, U&&>>>::value,
+                  int> = 0>
+    StatusOr& operator=(U&&);
+
+    template <
+        typename U = T,
+        typename = typename std::enable_if<absl::conjunction<
+            std::is_constructible<T, U&&>, std::is_assignable<T&, U&&>,
+            absl::disjunction<
+                std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>, T>,
+                absl::conjunction<
+                    absl::negation<std::is_convertible<U&&, absl::Status>>,
+                    absl::negation<
+                        internal_statusor::HasConversionOperatorToStatusOr<
+                            T, U&&>>>>,
+            internal_statusor::IsForwardingAssignmentValid<T, U&&>>::value>::
+            type>
+    StatusOr& operator=(U&&);
+
+    template <typename... Args>
+    explicit StatusOr(absl::in_place_t, Args&&...);
+
+    template <typename U, typename... Args>
+    explicit StatusOr(absl::in_place_t, std::initializer_list<U>, Args&&...);
+
+    template <
+        typename U = T,
+        absl::enable_if_t<
+            absl::conjunction<
+                internal_statusor::IsDirectInitializationValid<T, U&&>,
+                std::is_constructible<T, U&&>, std::is_convertible<U&&, T>,
+                absl::disjunction<
+                    std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>,
+                                 T>,
+                    absl::conjunction<
+                        absl::negation<std::is_convertible<U&&, absl::Status>>,
+                        absl::negation<
+                            internal_statusor::HasConversionOperatorToStatusOr<
+                                T, U&&>>>>>::value,
+            int> = 0>
+    StatusOr(U&&);
+
+    template <
+        typename U = T,
+        absl::enable_if_t<
+            absl::conjunction<
+                internal_statusor::IsDirectInitializationValid<T, U&&>,
+                absl::disjunction<
+                    std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>,
+                                 T>,
+                    absl::conjunction<
+                        absl::negation<
+                            std::is_constructible<absl::Status, U&&>>,
+                        absl::negation<
+                            internal_statusor::HasConversionOperatorToStatusOr<
+                                T, U&&>>>>,
+                std::is_constructible<T, U&&>,
+                absl::negation<std::is_convertible<U&&, T>>>::value,
+            int> = 0>
+    explicit StatusOr(U&&);
+
+    bool ok() const;
+
+    const Status& status() const& { return status_; }
+    Status status() &&;
+
+    using StatusOr::OperatorBase::value;
+
+    const T& ValueOrDie() const&;
+    T& ValueOrDie() &;
+    const T&& ValueOrDie() const&&;
+    T&& ValueOrDie() &&;
+
+    using StatusOr::OperatorBase::operator*;
+    using StatusOr::OperatorBase::operator->;
+
+    template <typename U>
+    T value_or(U&& default_value) const&;
+    template <typename U>
+    T value_or(U&& default_value) &&;
+
+    template <typename... Args>
+    T& emplace(Args&&... args);
+
+    template <
+        typename U, typename... Args,
+        absl::enable_if_t<std::is_constructible<T, std::initializer_list<U>&,
+                                                Args&&...>::value,
+                          int> = 0>
+    T& emplace(std::initializer_list<U> ilist, Args&&... args);
+
+   private:
+    absl::Status status_;
+  };
+
+  template <typename T>
+  bool operator==(const StatusOr<T>& lhs, const StatusOr<T>& rhs);
+
+  template <typename T>
+  bool operator!=(const StatusOr<T>& lhs, const StatusOr<T>& rhs);
+
+  }  // namespace absl
+
+#endif  // STATUSOR_H_
+    )cc";
+
+static constexpr char StdVectorHeader[] = R"(
+#ifndef STD_VECTOR_H
+#define STD_VECTOR_H
+namespace std {
+  template <class T>
+  struct allocator {
+    typedef size_t size_type;
+    typedef ptrdiff_t difference_type;
+    typedef T* pointer;
+    typedef const T* const_pointer;
+    typedef T value_type;
+
+    T* allocate(size_t n);
+  };
+
+  template <class Alloc>
+  struct allocator_traits {
+    typedef Alloc allocator_type;
+    typedef typename allocator_type::value_type value_type;
+    typedef typename allocator_type::pointer pointer;
+    typedef typename allocator_type::const_pointer const_pointer;
+    typedef typename allocator_type::difference_type difference_type;
+    typedef typename allocator_type::size_type size_type;
+  };
+
+  template <typename T, class Allocator = allocator<T>>
+  class vector {
+   public:
+    using value_type = T;
+    using size_type = typename allocator_traits<Allocator>::size_type;
+
+    // Constructors.
+    vector() {}
+    vector(size_type, const Allocator& = Allocator()) {}
+    vector(initializer_list<T> initializer_list,
+           const Allocator& = Allocator()) {}
+    vector(const vector& vector) {}
+    ~vector();
+
+    // Modifiers.
+    void push_back(const T& value);
+    void push_back(T&& value);
+    template <typename... Args>
+    T& emplace_back(Args&&... args);
+
+    // Iterators
+    class InputIterator {
+     public:
+      InputIterator(const InputIterator&);
+      ~InputIterator();
+      InputIterator& operator=(const InputIterat...
[truncated]

@fmayer
Copy link
Contributor Author

fmayer commented Oct 13, 2025

@BaLiKfromUA CC

Created using spr 1.3.7
Created using spr 1.3.7

[skip ci]
Created using spr 1.3.7
@fmayer fmayer changed the base branch from users/fmayer/spr/main.flowsensitive-statusor-1n-add-mock-headers to main October 13, 2025 20:35
Created using spr 1.3.7
#include "std_utility.h"
#include "std_string.h"
namespace absl {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: any idea why these are indented a bit vs the include lines ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

#include "std_initializer_list.h"
#include "std_type_traits.h"
#include "std_utility.h"
#include "status_defs.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: any idea why this include is indented more (and the rest of the file indented more)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Created using spr 1.3.7
Created using spr 1.3.7
@fmayer fmayer requested a review from jvoung October 15, 2025 19:46
Created using spr 1.3.7
@fmayer fmayer enabled auto-merge (squash) October 15, 2025 20:03
@fmayer fmayer merged commit 6a0416a into main Oct 15, 2025
7 of 9 checks passed
@fmayer fmayer deleted the users/fmayer/spr/flowsensitive-statusor-1n-add-mock-headers branch October 15, 2025 20:33
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 15, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-quick running on linaro-clang-aarch64-quick while building clang at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/65/builds/24050

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Clangd Unit Tests :: ./ClangdTests/55/334' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests-Clangd Unit Tests-4052937-55-334.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=334 GTEST_SHARD_INDEX=55 /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests
--

Note: This is test shard 56 of 334.
[==========] Running 4 tests from 4 test suites.
[----------] Global test environment set-up.
[----------] 1 test from ClangdServerTest
[ RUN      ] ClangdServerTest.FormatCode
ASTWorker building file /clangd-test/foo.cpp version null with command 
[/clangd-test]
clang -ffreestanding /clangd-test/foo.cpp
Driver produced command: cc1 -cc1 -triple aarch64-unknown-linux-gnu -fsyntax-only -disable-free -clear-ast-before-backend -main-file-name foo.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=non-leaf -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -ffreestanding -enable-tlsdesc -target-cpu generic -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon -target-abi aapcs -debugger-tuning=gdb -fdebug-compilation-dir=/clangd-test -fcoverage-compilation-dir=/clangd-test -resource-dir lib/clang/22 -internal-isystem lib/clang/22/include -internal-isystem /usr/local/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -no-round-trip-args -target-feature -fmv -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ /clangd-test/foo.cpp
Building first preamble for /clangd-test/foo.cpp version null
not idle after addDocument
UNREACHABLE executed at ../llvm/clang-tools-extra/clangd/unittests/SyncAPI.cpp:22!
 #0 0x0000c85be4bafd7c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xcffd7c)
 #1 0x0000c85be4bad86c llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xcfd86c)
 #2 0x0000c85be4bb0bbc SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x0000f935c44f08f8 (linux-vdso.so.1+0x8f8)
 #4 0x0000f935c4002008 __pthread_kill_implementation ./nptl/./nptl/pthread_kill.c:44:76
 #5 0x0000f935c3fba83c gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #6 0x0000f935c3fa7134 abort ./stdlib/./stdlib/abort.c:81:7
 #7 0x0000c85be4b5bd94 llvm::RTTIRoot::anchor() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xcabd94)
 #8 0x0000c85be49f2a44 clang::clangd::runCodeComplete(clang::clangd::ClangdServer&, llvm::StringRef, clang::clangd::Position, clang::clangd::CodeCompleteOptions) (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xb42a44)
 #9 0x0000c85be44c7d20 clang::clangd::(anonymous namespace)::ClangdServerTest_FormatCode_Test::TestBody() ClangdTests.cpp:0:0
#10 0x0000c85be4c0a908 testing::Test::Run() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xd5a908)
#11 0x0000c85be4c0bc18 testing::TestInfo::Run() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xd5bc18)
#12 0x0000c85be4c0c7e0 testing::TestSuite::Run() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xd5c7e0)
#13 0x0000c85be4c1d528 testing::internal::UnitTestImpl::RunAllTests() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xd6d528)
#14 0x0000c85be4c1ce94 testing::UnitTest::Run() (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xd6ce94)
#15 0x0000c85be4bf6cf4 main (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0xd46cf4)
#16 0x0000f935c3fa7400 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#17 0x0000f935c3fa74d8 call_init ./csu/../csu/libc-start.c:128:20
#18 0x0000f935c3fa74d8 __libc_start_main ./csu/../csu/libc-start.c:379:5
#19 0x0000c85be433f3b0 _start (/home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests+0x48f3b0)

--
exit: -6
--
shard JSON output does not exist: /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/tools/clang/tools/extra/clangd/unittests/./ClangdTests-Clangd Unit Tests-4052937-55-334.json
********************


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:dataflow Clang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants