Skip to content

[clang-repl] Lay the basic infrastructure for pretty printing of types #148701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 19, 2025

Conversation

vgvassilev
Copy link
Contributor

The idea is to store a type-value pair in clang::Value which is updated by the interpreter runtime. The class copies builtin types and boxes non-builtin types to provide some lifetime control.

The patch enables default printers for C and C++ using a very minimalistic approach. We handle enums, arrays and user types. Once we land this we can focus on enabling user-defined pretty-printers which take control over printing of types

The work started as part of https://reviews.llvm.org/D146809, then we created a giant in #84769

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jul 14, 2025
@vgvassilev vgvassilev requested a review from AaronBallman July 14, 2025 18:59
@llvmbot
Copy link
Member

llvmbot commented Jul 14, 2025

@llvm/pr-subscribers-clang

Author: Vassil Vassilev (vgvassilev)

Changes

The idea is to store a type-value pair in clang::Value which is updated by the interpreter runtime. The class copies builtin types and boxes non-builtin types to provide some lifetime control.

The patch enables default printers for C and C++ using a very minimalistic approach. We handle enums, arrays and user types. Once we land this we can focus on enabling user-defined pretty-printers which take control over printing of types

The work started as part of https://reviews.llvm.org/D146809, then we created a giant in #84769


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

13 Files Affected:

  • (modified) clang/include/clang/AST/ASTContext.h (+2)
  • (modified) clang/include/clang/Interpreter/Interpreter.h (+22-12)
  • (modified) clang/include/clang/Interpreter/Value.h (+3-4)
  • (modified) clang/lib/Interpreter/CMakeLists.txt (+1)
  • (modified) clang/lib/Interpreter/Interpreter.cpp (+28-17)
  • (modified) clang/lib/Interpreter/InterpreterUtils.cpp (+5-3)
  • (modified) clang/lib/Interpreter/InterpreterUtils.h (+1-1)
  • (modified) clang/lib/Interpreter/InterpreterValuePrinter.cpp (+365-26)
  • (modified) clang/lib/Interpreter/Value.cpp (+29-7)
  • (modified) clang/lib/Parse/ParseStmt.cpp (+2-1)
  • (modified) clang/test/Interpreter/pretty-print.c (+73-2)
  • (added) clang/test/Interpreter/pretty-print.cpp (+59)
  • (modified) clang/unittests/Interpreter/InterpreterTest.cpp (+19)
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index 2b9cd035623cc..f058239aabedc 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -1192,6 +1192,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
   bool isInSameModule(const Module *M1, const Module *M2) const;
 
   TranslationUnitDecl *getTranslationUnitDecl() const {
+    assert(TUDecl->getMostRecentDecl() == TUDecl &&
+           "The active TU is not current one!");
     return TUDecl->getMostRecentDecl();
   }
   void addTranslationUnitDecl() {
diff --git a/clang/include/clang/Interpreter/Interpreter.h b/clang/include/clang/Interpreter/Interpreter.h
index 78dff1165dcf5..7ff5599a8a568 100644
--- a/clang/include/clang/Interpreter/Interpreter.h
+++ b/clang/include/clang/Interpreter/Interpreter.h
@@ -175,23 +175,15 @@ class Interpreter {
   llvm::Expected<llvm::orc::ExecutorAddr>
   getSymbolAddressFromLinkerName(llvm::StringRef LinkerName) const;
 
-  const llvm::SmallVectorImpl<Expr *> &getValuePrintingInfo() const {
-    return ValuePrintingInfo;
-  }
-
-  Expr *SynthesizeExpr(Expr *E);
+  std::unique_ptr<llvm::Module> GenModule(IncrementalAction *Action = nullptr);
+  PartialTranslationUnit &RegisterPTU(TranslationUnitDecl *TU,
+                                      std::unique_ptr<llvm::Module> M = {},
+                                      IncrementalAction *Action = nullptr);
 
 private:
   size_t getEffectivePTUSize() const;
   void markUserCodeStart();
   llvm::Expected<Expr *> ExtractValueFromExpr(Expr *E);
-  llvm::Expected<llvm::orc::ExecutorAddr> CompileDtorCall(CXXRecordDecl *CXXRD);
-
-  CodeGenerator *getCodeGen(IncrementalAction *Action = nullptr) const;
-  std::unique_ptr<llvm::Module> GenModule(IncrementalAction *Action = nullptr);
-  PartialTranslationUnit &RegisterPTU(TranslationUnitDecl *TU,
-                                      std::unique_ptr<llvm::Module> M = {},
-                                      IncrementalAction *Action = nullptr);
 
   // A cache for the compiled destructors used to for de-allocation of managed
   // clang::Values.
@@ -200,6 +192,24 @@ class Interpreter {
   llvm::SmallVector<Expr *, 4> ValuePrintingInfo;
 
   std::unique_ptr<llvm::orc::LLJITBuilder> JITBuilder;
+
+  /// @}
+  /// @name Value and pretty printing support
+  /// @{
+
+  std::string ValueDataToString(const Value &V);
+  std::string ValueTypeToString(const Value &V) const;
+
+  llvm::Expected<Expr *> convertExprToValue(Expr *E);
+
+  // When we deallocate clang::Value we need to run the destructor of the type.
+  // This function forces emission of the needed dtor.
+  llvm::Expected<llvm::orc::ExecutorAddr> CompileDtorCall(CXXRecordDecl *CXXRD);
+
+  /// @}
+  /// @name Code generation
+  /// @{
+  CodeGenerator *getCodeGen(IncrementalAction *Action = nullptr) const;
 };
 } // namespace clang
 
diff --git a/clang/include/clang/Interpreter/Value.h b/clang/include/clang/Interpreter/Value.h
index a93c0841915fc..e71e4e37e22f6 100644
--- a/clang/include/clang/Interpreter/Value.h
+++ b/clang/include/clang/Interpreter/Value.h
@@ -119,9 +119,9 @@ class REPL_EXTERNAL_VISIBILITY Value {
   ~Value();
 
   void printType(llvm::raw_ostream &Out) const;
-  void printData(llvm::raw_ostream &Out) const;
-  void print(llvm::raw_ostream &Out) const;
-  void dump() const;
+  void printData(llvm::raw_ostream &Out);
+  void print(llvm::raw_ostream &Out);
+  void dump();
   void clear();
 
   ASTContext &getASTContext();
@@ -205,6 +205,5 @@ template <> inline void *Value::as() const {
     return Data.m_Ptr;
   return (void *)as<uintptr_t>();
 }
-
 } // namespace clang
 #endif
diff --git a/clang/lib/Interpreter/CMakeLists.txt b/clang/lib/Interpreter/CMakeLists.txt
index 38cf139fa86a6..70de4a2aaa541 100644
--- a/clang/lib/Interpreter/CMakeLists.txt
+++ b/clang/lib/Interpreter/CMakeLists.txt
@@ -29,6 +29,7 @@ add_clang_library(clangInterpreter
   InterpreterUtils.cpp
   RemoteJITUtils.cpp
   Value.cpp
+  InterpreterValuePrinter.cpp
   ${WASM_SRC}
   PARTIAL_SOURCES_INTENDED
 
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index ed3bae59a144c..1bacf60627cee 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -264,7 +264,7 @@ class InProcessPrintingASTConsumer final : public MultiplexConsumer {
       if (auto *TLSD = llvm::dyn_cast<TopLevelStmtDecl>(D))
         if (TLSD && TLSD->isSemiMissing()) {
           auto ExprOrErr =
-              Interp.ExtractValueFromExpr(cast<Expr>(TLSD->getStmt()));
+              Interp.convertExprToValue(cast<Expr>(TLSD->getStmt()));
           if (llvm::Error E = ExprOrErr.takeError()) {
             llvm::logAllUnhandledErrors(std::move(E), llvm::errs(),
                                         "Value printing failed: ");
@@ -416,6 +416,8 @@ Interpreter::Interpreter(std::unique_ptr<CompilerInstance> Instance,
         return;
       }
   }
+
+  ValuePrintingInfo.resize(4);
 }
 
 Interpreter::~Interpreter() {
@@ -440,11 +442,10 @@ const char *const Runtimes = R"(
     #define __CLANG_REPL__ 1
 #ifdef __cplusplus
     #define EXTERN_C extern "C"
-    void *__clang_Interpreter_SetValueWithAlloc(void*, void*, void*);
     struct __clang_Interpreter_NewTag{} __ci_newtag;
     void* operator new(__SIZE_TYPE__, void* __p, __clang_Interpreter_NewTag) noexcept;
     template <class T, class = T (*)() /*disable for arrays*/>
-    void __clang_Interpreter_SetValueCopyArr(T* Src, void* Placement, unsigned long Size) {
+    void __clang_Interpreter_SetValueCopyArr(const T* Src, void* Placement, unsigned long Size) {
       for (auto Idx = 0; Idx < Size; ++Idx)
         new ((void*)(((T*)Placement) + Idx), __ci_newtag) T(Src[Idx]);
     }
@@ -454,8 +455,12 @@ const char *const Runtimes = R"(
     }
 #else
     #define EXTERN_C extern
+    EXTERN_C void *memcpy(void *restrict dst, const void *restrict src, __SIZE_TYPE__ n);
+    EXTERN_C inline void __clang_Interpreter_SetValueCopyArr(const void* Src, void* Placement, unsigned long Size) {
+      memcpy(Placement, Src, Size);
+    }
 #endif // __cplusplus
-
+  EXTERN_C void *__clang_Interpreter_SetValueWithAlloc(void*, void*, void*);
   EXTERN_C void __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType, ...);
 )";
 
@@ -470,12 +475,12 @@ Interpreter::create(std::unique_ptr<CompilerInstance> CI,
 
   // Add runtime code and set a marker to hide it from user code. Undo will not
   // go through that.
-  auto PTU = Interp->Parse(Runtimes);
-  if (!PTU)
-    return PTU.takeError();
+  Err = Interp->ParseAndExecute(Runtimes);
+  if (Err)
+    return std::move(Err);
+
   Interp->markUserCodeStart();
 
-  Interp->ValuePrintingInfo.resize(4);
   return std::move(Interp);
 }
 
@@ -524,12 +529,11 @@ Interpreter::createWithCUDA(std::unique_ptr<CompilerInstance> CI,
   return std::move(Interp);
 }
 
+CompilerInstance *Interpreter::getCompilerInstance() { return CI.get(); }
 const CompilerInstance *Interpreter::getCompilerInstance() const {
-  return CI.get();
+  return const_cast<Interpreter *>(this)->getCompilerInstance();
 }
 
-CompilerInstance *Interpreter::getCompilerInstance() { return CI.get(); }
-
 llvm::Expected<llvm::orc::LLJIT &> Interpreter::getExecutionEngine() {
   if (!IncrExecutor) {
     if (auto Err = CreateExecutor())
@@ -610,7 +614,14 @@ Interpreter::Parse(llvm::StringRef Code) {
   if (!TuOrErr)
     return TuOrErr.takeError();
 
-  return RegisterPTU(*TuOrErr);
+  PTUs.emplace_back(PartialTranslationUnit());
+  PartialTranslationUnit &LastPTU = PTUs.back();
+  LastPTU.TUPart = *TuOrErr;
+
+  if (std::unique_ptr<llvm::Module> M = GenModule())
+    LastPTU.TheModule = std::move(M);
+
+  return LastPTU;
 }
 
 static llvm::Expected<llvm::orc::JITTargetMachineBuilder>
@@ -806,13 +817,13 @@ Interpreter::GenModule(IncrementalAction *Action) {
     // of the module which does not map well to CodeGen's design. To work this
     // around we created an empty module to make CodeGen happy. We should make
     // sure it always stays empty.
-    assert(((!CachedInCodeGenModule ||
-             !getCompilerInstance()->getPreprocessorOpts().Includes.empty()) ||
-            (CachedInCodeGenModule->empty() &&
+    assert((!CachedInCodeGenModule ||
+            !getCompilerInstance()->getPreprocessorOpts().Includes.empty()) ||
+           ((CachedInCodeGenModule->empty() &&
              CachedInCodeGenModule->global_empty() &&
              CachedInCodeGenModule->alias_empty() &&
              CachedInCodeGenModule->ifunc_empty())) &&
-           "CodeGen wrote to a readonly module");
+               "CodeGen wrote to a readonly module");
     std::unique_ptr<llvm::Module> M(CG->ReleaseModule());
     CG->StartModule("incr_module_" + std::to_string(ID++), M->getContext());
     return M;
@@ -828,4 +839,4 @@ CodeGenerator *Interpreter::getCodeGen(IncrementalAction *Action) const {
     return nullptr;
   return static_cast<CodeGenAction *>(WrappedAct)->getCodeGenerator();
 }
-} // namespace clang
+} // end namespace clang
diff --git a/clang/lib/Interpreter/InterpreterUtils.cpp b/clang/lib/Interpreter/InterpreterUtils.cpp
index 45f6322b8461e..a19f96c80b94f 100644
--- a/clang/lib/Interpreter/InterpreterUtils.cpp
+++ b/clang/lib/Interpreter/InterpreterUtils.cpp
@@ -11,6 +11,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "InterpreterUtils.h"
+#include "clang/AST/QualTypeNames.h"
 
 namespace clang {
 
@@ -81,7 +82,7 @@ NamedDecl *LookupNamed(Sema &S, llvm::StringRef Name,
   else {
     const DeclContext *PrimaryWithin = nullptr;
     if (const auto *TD = dyn_cast<TagDecl>(Within))
-      PrimaryWithin = llvm::dyn_cast_or_null<DeclContext>(TD->getDefinition());
+      PrimaryWithin = dyn_cast_if_present<DeclContext>(TD->getDefinition());
     else
       PrimaryWithin = Within->getPrimaryContext();
 
@@ -97,15 +98,16 @@ NamedDecl *LookupNamed(Sema &S, llvm::StringRef Name,
   R.resolveKind();
 
   if (R.isSingleResult())
-    return llvm::dyn_cast<NamedDecl>(R.getFoundDecl());
+    return dyn_cast<NamedDecl>(R.getFoundDecl());
 
   return nullptr;
 }
 
 std::string GetFullTypeName(ASTContext &Ctx, QualType QT) {
+  QualType FQT = TypeName::getFullyQualifiedType(QT, Ctx);
   PrintingPolicy Policy(Ctx.getPrintingPolicy());
   Policy.SuppressScope = false;
   Policy.AnonymousTagLocations = false;
-  return QT.getAsString(Policy);
+  return FQT.getAsString(Policy);
 }
 } // namespace clang
diff --git a/clang/lib/Interpreter/InterpreterUtils.h b/clang/lib/Interpreter/InterpreterUtils.h
index c7b405b486d93..fbf9814b0d4a7 100644
--- a/clang/lib/Interpreter/InterpreterUtils.h
+++ b/clang/lib/Interpreter/InterpreterUtils.h
@@ -45,7 +45,7 @@ NamespaceDecl *LookupNamespace(Sema &S, llvm::StringRef Name,
                                const DeclContext *Within = nullptr);
 
 NamedDecl *LookupNamed(Sema &S, llvm::StringRef Name,
-                       const DeclContext *Within);
+                       const DeclContext *Within = nullptr);
 
 std::string GetFullTypeName(ASTContext &Ctx, QualType QT);
 } // namespace clang
diff --git a/clang/lib/Interpreter/InterpreterValuePrinter.cpp b/clang/lib/Interpreter/InterpreterValuePrinter.cpp
index 3e7e32b2e8557..ab5edac9029dc 100644
--- a/clang/lib/Interpreter/InterpreterValuePrinter.cpp
+++ b/clang/lib/Interpreter/InterpreterValuePrinter.cpp
@@ -18,6 +18,7 @@
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Interpreter/Interpreter.h"
 #include "clang/Interpreter/Value.h"
+#include "clang/Lex/Preprocessor.h"
 #include "clang/Sema/Lookup.h"
 #include "clang/Sema/Sema.h"
 
@@ -25,11 +26,333 @@
 #include "llvm/Support/raw_ostream.h"
 
 #include <cassert>
-
 #include <cstdarg>
+#include <sstream>
+#include <string>
+
+#define DEBUG_TYPE "interp-value"
+
+using namespace clang;
+
+static std::string DeclTypeToString(const QualType &QT, NamedDecl *D) {
+  std::string Str;
+  llvm::raw_string_ostream SS(Str);
+  if (QT.hasQualifiers())
+    SS << QT.getQualifiers().getAsString() << " ";
+  SS << D->getQualifiedNameAsString();
+  return Str;
+}
+
+static std::string QualTypeToString(ASTContext &Ctx, QualType QT) {
+  PrintingPolicy Policy(Ctx.getPrintingPolicy());
+  // Print the Allocator in STL containers, for instance.
+  Policy.SuppressDefaultTemplateArgs = false;
+  Policy.SuppressUnwrittenScope = true;
+  // Print 'a<b<c> >' rather than 'a<b<c>>'.
+  Policy.SplitTemplateClosers = true;
+
+  struct LocalPrintingPolicyRAII {
+    ASTContext &Context;
+    PrintingPolicy Policy;
+
+    LocalPrintingPolicyRAII(ASTContext &Ctx, PrintingPolicy &PP)
+        : Context(Ctx), Policy(Ctx.getPrintingPolicy()) {
+      Context.setPrintingPolicy(PP);
+    }
+    ~LocalPrintingPolicyRAII() { Context.setPrintingPolicy(Policy); }
+  } X(Ctx, Policy);
+
+  const QualType NonRefTy = QT.getNonReferenceType();
+
+  if (const auto *TTy = llvm::dyn_cast<TagType>(NonRefTy))
+    return DeclTypeToString(NonRefTy, TTy->getDecl());
+
+  if (const auto *TRy = dyn_cast<RecordType>(NonRefTy))
+    return DeclTypeToString(NonRefTy, TRy->getDecl());
+
+  const QualType Canon = NonRefTy.getCanonicalType();
+
+  // FIXME: How a builtin type can be a function pointer type?
+  if (Canon->isBuiltinType() && !NonRefTy->isFunctionPointerType() &&
+      !NonRefTy->isMemberPointerType())
+    return Canon.getAsString(Ctx.getPrintingPolicy());
+
+  if (const auto *TDTy = dyn_cast<TypedefType>(NonRefTy)) {
+    // FIXME: TemplateSpecializationType & SubstTemplateTypeParmType checks
+    // are predominately to get STL containers to print nicer and might be
+    // better handled in GetFullyQualifiedName.
+    //
+    // std::vector<Type>::iterator is a TemplateSpecializationType
+    // std::vector<Type>::value_type is a SubstTemplateTypeParmType
+    //
+    QualType SSDesugar = TDTy->getLocallyUnqualifiedSingleStepDesugaredType();
+    if (llvm::isa<SubstTemplateTypeParmType>(SSDesugar))
+      return GetFullTypeName(Ctx, Canon);
+    else if (llvm::isa<TemplateSpecializationType>(SSDesugar))
+      return GetFullTypeName(Ctx, NonRefTy);
+    return DeclTypeToString(NonRefTy, TDTy->getDecl());
+  }
+  return GetFullTypeName(Ctx, NonRefTy);
+}
+
+static std::string EnumToString(const Value &V) {
+  std::string Str;
+  llvm::raw_string_ostream SS(Str);
+  ASTContext &Ctx = const_cast<ASTContext &>(V.getASTContext());
+
+  QualType DesugaredTy = V.getType().getDesugaredType(Ctx);
+  const EnumType *EnumTy = DesugaredTy.getNonReferenceType()->getAs<EnumType>();
+  assert(EnumTy && "Fail to cast to enum type");
+
+  EnumDecl *ED = EnumTy->getDecl();
+  uint64_t Data = V.getULongLong();
+  bool IsFirst = true;
+  llvm::APSInt AP = Ctx.MakeIntValue(Data, DesugaredTy);
+
+  for (auto I = ED->enumerator_begin(), E = ED->enumerator_end(); I != E; ++I) {
+    if (I->getInitVal() == AP) {
+      if (!IsFirst)
+        SS << " ? ";
+      SS << "(" + I->getQualifiedNameAsString() << ")";
+      IsFirst = false;
+    }
+  }
+  llvm::SmallString<64> APStr;
+  AP.toString(APStr, /*Radix=*/10);
+  SS << " : " << QualTypeToString(Ctx, ED->getIntegerType()) << " " << APStr;
+  return Str;
+}
+
+static std::string FunctionToString(const Value &V, const void *Ptr) {
+  std::string Str;
+  llvm::raw_string_ostream SS(Str);
+  SS << "Function @" << Ptr;
+
+  const DeclContext *PTU = V.getASTContext().getTranslationUnitDecl();
+  // Find the last top-level-stmt-decl. This is a forward iterator but the
+  // partial translation unit should not be large.
+  const TopLevelStmtDecl *TLSD = nullptr;
+  for (const Decl *D : PTU->noload_decls())
+    if (isa<TopLevelStmtDecl>(D))
+      TLSD = cast<TopLevelStmtDecl>(D);
+
+  // Get __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void
+  // *OpaqueType, void *Val);
+  const FunctionDecl *FD = nullptr;
+  if (auto *InterfaceCall = llvm::dyn_cast<CallExpr>(TLSD->getStmt())) {
+    const auto *Arg = InterfaceCall->getArg(/*Val*/ 3);
+    // Get rid of cast nodes.
+    while (const CastExpr *CastE = llvm::dyn_cast<CastExpr>(Arg))
+      Arg = CastE->getSubExpr();
+    if (const DeclRefExpr *DeclRefExp = llvm::dyn_cast<DeclRefExpr>(Arg))
+      FD = llvm::dyn_cast<FunctionDecl>(DeclRefExp->getDecl());
+
+    if (FD) {
+      SS << '\n';
+      const clang::FunctionDecl *FDef;
+      if (FD->hasBody(FDef))
+        FDef->print(SS);
+    }
+  }
+  return Str;
+}
+
+static std::string AddressToString(const void *Ptr, char Prefix) {
+  std::string Str;
+  llvm::raw_string_ostream SS(Str);
+  if (!Ptr)
+    return Str;
+  SS << Prefix << Ptr;
+  return Str;
+}
+
+static std::string CharPtrToString(const char *Ptr) {
+  if (!Ptr)
+    return "0";
+
+  std::string result = "\"";
+  result += Ptr;
+  result += '"';
+  return result;
+}
 
 namespace clang {
 
+struct ValueRef : public Value {
+  ValueRef(Interpreter *In, void *Ty) : Value(In, Ty) {
+    // Tell the base class to not try to deallocate if it manages the value.
+    IsManuallyAlloc = false;
+  }
+  void setData(long double D) { Data.m_LongDouble = D; }
+};
+
+std::string Interpreter::ValueDataToString(const Value &V) {
+  Sema &S = getCompilerInstance()->getSema();
+  ASTContext &Ctx = S.getASTContext();
+
+  QualType QT = V.getType();
+
+  if (const ConstantArrayType *CAT = Ctx.getAsConstantArrayType(QT)) {
+    QualType ElemTy = CAT->getElementType();
+    size_t ElemCount = Ctx.getConstantArrayElementCount(CAT);
+    const Type *BaseTy = CAT->getBaseElementTypeUnsafe();
+    size_t ElemSize = Ctx.getTypeSizeInChars(BaseTy).getQuantity();
+
+    // Treat null terminated char arrays as strings basically.
+    if (ElemTy->isCharType()) {
+      char last = *(char *)(((uintptr_t)V.getPtr()) + ElemCount * ElemSize - 1);
+      if (last == '\0')
+        return CharPtrToString((char *)V.getPtr());
+    }
+
+    std::string result = "{ ";
+    for (unsigned Idx = 0, N = CAT->getZExtSize(); Idx < N; ++Idx) {
+      ValueRef InnerV = ValueRef(this, ElemTy.getAsOpaquePtr());
+      if (ElemTy->isBuiltinType()) {
+        // Single dim arrays, advancing.
+        uintptr_t offset = (uintptr_t)V.getPtr() + Idx * ElemSize;
+        InnerV.setData(*(long double *)offset);
+      } else {
+        // Multi dim arrays, position to the next dimension.
+        size_t Stride = ElemCount / N;
+        uintptr_t offset = ((uintptr_t)V.getPtr()) + Idx * Stride * ElemSize;
+        InnerV.setPtr((void *)offset);
+      }
+
+      result += ValueDataToString(InnerV);
+
+      // Skip the \0 if the char types
+      if (Idx < N - 1)
+        result += ", ";
+    }
+    result += " }";
+    return result;
+  }
+
+  QualType DesugaredTy = QT.getDesugaredType(Ctx);
+  QualType NonRefTy = DesugaredTy.getNonReferenceType();
+
+  // FIXME: Add support for user defined printers.
+  // LookupResult R = LookupUserDefined(S, QT);
+  // if (!R.empty())
+  //   return CallUserSpecifiedPrinter(R, V);
+
+  // If it is a builtin type dispatch to the builtin overloads.
+  if (auto *BT = DesugaredTy.getCanonicalType()->getAs<BuiltinType>()) {
+
+    auto formatFloating = [](auto val, char suffix = '\0') -> std::string {
+      std::string out;
+      llvm::raw_string_ostream ss(out);
+
+      if (std::isnan(val) || std::isinf(val)) {
+        ss << llvm::format("%g", val);
+        return ss.str();
+      }
+      if (val == static_cast<decltype(val)>(static_cast<int64_t>(val)))
+        ss << llvm::format("%.1f", val);
+      else if (std::abs(val) < 1e-4 || std::abs(val) > 1e6 || suffix == 'f')
+        ss << llvm::format("%#.6g", val);
+      else if (suffix == 'L')
+        ss << llvm::format("%#.12Lg", val);
+      else
+        ss << llvm::format("%#.8g", val);
+
+      if (suffix != '\0')
+        ss << suffix;
+      return ss.str();
+    };
+
+    std::string str;
+    llvm::raw_string_ostream ss(str);
+    switch (BT->getKind()) {
+    default:
+      return "{ error: unknown builtin type '" + std::to_string(BT->getKind()) +
+             " '}";
+    case clang::BuiltinType::Bool:
+      ss << ((V.getBool()) ? "true" : "false");
+      return str;
+    case clang::BuiltinType::Char_S:
+      ss << '\'' << V.getChar_S() << '\'';
+      return str;
+    case clang::BuiltinType::SChar:
+      ss << '\'' << V.getSChar() << '\'';
+      return str;
+    case clang::BuiltinType::Char_U:
+      ss << '\'' << V.getChar_U() << '\'';
+      return str;
+    case clang::Buil...
[truncated]

return CharPtrToString((char *)V.getPtr());
}

std::string result = "{ ";
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should take a pass over things and make sure identifiers meet the usual naming conventions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I addressed this.

The idea is to store a type-value pair in clang::Value which is updated by the
interpreter runtime. The class copies builtin types and boxes non-builtin types
to provide some lifetime control.

The patch enables default printers for C and C++ using a very minimalistic
approach. We handle enums, arrays and user types. Once we land this we can focus
on enabling user-defined pretty-printers which take control over printing of types

The work started as part of https://reviews.llvm.org/D146809, then we created
a giant in llvm#84769
Copy link

github-actions bot commented Jul 15, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

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

Precommit CI found some crashing issues that will need to be addressed, and I had some more testing requests to make sure we handle basics properly.

Comment on lines +33 to +40
float f = 4.2f; f
// CHECK-NEXT: (float) 4.20000f

double d = 4.21; d
// CHECK-NEXT: (double) 4.2100000

long double tau = 6.2831853; tau
// CHECK-NEXT: (long double) 6.28318530000L
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will these values be sensitive to the target architecture the test is run on? (I'm thinking about things like PPC double double or x87 long double.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I expect this to print long double however I might be proven wrong by the llvm buildbot jungle. We'll see :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I also expect it to print (long double) but what I was talking about was that I don't think 6.28318530000 is a value that all targets will print.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure how to address this comment at that point. Let's see if we will have some failures and figure out how to adjust to them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I expect this will fail in post-commit CI testing, so keep an eye on that when the changes land. But I don't think that blocks landing the changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. I am aiming to land this over the weekend to have time to meditate on these things :)

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +33 to +40
float f = 4.2f; f
// CHECK-NEXT: (float) 4.20000f

double d = 4.21; d
// CHECK-NEXT: (double) 4.2100000

long double tau = 6.2831853; tau
// CHECK-NEXT: (long double) 6.28318530000L
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I expect this will fail in post-commit CI testing, so keep an eye on that when the changes land. But I don't think that blocks landing the changes.

@vgvassilev vgvassilev merged commit 9bf7d04 into llvm:main Jul 19, 2025
9 checks passed
@vgvassilev vgvassilev deleted the D146809-mini branch July 19, 2025 06:25
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 19, 2025

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building clang at step 7 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
...
PASS: lld :: COFF/delayimports32.test (98699 of 101713)
PASS: lld :: COFF/arm64ec-lib.test (98700 of 101713)
PASS: lld :: COFF/cygwin-symbols.s (98701 of 101713)
PASS: lld :: COFF/combined-resources.test (98702 of 101713)
PASS: cfi-devirt-lld-x86_64 :: simple-fail.cpp (98703 of 101713)
PASS: lld :: COFF/arm64x-import.test (98704 of 101713)
PASS: lld :: COFF/def-export-cpp.s (98705 of 101713)
PASS: lld :: COFF/deploadflag-cfg-short.s (98706 of 101713)
PASS: lit :: shtest-external-shell-kill.py (98707 of 101713)
TIMEOUT: MLIR :: Examples/standalone/test.toy (98708 of 101713)
******************** TEST 'MLIR :: Examples/standalone/test.toy' FAILED ********************
Exit Code: 1
Timeout: Reached timeout of 60 seconds

Command Output (stdout):
--
# RUN: at line 1
"/etc/cmake/bin/cmake" "/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/examples/standalone" -G "Ninja"  -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang  -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir  -DLLVM_USE_LINKER=lld  -DPython3_EXECUTABLE="/usr/bin/python3.10"
# executed command: /etc/cmake/bin/cmake /build/buildbot/premerge-monolithic-linux/llvm-project/mlir/examples/standalone -G Ninja -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir -DLLVM_USE_LINKER=lld -DPython3_EXECUTABLE=/usr/bin/python3.10
# .---command stdout------------
# | -- The CXX compiler identification is Clang 16.0.6
# | -- The C compiler identification is Clang 16.0.6
# | -- Detecting CXX compiler ABI info
# | -- Detecting CXX compiler ABI info - done
# | -- Check for working CXX compiler: /usr/bin/clang++ - skipped
# | -- Detecting CXX compile features
# | -- Detecting CXX compile features - done
# | -- Detecting C compiler ABI info
# | -- Detecting C compiler ABI info - done
# | -- Check for working C compiler: /usr/bin/clang - skipped
# | -- Detecting C compile features
# | -- Detecting C compile features - done
# | -- Looking for histedit.h
# | -- Looking for histedit.h - found
# | -- Found LibEdit: /usr/include (found version "2.11") 
# | -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
# | -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.13") 
# | -- Using MLIRConfig.cmake in: /build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir
# | -- Using LLVMConfig.cmake in: /build/buildbot/premerge-monolithic-linux/build/lib/cmake/llvm
# | -- Linker detection: unknown
# | -- Performing Test LLVM_LIBSTDCXX_MIN
# | -- Performing Test LLVM_LIBSTDCXX_MIN - Success
# | -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
# | -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
# | -- Performing Test CXX_SUPPORTS_CUSTOM_LINKER
# | -- Performing Test CXX_SUPPORTS_CUSTOM_LINKER - Success
# | -- Performing Test C_SUPPORTS_FPIC
# | -- Performing Test C_SUPPORTS_FPIC - Success
# | -- Performing Test CXX_SUPPORTS_FPIC

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 19, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-fast running on sanitizer-buildbot4 while building clang at step 2 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 91369 tests, 88 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.
FAIL: LLVM :: ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s (58979 of 91369)
******************** TEST 'LLVM :: ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
rm -rf /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp && mkdir -p /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp # RUN: at line 1
+ rm -rf /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp
+ mkdir -p /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj    -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/Inputs/MachO_test_harness_test.s # RUN: at line 2
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/Inputs/MachO_test_harness_test.s
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj    -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s # RUN: at line 4
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s
not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec -check /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o     -harness /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o # RUN: at line 6
+ not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec -check /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o -harness /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o
llvm-jitlink error: Symbols not found: [ _unresolvable_external, _used_unresolved_external ]
libc++abi: Pure virtual function called!
error: Aborted

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.
FAIL: LLVM :: ExecutionEngine/JITLink/x86-64/COFF_directive_include.s (63241 of 91369)
******************** TEST 'LLVM :: ExecutionEngine/JITLink/x86-64/COFF_directive_include.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -filetype=obj -triple=x86_64-windows-msvc /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/COFF_directive_include.s -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/COFF_directive_include.s.tmp # RUN: at line 1
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -filetype=obj -triple=x86_64-windows-msvc /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/COFF_directive_include.s -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/COFF_directive_include.s.tmp
not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/COFF_directive_include.s.tmp 2>&1 | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/COFF_directive_include.s # RUN: at line 2
+ not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/COFF_directive_include.s.tmp
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/COFF_directive_include.s

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Step 10 (stage2/asan_ubsan check) failure: stage2/asan_ubsan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 91369 tests, 88 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.
FAIL: LLVM :: ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s (58979 of 91369)
******************** TEST 'LLVM :: ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
rm -rf /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp && mkdir -p /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp # RUN: at line 1
+ rm -rf /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp
+ mkdir -p /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj    -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/Inputs/MachO_test_harness_test.s # RUN: at line 2
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/Inputs/MachO_test_harness_test.s
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj    -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s # RUN: at line 4
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s
not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec -check /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o     -harness /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o # RUN: at line 6
+ not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec -check /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o -harness /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o
llvm-jitlink error: Symbols not found: [ _unresolvable_external, _used_unresolved_external ]
libc++abi: Pure virtual function called!
error: Aborted

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.
FAIL: LLVM :: ExecutionEngine/JITLink/x86-64/COFF_directive_include.s (63241 of 91369)
******************** TEST 'LLVM :: ExecutionEngine/JITLink/x86-64/COFF_directive_include.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -filetype=obj -triple=x86_64-windows-msvc /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/COFF_directive_include.s -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/COFF_directive_include.s.tmp # RUN: at line 1
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -filetype=obj -triple=x86_64-windows-msvc /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/COFF_directive_include.s -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/COFF_directive_include.s.tmp
not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/COFF_directive_include.s.tmp 2>&1 | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/COFF_directive_include.s # RUN: at line 2
+ not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/COFF_directive_include.s.tmp
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/COFF_directive_include.s

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Step 14 (stage2/msan check) failure: stage2/msan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 91367 tests, 88 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.
FAIL: Clang-Unit :: Interpreter/./ClangReplInterpreterTests/10/27 (13162 of 91367)
******************** TEST 'Clang-Unit :: Interpreter/./ClangReplInterpreterTests/10/27' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/clang/unittests/Interpreter/./ClangReplInterpreterTests-Clang-Unit-1861761-10-27.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=27 GTEST_SHARD_INDEX=10 /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/clang/unittests/Interpreter/./ClangReplInterpreterTests
--

Note: This is test shard 11 of 27.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from InterpreterTest
[ RUN      ] InterpreterTest.Value
 #0 0x000055555b353b92 ___interceptor_backtrace /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4497:13
 #1 0x000055555de09fe8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:13
 #2 0x000055555de07767 llvm::sys::RunSignalHandlers() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/Signals.cpp:0:5
 #3 0x000055555de0afe1 SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:426:38
 #4 0x000055555b386fee IsInInterceptorScope /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:77:10
 #5 0x000055555b386fee SignalAction(int, void*, void*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1137:3
 #6 0x00007ffff7a45250 (/lib/x86_64-linux-gnu/libc.so.6+0x45250)
 #7 0x00007ffff7aa3f1c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0xa3f1c)
 #8 0x00007ffff7a4519e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4519e)
 #9 0x00007ffff7a28902 abort (/lib/x86_64-linux-gnu/libc.so.6+0x28902)
#10 0x000055555b31581c (/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/clang/unittests/Interpreter/./ClangReplInterpreterTests+0x5dc181c)
#11 0x000055555b31422e __sanitizer::Die() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:52:5
#12 0x000055555b3275a3 (/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/clang/unittests/Interpreter/./ClangReplInterpreterTests+0x5dd35a3)
#13 0x000055555e965f1c clang::Interpreter::ValueDataToString(clang::Value const&) const /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:270:10
#14 0x000055555e96daff clang::Value::printData(llvm::raw_ostream&) const /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/Interpreter/Value.cpp:261:7
#15 0x000055555b3b0c99 (anonymous namespace)::InterpreterTest_Value_Test::TestBody() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/unittests/Interpreter/InterpreterTest.cpp:0:7
#16 0x000055555de5a884 testing::Test::Run() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:2695:9
#17 0x000055555de5b57f testing::TestInfo::Run() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:2840:12
#18 0x000055555de5c406 testing::TestSuite::Run() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:3018:35
#19 0x000055555de6ac66 testing::internal::UnitTestImpl::RunAllTests() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:5922:15
#20 0x000055555de6a5a2 testing::UnitTest::Run() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/third-party/unittest/googletest/src/gtest.cc:5485:10
#21 0x000055555de44459 main /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/third-party/unittest/UnitTestMain/TestMain.cpp:55:3
#22 0x00007ffff7a2a3b8 (/lib/x86_64-linux-gnu/libc.so.6+0x2a3b8)
#23 0x00007ffff7a2a47b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a47b)
#24 0x000055555b308e25 _start (/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/clang/unittests/Interpreter/./ClangReplInterpreterTests+0x5db4e25)

--

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 19, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-bootstrap-msan running on sanitizer-buildbot6 while building clang at step 2 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 91367 tests, 88 workers --
Testing:  0.. 10
FAIL: Clang :: Interpreter/pretty-print.c (14083 of 91367)
******************** TEST 'Clang :: Interpreter/pretty-print.c' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
cat /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c | /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl -Xcc -xc  | /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c # RUN: at line 3
+ cat /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl -Xcc -xc
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c
 #0 0x000055555b1bd222 ___interceptor_backtrace /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4530:13
 #1 0x0000555560ad7a0f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:13
 #2 0x0000555560ad0a98 llvm::sys::RunSignalHandlers() /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:0:5
 #3 0x0000555560ad9eda SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:426:38
 #4 0x000055555b1f0e6e IsInInterceptorScope /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:78:10
 #5 0x000055555b1f0e6e SignalAction(int, void*, void*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1167:3
 #6 0x00007ffff7a45250 (/lib/x86_64-linux-gnu/libc.so.6+0x45250)
 #7 0x00007ffff7aa3f1c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0xa3f1c)
 #8 0x00007ffff7a4519e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4519e)
 #9 0x00007ffff7a28902 abort (/lib/x86_64-linux-gnu/libc.so.6+0x28902)
#10 0x000055555b17eb4c (/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl+0x5c2ab4c)
#11 0x000055555b17d5de __sanitizer::Die() /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:52:5
#12 0x000055555b190a23 (/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl+0x5c3ca23)
#13 0x0000555562686026 operator<< /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/raw_ostream.h:285:18
#14 0x0000555562686026 clang::Interpreter::ValueDataToString(clang::Value const&) const /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:288:10
#15 0x0000555562744ba3 __is_long /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:2085:23
#16 0x0000555562744ba3 __get_pointer /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:2226:12
#17 0x0000555562744ba3 data /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:1760:30
#18 0x0000555562744ba3 operator<< /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/raw_ostream.h:263:22
#19 0x0000555562744ba3 printData /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:261:7
#20 0x0000555562744ba3 clang::Value::print(llvm::raw_ostream&) const /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:280:3
#21 0x000055556265dc8d clang::Interpreter::ParseAndExecute(llvm::StringRef, clang::Value*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:725:17
#22 0x000055555b208cc2 getPtr /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:278:42
#23 0x000055555b208cc2 operator bool /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:241:16
#24 0x000055555b208cc2 main /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/tools/clang-repl/ClangRepl.cpp:376:23
#25 0x00007ffff7a2a3b8 (/lib/x86_64-linux-gnu/libc.so.6+0x2a3b8)
#26 0x00007ffff7a2a47b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a47b)
#27 0x000055555b171de5 _start (/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl+0x5c1dde5)
FileCheck error: '<stdin>' is empty.
Step 11 (stage2/msan check) failure: stage2/msan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 91367 tests, 88 workers --
Testing:  0.. 10
FAIL: Clang :: Interpreter/pretty-print.c (14083 of 91367)
******************** TEST 'Clang :: Interpreter/pretty-print.c' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
cat /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c | /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl -Xcc -xc  | /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c # RUN: at line 3
+ cat /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl -Xcc -xc
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c
 #0 0x000055555b1bd222 ___interceptor_backtrace /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4530:13
 #1 0x0000555560ad7a0f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:13
 #2 0x0000555560ad0a98 llvm::sys::RunSignalHandlers() /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:0:5
 #3 0x0000555560ad9eda SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:426:38
 #4 0x000055555b1f0e6e IsInInterceptorScope /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:78:10
 #5 0x000055555b1f0e6e SignalAction(int, void*, void*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1167:3
 #6 0x00007ffff7a45250 (/lib/x86_64-linux-gnu/libc.so.6+0x45250)
 #7 0x00007ffff7aa3f1c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0xa3f1c)
 #8 0x00007ffff7a4519e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4519e)
 #9 0x00007ffff7a28902 abort (/lib/x86_64-linux-gnu/libc.so.6+0x28902)
#10 0x000055555b17eb4c (/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl+0x5c2ab4c)
#11 0x000055555b17d5de __sanitizer::Die() /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:52:5
#12 0x000055555b190a23 (/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl+0x5c3ca23)
#13 0x0000555562686026 operator<< /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/raw_ostream.h:285:18
#14 0x0000555562686026 clang::Interpreter::ValueDataToString(clang::Value const&) const /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:288:10
#15 0x0000555562744ba3 __is_long /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:2085:23
#16 0x0000555562744ba3 __get_pointer /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:2226:12
#17 0x0000555562744ba3 data /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:1760:30
#18 0x0000555562744ba3 operator<< /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/raw_ostream.h:263:22
#19 0x0000555562744ba3 printData /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:261:7
#20 0x0000555562744ba3 clang::Value::print(llvm::raw_ostream&) const /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:280:3
#21 0x000055556265dc8d clang::Interpreter::ParseAndExecute(llvm::StringRef, clang::Value*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:725:17
#22 0x000055555b208cc2 getPtr /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:278:42
#23 0x000055555b208cc2 operator bool /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:241:16
#24 0x000055555b208cc2 main /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/tools/clang-repl/ClangRepl.cpp:376:23
#25 0x00007ffff7a2a3b8 (/lib/x86_64-linux-gnu/libc.so.6+0x2a3b8)
#26 0x00007ffff7a2a47b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a47b)
#27 0x000055555b171de5 _start (/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl+0x5c1dde5)
FileCheck error: '<stdin>' is empty.
Step 16 (stage2/msan_track_origins check) failure: stage2/msan_track_origins check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 91367 tests, 88 workers --
Testing:  0.. 10
FAIL: Clang :: Interpreter/pretty-print.c (13976 of 91367)
******************** TEST 'Clang :: Interpreter/pretty-print.c' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
cat /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c | /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/clang-repl -Xcc -xc  | /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c # RUN: at line 3
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/FileCheck /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c
+ cat /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.c
+ /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/clang-repl -Xcc -xc
 #0 0x000056f88f6dcfe2 ___interceptor_backtrace /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4530:13
 #1 0x000056f89795410f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:834:13
 #2 0x000056f89794a668 llvm::sys::RunSignalHandlers() /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:0:5
 #3 0x000056f8979572b9 SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:426:38
 #4 0x000056f88f710c2e IsInInterceptorScope /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:78:10
 #5 0x000056f88f710c2e SignalAction(int, void*, void*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1167:3
 #6 0x000076ea80645250 (/lib/x86_64-linux-gnu/libc.so.6+0x45250)
 #7 0x000076ea806a3f1c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0xa3f1c)
 #8 0x000076ea8064519e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4519e)
 #9 0x000076ea80628902 abort (/lib/x86_64-linux-gnu/libc.so.6+0x28902)
#10 0x000056f88f69e90c (/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/clang-repl+0x620590c)
#11 0x000056f88f69d39e __sanitizer::Die() /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:52:5
#12 0x000056f88f6b0863 (/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/clang-repl+0x6217863)
#13 0x000056f89a1af497 getUShort /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Interpreter/Value.h:148:3
#14 0x000056f89a1af497 clang::Interpreter::ValueDataToString(clang::Value const&) const /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:288:15
#15 0x000056f89a2d09dd __is_long /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan_track_origins/include/c++/v1/string:2085:23
#16 0x000056f89a2d09dd __get_pointer /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan_track_origins/include/c++/v1/string:2226:12
#17 0x000056f89a2d09dd data /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan_track_origins/include/c++/v1/string:1760:30
#18 0x000056f89a2d09dd operator<< /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/raw_ostream.h:263:22
#19 0x000056f89a2d09dd printData /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:261:7
#20 0x000056f89a2d09dd clang::Value::print(llvm::raw_ostream&) const /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:280:3
#21 0x000056f89a16a66f clang::Interpreter::ParseAndExecute(llvm::StringRef, clang::Value*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:725:17
#22 0x000056f88f72bcb1 getPtr /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:278:42
#23 0x000056f88f72bcb1 operator bool /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:241:16
#24 0x000056f88f72bcb1 main /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/tools/clang-repl/ClangRepl.cpp:376:23
#25 0x000076ea8062a3b8 (/lib/x86_64-linux-gnu/libc.so.6+0x2a3b8)
#26 0x000076ea8062a47b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a47b)
#27 0x000056f88f691ba5 _start (/home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/clang-repl+0x61f8ba5)
FileCheck error: '<stdin>' is empty.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 19, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-aarch64-linux-bootstrap-msan running on sanitizer-buildbot9 while building clang at step 2 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89214 tests, 72 workers --
Testing:  0.. 10
FAIL: Clang :: Interpreter/pretty-print.cpp (13986 of 89214)
******************** TEST 'Clang :: Interpreter/pretty-print.cpp' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);'             'auto r1 = printf("i = %d\n", i);' | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck --check-prefix=CHECK-DRIVER /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp # RUN: at line 1
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl 'int i = 10;' 'extern "C" int printf(const char*,...);' 'auto r1 = printf("i = %d\n", i);'
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck --check-prefix=CHECK-DRIVER /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp
cat /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp # RUN: at line 5
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing
+ cat /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp
 #0 0x0000aaaab08c5d6c ___interceptor_backtrace /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4530:13
 #1 0x0000aaaab53b8fa8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:838:7
 #2 0x0000aaaab53b33b4 llvm::sys::RunSignalHandlers() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:105:18
 #3 0x0000aaaab53bac44 SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:426:38
 #4 0x0000aaaab08f7ed8 IsInInterceptorScope /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:78:10
 #5 0x0000aaaab08f7ed8 SignalAction(int, void*, void*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1167:3
 #6 0x0000fffff7ffb8f8 (linux-vdso.so.1+0x8f8)
 #7 0x0000fffff7a87608 (/lib/aarch64-linux-gnu/libc.so.6+0x87608)
 #8 0x0000fffff7a3cb3c raise (/lib/aarch64-linux-gnu/libc.so.6+0x3cb3c)
 #9 0x0000fffff7a27e00 abort (/lib/aarch64-linux-gnu/libc.so.6+0x27e00)
#10 0x0000aaaab0888a48 __sanitizer::Atexit(void (*)()) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp:168:10
#11 0x0000aaaab088743c __sanitizer::Die() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:52:5
#12 0x0000aaaab0899010 __msan_warning_with_origin /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan.cpp:455:0
#13 0x0000aaaab6c7ac6c SkipToNextDecl /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/DeclBase.h:2407:23
#14 0x0000aaaab6c7ac6c specific_decl_iterator /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/DeclBase.h:2432:7
#15 0x0000aaaab6c7ac6c enumerator_begin /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/Decl.h:4124:12
#16 0x0000aaaab6c7ac6c EnumToString /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:113:21
#17 0x0000aaaab6c7ac6c clang::Interpreter::ValueDataToString(clang::Value const&) const /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:327:12
#18 0x0000aaaab6d1faa4 size /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:1270:12
#19 0x0000aaaab6d1faa4 length /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:1272:99
#20 0x0000aaaab6d1faa4 operator<< /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/raw_ostream.h:263:34
#21 0x0000aaaab6d1faa4 printData /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:261:7
#22 0x0000aaaab6d1faa4 clang::Value::print(llvm::raw_ostream&) const /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:280:3
#23 0x0000aaaab6c5b1c8 clang::Interpreter::ParseAndExecute(llvm::StringRef, clang::Value*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:725:17
#24 0x0000aaaab090e334 getPtr /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:278:42
#25 0x0000aaaab090e334 operator bool /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:241:16
Step 11 (stage2/msan check) failure: stage2/msan check (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89214 tests, 72 workers --
Testing:  0.. 10
FAIL: Clang :: Interpreter/pretty-print.cpp (13986 of 89214)
******************** TEST 'Clang :: Interpreter/pretty-print.cpp' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);'             'auto r1 = printf("i = %d\n", i);' | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck --check-prefix=CHECK-DRIVER /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp # RUN: at line 1
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl 'int i = 10;' 'extern "C" int printf(const char*,...);' 'auto r1 = printf("i = %d\n", i);'
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck --check-prefix=CHECK-DRIVER /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp
cat /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp # RUN: at line 5
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing
+ cat /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp
 #0 0x0000aaaab08c5d6c ___interceptor_backtrace /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4530:13
 #1 0x0000aaaab53b8fa8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:838:7
 #2 0x0000aaaab53b33b4 llvm::sys::RunSignalHandlers() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:105:18
 #3 0x0000aaaab53bac44 SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:426:38
 #4 0x0000aaaab08f7ed8 IsInInterceptorScope /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:78:10
 #5 0x0000aaaab08f7ed8 SignalAction(int, void*, void*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1167:3
 #6 0x0000fffff7ffb8f8 (linux-vdso.so.1+0x8f8)
 #7 0x0000fffff7a87608 (/lib/aarch64-linux-gnu/libc.so.6+0x87608)
 #8 0x0000fffff7a3cb3c raise (/lib/aarch64-linux-gnu/libc.so.6+0x3cb3c)
 #9 0x0000fffff7a27e00 abort (/lib/aarch64-linux-gnu/libc.so.6+0x27e00)
#10 0x0000aaaab0888a48 __sanitizer::Atexit(void (*)()) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp:168:10
#11 0x0000aaaab088743c __sanitizer::Die() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:52:5
#12 0x0000aaaab0899010 __msan_warning_with_origin /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan.cpp:455:0
#13 0x0000aaaab6c7ac6c SkipToNextDecl /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/DeclBase.h:2407:23
#14 0x0000aaaab6c7ac6c specific_decl_iterator /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/DeclBase.h:2432:7
#15 0x0000aaaab6c7ac6c enumerator_begin /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/Decl.h:4124:12
#16 0x0000aaaab6c7ac6c EnumToString /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:113:21
#17 0x0000aaaab6c7ac6c clang::Interpreter::ValueDataToString(clang::Value const&) const /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:327:12
#18 0x0000aaaab6d1faa4 size /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:1270:12
#19 0x0000aaaab6d1faa4 length /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/libcxx_install_msan/include/c++/v1/string:1272:99
#20 0x0000aaaab6d1faa4 operator<< /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/raw_ostream.h:263:34
#21 0x0000aaaab6d1faa4 printData /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:261:7
#22 0x0000aaaab6d1faa4 clang::Value::print(llvm::raw_ostream&) const /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:280:3
#23 0x0000aaaab6c5b1c8 clang::Interpreter::ParseAndExecute(llvm::StringRef, clang::Value*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:725:17
#24 0x0000aaaab090e334 getPtr /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:278:42
#25 0x0000aaaab090e334 operator bool /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:241:16
Step 16 (stage2/msan_track_origins check) failure: stage2/msan_track_origins check (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89214 tests, 72 workers --
Testing:  0.. 10
FAIL: Clang :: Interpreter/pretty-print.cpp (13934 of 89214)
******************** TEST 'Clang :: Interpreter/pretty-print.cpp' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);'             'auto r1 = printf("i = %d\n", i);' | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/FileCheck --check-prefix=CHECK-DRIVER /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp # RUN: at line 1
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/clang-repl 'int i = 10;' 'extern "C" int printf(const char*,...);' 'auto r1 = printf("i = %d\n", i);'
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/FileCheck --check-prefix=CHECK-DRIVER /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp
cat /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp # RUN: at line 5
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing
+ cat /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/test/Interpreter/pretty-print.cpp
 #0 0x0000aaaab0f31fec ___interceptor_backtrace /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4530:13
 #1 0x0000aaaab777cbb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:838:7
 #2 0x0000aaaab7774f60 llvm::sys::RunSignalHandlers() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:105:18
 #3 0x0000aaaab777f1ac SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:426:38
 #4 0x0000aaaab0f64158 IsInInterceptorScope /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:78:10
 #5 0x0000aaaab0f64158 SignalAction(int, void*, void*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1167:3
 #6 0x0000fffff7ffb8f8 (linux-vdso.so.1+0x8f8)
 #7 0x0000fffff79e7608 (/lib/aarch64-linux-gnu/libc.so.6+0x87608)
 #8 0x0000fffff799cb3c raise (/lib/aarch64-linux-gnu/libc.so.6+0x3cb3c)
 #9 0x0000fffff7987e00 abort (/lib/aarch64-linux-gnu/libc.so.6+0x27e00)
#10 0x0000aaaab0ef4cc8 __sanitizer::Atexit(void (*)()) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp:168:10
#11 0x0000aaaab0ef36bc __sanitizer::Die() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:52:5
#12 0x0000aaaab0f05328 __msan_init /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan.cpp:490:0
#13 0x0000aaaab9a7b540 SkipToNextDecl /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/DeclBase.h:2407:23
#14 0x0000aaaab9a7b540 specific_decl_iterator /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/DeclBase.h:2432:7
#15 0x0000aaaab9a7b540 enumerator_begin /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/Decl.h:4124:12
#16 0x0000aaaab9a7b540 EnumToString /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:113:21
#17 0x0000aaaab9a7b540 clang::Interpreter::ValueDataToString(clang::Value const&) const /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/InterpreterValuePrinter.cpp:327:12
#18 0x0000aaaab9b6d654 __get_pointer /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/libcxx_install_msan_track_origins/include/c++/v1/string:2226:12
#19 0x0000aaaab9b6d654 data /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/libcxx_install_msan_track_origins/include/c++/v1/string:1760:30
#20 0x0000aaaab9b6d654 operator<< /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/raw_ostream.h:263:22
#21 0x0000aaaab9b6d654 printData /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:261:7
#22 0x0000aaaab9b6d654 clang::Value::print(llvm::raw_ostream&) const /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Value.cpp:280:3
#23 0x0000aaaab9a47d40 clang::Interpreter::ParseAndExecute(llvm::StringRef, clang::Value*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/clang/lib/Interpreter/Interpreter.cpp:725:17
#24 0x0000aaaab0f7cb90 getPtr /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:278:42
#25 0x0000aaaab0f7cb90 operator bool /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Error.h:241:16

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 19, 2025

LLVM Buildbot has detected a new failure on builder clang-s390x-linux running on systemz-1 while building clang at step 5 "ninja check 1".

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

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Clang :: Interpreter/pretty-print.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/bin/clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);'             'auto r1 = printf("i = %d\n", i);' | /home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/bin/FileCheck --check-prefix=CHECK-DRIVER /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/clang/test/Interpreter/pretty-print.cpp # RUN: at line 1
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/bin/clang-repl 'int i = 10;' 'extern "C" int printf(const char*,...);' 'auto r1 = printf("i = %d\n", i);'
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/bin/FileCheck --check-prefix=CHECK-DRIVER /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/clang/test/Interpreter/pretty-print.cpp
cat /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/clang/test/Interpreter/pretty-print.cpp | /home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing | /home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/bin/FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/clang/test/Interpreter/pretty-print.cpp # RUN: at line 5
+ cat /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/clang/test/Interpreter/pretty-print.cpp
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/bin/FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/clang/test/Interpreter/pretty-print.cpp
/home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/clang/test/Interpreter/pretty-print.cpp:33:16: error: CHECK-NEXT: expected string not found in input
// CHECK-NEXT: (Enum) (e2) : int -11
               ^
<stdin>:7:20: note: scanning from here
(S4) @0x2aa1929ba70
                   ^
<stdin>:8:1: note: possible intended match here
(Enum) : int -1796534384
^

Input file: <stdin>
Check file: /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/clang/test/Interpreter/pretty-print.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: (const char[3]) "ab" 
           2: (char[2]) { '1', 'a' } 
           3: (char[3]) "1a" 
           4: (char[2][3][1]) { { { 'a' }, { 'b' }, { 'c' } }, { { 'd' }, { 'e' }, { 'f' } } } 
           5: (S3) @0x2aa192c48e0 
           6: (S3 &) @0x3ff94da4000 
           7: (S4) @0x2aa1929ba70 
next:33'0                        X error: no match found
           8: (Enum) : int -1796534384 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
next:33'1     ?                         possible intended match
           9: (Enum) : int -1796534384 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          10: (Color) : int -1796534384 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
          11: ((lambda) &) @0x3ff94af8000 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          12: ((lambda at input_line_46:1:1)) @0x2aa192ced80 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          13: (F<7>::(unnamed enum at input_line_49:1:27)) : unsigned int 2498432912 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 19, 2025

LLVM Buildbot has detected a new failure on builder clang-s390x-linux-lnt running on systemz-1 while building clang at step 7 "ninja check 1".

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

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Clang :: Interpreter/pretty-print.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/bin/clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);'             'auto r1 = printf("i = %d\n", i);' | /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/bin/FileCheck --check-prefix=CHECK-DRIVER /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/clang/test/Interpreter/pretty-print.cpp # RUN: at line 1
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/bin/clang-repl 'int i = 10;' 'extern "C" int printf(const char*,...);' 'auto r1 = printf("i = %d\n", i);'
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/bin/FileCheck --check-prefix=CHECK-DRIVER /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/clang/test/Interpreter/pretty-print.cpp
cat /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/clang/test/Interpreter/pretty-print.cpp | /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing | /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/bin/FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/clang/test/Interpreter/pretty-print.cpp # RUN: at line 5
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/bin/clang-repl -Xcc -std=c++11 -Xcc -fno-delayed-template-parsing
+ cat /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/clang/test/Interpreter/pretty-print.cpp
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/bin/FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/clang/test/Interpreter/pretty-print.cpp
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/clang/test/Interpreter/pretty-print.cpp:33:16: error: CHECK-NEXT: expected string not found in input
// CHECK-NEXT: (Enum) (e2) : int -11
               ^
<stdin>:7:20: note: scanning from here
(S4) @0x2aa2b0841b0
                   ^
<stdin>:8:1: note: possible intended match here
(Enum) : int -1088745584
^

Input file: <stdin>
Check file: /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/clang/test/Interpreter/pretty-print.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: (const char[3]) "ab" 
           2: (char[2]) { '1', 'a' } 
           3: (char[3]) "1a" 
           4: (char[2][3][1]) { { { 'a' }, { 'b' }, { 'c' } }, { { 'd' }, { 'e' }, { 'f' } } } 
           5: (S3) @0x2aa2b085bf0 
           6: (S3 &) @0x3ffbf0a4000 
           7: (S4) @0x2aa2b0841b0 
next:33'0                        X error: no match found
           8: (Enum) : int -1088745584 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
next:33'1     ?                         possible intended match
           9: (Enum) : int -1088745584 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          10: (Color) : int -1088745584 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
          11: ((lambda) &) @0x3ffbedf8000 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          12: ((lambda at input_line_46:1:1)) @0x2aa2b049c50 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          13: (F<7>::(unnamed enum at input_line_49:1:27)) : unsigned int 3206221712 
next:33'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

@vgvassilev
Copy link
Contributor Author

Working on understanding the issues...

vgvassilev added a commit that referenced this pull request Jul 19, 2025
This change is a follow-up of #148701 where clang-s390x-linux
and clang-s390x-linux-lnt failed.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 19, 2025
This change is a follow-up of llvm/llvm-project#148701 where clang-s390x-linux
and clang-s390x-linux-lnt failed.
@vgvassilev
Copy link
Contributor Author

I added a fix for the system-z, however, I believe I still a maintainer to confirm this is not a big-endian related issue.

I realize I do not understand the sanitizer failures. I ran the tests with valgrind and it seems happy with it. @vitalybuka what should I do here?

vgvassilev added a commit that referenced this pull request Jul 19, 2025
While waiting for the bot owners it seems that this is not a major issue due
to the big endianness of the systemz platform. Instead it looks like we are not
modelling something well for enum types. Probably `va_arg` has a bug for that
platform or similar.

The asan failure seems to be a crash in asan and maybe related to the issues
we've mentioned in #102858.

This patch should appease the bots that were broken by #148701
@vgvassilev
Copy link
Contributor Author

0a463bd should bring piece in the galaxy.

However, I am puzzled by the system-z (s390) -- it is a big endian -- it is a good test bed for the conformance for low-level primitives such as clang::Value which this patch touched. However, the issue seems to be only for enum types (int and other types are printed well which seems to show that the implementation is independent on the endianness).

For enums of an int type we go through this code:

case BuiltinType::Int:
VRef.setInt(va_arg(args, int));
break;

Perhaps there is some bug in handling variadic arguments on that platform. I do not have access to a big-endian platform to verify my guess. Last time I tried alpine + qemu to emulate a big-endian platform it was unusable for a large project such as llvm.

I still need a clarification on the asan failure and until then I've taken the liberty to disable the test so that we don't regress the codebase.

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 19, 2025
While waiting for the bot owners it seems that this is not a major issue due
to the big endianness of the systemz platform. Instead it looks like we are not
modelling something well for enum types. Probably `va_arg` has a bug for that
platform or similar.

The asan failure seems to be a crash in asan and maybe related to the issues
we've mentioned in llvm/llvm-project#102858.

This patch should appease the bots that were broken by llvm/llvm-project#148701
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants