Skip to content

[CIR] Add PointerLikeType interface support for cir::PointerType #139768

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 3 commits into from
May 15, 2025

Conversation

andykaylor
Copy link
Contributor

This adds code to attach the OpenACC PointerLikeType interface to cir::PointerType, along with a unit test for the interface.

This adds code to attach the OpenACC PointerLikeType interface to
cir::PointerType, along with a unit test for the interface.
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels May 13, 2025
@llvmbot
Copy link
Member

llvmbot commented May 13, 2025

@llvm/pr-subscribers-clang

Author: Andy Kaylor (andykaylor)

Changes

This adds code to attach the OpenACC PointerLikeType interface to cir::PointerType, along with a unit test for the interface.


Full diff: https://github.com/llvm/llvm-project/pull/139768.diff

11 Files Affected:

  • (added) clang/include/clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h (+36)
  • (added) clang/include/clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h (+22)
  • (modified) clang/lib/CIR/CodeGen/CIRGenerator.cpp (+7)
  • (modified) clang/lib/CIR/CodeGen/CMakeLists.txt (+1)
  • (modified) clang/lib/CIR/Dialect/CMakeLists.txt (+1)
  • (added) clang/lib/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.cpp (+41)
  • (added) clang/lib/CIR/Dialect/OpenACC/CMakeLists.txt (+10)
  • (added) clang/lib/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.cpp (+27)
  • (added) clang/unittests/CIR/CMakeLists.txt (+11)
  • (added) clang/unittests/CIR/PointerLikeTest.cpp (+160)
  • (modified) clang/unittests/CMakeLists.txt (+10-1)
diff --git a/clang/include/clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h b/clang/include/clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h
new file mode 100644
index 0000000000000..eccb6838a491f
--- /dev/null
+++ b/clang/include/clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains external dialect interfaces for CIR.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_CIR_DIALECT_OPENACC_CIROPENACCTYPEINTERFACES_H
+#define CLANG_CIR_DIALECT_OPENACC_CIROPENACCTYPEINTERFACES_H
+
+#include "mlir/Dialect/OpenACC/OpenACC.h"
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
+
+namespace cir::acc {
+
+template <typename T>
+struct OpenACCPointerLikeModel
+    : public mlir::acc::PointerLikeType::ExternalModel<
+          OpenACCPointerLikeModel<T>, T> {
+  mlir::Type getElementType(mlir::Type pointer) const {
+    return mlir::cast<T>(pointer).getPointee();
+  }
+  mlir::acc::VariableTypeCategory
+  getPointeeTypeCategory(mlir::Type pointer,
+                         mlir::TypedValue<mlir::acc::PointerLikeType> varPtr,
+                         mlir::Type varType) const;
+};
+
+} // namespace cir::acc
+
+#endif // CLANG_CIR_DIALECT_OPENACC_CIROPENACCTYPEINTERFACES_H
diff --git a/clang/include/clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h b/clang/include/clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h
new file mode 100644
index 0000000000000..13780a01ea1bb
--- /dev/null
+++ b/clang/include/clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_CIR_DIALECT_OPENACC_REGISTEROPENACCEXTENSIONS_H
+#define CLANG_CIR_DIALECT_OPENACC_REGISTEROPENACCEXTENSIONS_H
+
+namespace mlir {
+class DialectRegistry;
+} // namespace mlir
+
+namespace cir::acc {
+
+void registerOpenACCExtensions(mlir::DialectRegistry &registry);
+
+} // namespace cir::acc
+
+#endif // CLANG_CIR_DIALECT_OPENACC_REGISTEROPENACCEXTENSIONS_H
diff --git a/clang/lib/CIR/CodeGen/CIRGenerator.cpp b/clang/lib/CIR/CodeGen/CIRGenerator.cpp
index aa3864deb733c..40252ffecfba1 100644
--- a/clang/lib/CIR/CodeGen/CIRGenerator.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenerator.cpp
@@ -18,6 +18,7 @@
 #include "clang/AST/DeclGroup.h"
 #include "clang/CIR/CIRGenerator.h"
 #include "clang/CIR/Dialect/IR/CIRDialect.h"
+#include "clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h"
 
 using namespace cir;
 using namespace clang;
@@ -38,6 +39,12 @@ void CIRGenerator::Initialize(ASTContext &astContext) {
   mlirContext = std::make_unique<mlir::MLIRContext>();
   mlirContext->loadDialect<cir::CIRDialect>();
   mlirContext->getOrLoadDialect<mlir::acc::OpenACCDialect>();
+
+  // Register extensions to integrate CIR types with OpenACC.
+  mlir::DialectRegistry registry;
+  cir::acc::registerOpenACCExtensions(registry);
+  mlirContext->appendDialectRegistry(registry);
+
   cgm = std::make_unique<clang::CIRGen::CIRGenModule>(
       *mlirContext.get(), astContext, codeGenOpts, diags);
 }
diff --git a/clang/lib/CIR/CodeGen/CMakeLists.txt b/clang/lib/CIR/CodeGen/CMakeLists.txt
index 7a701c3c0b82b..8f5796e59d3bb 100644
--- a/clang/lib/CIR/CodeGen/CMakeLists.txt
+++ b/clang/lib/CIR/CodeGen/CMakeLists.txt
@@ -35,6 +35,7 @@ add_clang_library(clangCIR
   clangBasic
   clangLex
   ${dialect_libs}
+  CIROpenACCSupport
   MLIRCIR
   MLIRCIRInterfaces
 )
diff --git a/clang/lib/CIR/Dialect/CMakeLists.txt b/clang/lib/CIR/Dialect/CMakeLists.txt
index 9f57627c321fb..c825a61b2779b 100644
--- a/clang/lib/CIR/Dialect/CMakeLists.txt
+++ b/clang/lib/CIR/Dialect/CMakeLists.txt
@@ -1,2 +1,3 @@
 add_subdirectory(IR)
+add_subdirectory(OpenACC)
 add_subdirectory(Transforms)
diff --git a/clang/lib/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.cpp b/clang/lib/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.cpp
new file mode 100644
index 0000000000000..ea563ecdfb3bb
--- /dev/null
+++ b/clang/lib/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Implementation of external dialect interfaces for CIR.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h"
+
+namespace cir::acc {
+
+template <>
+mlir::acc::VariableTypeCategory
+OpenACCPointerLikeModel<cir::PointerType>::getPointeeTypeCategory(
+    mlir::Type pointer, mlir::TypedValue<mlir::acc::PointerLikeType> varPtr,
+    mlir::Type varType) const {
+  mlir::Type eleTy = mlir::cast<cir::PointerType>(pointer).getPointee();
+
+  if (auto mappableTy = mlir::dyn_cast<mlir::acc::MappableType>(eleTy))
+    return mappableTy.getTypeCategory(varPtr);
+
+  if (isAnyIntegerOrFloatingPointType(eleTy) ||
+      mlir::isa<cir::BoolType>(eleTy) || mlir::isa<cir::PointerType>(eleTy))
+    return mlir::acc::VariableTypeCategory::scalar;
+  if (mlir::isa<cir::ArrayType>(eleTy))
+    return mlir::acc::VariableTypeCategory::array;
+  if (mlir::isa<cir::RecordType>(eleTy))
+    return mlir::acc::VariableTypeCategory::composite;
+  if (mlir::isa<cir::FuncType>(eleTy) || mlir::isa<cir::VectorType>(eleTy))
+    return mlir::acc::VariableTypeCategory::nonscalar;
+
+  // Without further checking, this type cannot be categorized.
+  return mlir::acc::VariableTypeCategory::uncategorized;
+}
+
+} // namespace cir::acc
diff --git a/clang/lib/CIR/Dialect/OpenACC/CMakeLists.txt b/clang/lib/CIR/Dialect/OpenACC/CMakeLists.txt
new file mode 100644
index 0000000000000..5b0a1620a1bff
--- /dev/null
+++ b/clang/lib/CIR/Dialect/OpenACC/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_clang_library(CIROpenACCSupport
+  CIROpenACCTypeInterfaces.cpp
+  RegisterOpenACCExtensions.cpp
+
+  DEPENDS
+  MLIRCIRTypeConstraintsIncGen
+
+  LINK_LIBS PUBLIC
+  MLIRIR
+  )
diff --git a/clang/lib/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.cpp b/clang/lib/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.cpp
new file mode 100644
index 0000000000000..3dfe7aeb6b1d6
--- /dev/null
+++ b/clang/lib/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Registration for OpenACC extensions as applied to CIR dialect.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h"
+#include "clang/CIR/Dialect/IR/CIRDialect.h"
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
+#include "clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h"
+
+namespace cir::acc {
+
+void registerOpenACCExtensions(mlir::DialectRegistry &registry) {
+  registry.addExtension(+[](mlir::MLIRContext *ctx, cir::CIRDialect *dialect) {
+    cir::PointerType::attachInterface<
+        OpenACCPointerLikeModel<cir::PointerType>>(*ctx);
+  });
+}
+
+} // namespace cir::acc
diff --git a/clang/unittests/CIR/CMakeLists.txt b/clang/unittests/CIR/CMakeLists.txt
new file mode 100644
index 0000000000000..171201b7beb23
--- /dev/null
+++ b/clang/unittests/CIR/CMakeLists.txt
@@ -0,0 +1,11 @@
+add_clang_unittest(CIRUnitTests
+  PointerLikeTest.cpp
+  LLVM_COMPONENTS
+  Core
+
+  LINK_LIBS
+  MLIRCIR
+  CIROpenACCSupport
+  MLIRIR
+  MLIROpenACCDialect
+  )
diff --git a/clang/unittests/CIR/PointerLikeTest.cpp b/clang/unittests/CIR/PointerLikeTest.cpp
new file mode 100644
index 0000000000000..af8f32d237e71
--- /dev/null
+++ b/clang/unittests/CIR/PointerLikeTest.cpp
@@ -0,0 +1,160 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Unit tests for CIR implementation of OpenACC's PointertLikeType interface
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/OpenACC/OpenACC.h"
+#include "mlir/IR/BuiltinTypes.h"
+#include "mlir/IR/Diagnostics.h"
+#include "mlir/IR/MLIRContext.h"
+#include "mlir/IR/Value.h"
+#include "clang/CIR/Dialect/Builder/CIRBaseBuilder.h"
+#include "clang/CIR/Dialect/IR/CIRDialect.h"
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
+#include "clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h"
+#include "clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h"
+#include "gtest/gtest.h"
+
+using namespace mlir;
+using namespace cir;
+
+//===----------------------------------------------------------------------===//
+// Test Fixture
+//===----------------------------------------------------------------------===//
+
+class CIROpenACCPointerLikeTest : public ::testing::Test {
+protected:
+  CIROpenACCPointerLikeTest() : b(&context), loc(UnknownLoc::get(&context)) {
+    context.loadDialect<cir::CIRDialect>();
+    context.loadDialect<mlir::acc::OpenACCDialect>();
+
+    // Register extension to integrate CIR types with OpenACC.
+    mlir::DialectRegistry registry;
+    cir::acc::registerOpenACCExtensions(registry);
+    context.appendDialectRegistry(registry);
+  }
+
+  MLIRContext context;
+  OpBuilder b;
+  Location loc;
+
+  mlir::IntegerAttr getSizeFromCharUnits(mlir::MLIRContext *ctx,
+                                         clang::CharUnits size) {
+    // Note that mlir::IntegerType is used instead of cir::IntType here
+    // because we don't need sign information for this to be useful, so keep
+    // it simple.
+    return mlir::IntegerAttr::get(mlir::IntegerType::get(ctx, 64),
+                                  size.getQuantity());
+  }
+
+  // General handler for types without a specific test
+  void testElementType(mlir::Type ty) {
+    mlir::Type ptrTy = cir::PointerType::get(ty);
+
+    // cir::PointerType should be castable to acc::PointerLikeType
+    auto pltTy = dyn_cast_if_present<mlir::acc::PointerLikeType>(ptrTy);
+    ASSERT_NE(pltTy, nullptr);
+
+    EXPECT_EQ(pltTy.getElementType(), ty);
+
+    OwningOpRef<cir::AllocaOp> varPtrOp = b.create<cir::AllocaOp>(
+        loc, ptrTy, ty, "",
+        getSizeFromCharUnits(&context, clang::CharUnits::One()));
+
+    mlir::Value val = varPtrOp.get();
+    mlir::acc::VariableTypeCategory typeCategory = pltTy.getPointeeTypeCategory(
+        cast<TypedValue<mlir::acc::PointerLikeType>>(val),
+        mlir::acc::getVarType(varPtrOp.get()));
+
+    if (isAnyIntegerOrFloatingPointType(ty) ||
+        mlir::isa<cir::PointerType>(ty) || mlir::isa<cir::BoolType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::scalar);
+    } else if (mlir::isa<cir::ArrayType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::array);
+    } else if (mlir::isa<cir::RecordType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::composite);
+    } else if (mlir::isa<cir::FuncType, cir::VectorType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::nonscalar);
+    } else if (mlir::isa<cir::VoidType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::uncategorized);
+    } else {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::uncategorized);
+      // If we hit this, we need to add support for a new type.
+      ASSERT_TRUE(false);
+    }
+  }
+};
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToInt) {
+  // Test various scalar types.
+  testElementType(cir::IntType::get(&context, 8, true));
+  testElementType(cir::IntType::get(&context, 8, false));
+  testElementType(cir::IntType::get(&context, 16, true));
+  testElementType(cir::IntType::get(&context, 16, false));
+  testElementType(cir::IntType::get(&context, 32, true));
+  testElementType(cir::IntType::get(&context, 32, false));
+  testElementType(cir::IntType::get(&context, 64, true));
+  testElementType(cir::IntType::get(&context, 64, false));
+  testElementType(cir::IntType::get(&context, 128, true));
+  testElementType(cir::IntType::get(&context, 128, false));
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToBool) {
+  testElementType(cir::BoolType::get(&context));
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToFloat) {
+  testElementType(cir::SingleType::get(&context));
+  testElementType(cir::DoubleType::get(&context));
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToPointer) {
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  mlir::Type ptrTy = cir::PointerType::get(i32Ty);
+  testElementType(ptrTy);
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToArray) {
+  // Test an array type.
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  testElementType(cir::ArrayType::get(i32Ty, 10));
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToStruct) {
+  // Test a struct type.
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  llvm::ArrayRef<mlir::Type> fields = {i32Ty, i32Ty};
+  cir::RecordType structTy = cir::RecordType::get(
+      &context, b.getStringAttr("S"), cir::RecordType::RecordKind::Struct);
+  structTy.complete(fields, false, false);
+  testElementType(structTy);
+
+  // Test a union type.
+  cir::RecordType unionTy = cir::RecordType::get(
+      &context, b.getStringAttr("U"), cir::RecordType::RecordKind::Union);
+  unionTy.complete(fields, false, false);
+  testElementType(unionTy);
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToFunction) {
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  cir::FuncType::get(SmallVector<mlir::Type, 2>{i32Ty, i32Ty}, i32Ty);
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToVector) {
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  mlir::Type vecTy = cir::VectorType::get(i32Ty, 4);
+  testElementType(vecTy);
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToVoid) {
+  mlir::Type voidTy = cir::VoidType::get(&context);
+  testElementType(voidTy);
+}
diff --git a/clang/unittests/CMakeLists.txt b/clang/unittests/CMakeLists.txt
index b4114d419b75c..2a84607aa0937 100644
--- a/clang/unittests/CMakeLists.txt
+++ b/clang/unittests/CMakeLists.txt
@@ -105,7 +105,9 @@ add_subdirectory(Index)
 add_subdirectory(InstallAPI)
 add_subdirectory(Serialization)
 add_subdirectory(Support)
-
+if (CLANG_ENABLE_CIR)
+  add_subdirectory(CIR)
+endif()
 
 # If we're doing a single merged clang unit test binary, add that target after
 # all the previous subdirectories have been processed.
@@ -127,3 +129,10 @@ add_distinct_clang_unittest(AllClangUnitTests
 # the merged clang unit test binary, we can update the include paths and make
 # this the default.
 include_directories(Tooling)
+
+if (CLANG_ENABLE_CIR)
+  set(MLIR_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include )
+  set(MLIR_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/mlir/include)
+  include_directories(SYSTEM ${MLIR_INCLUDE_DIR})
+  include_directories(${MLIR_TABLEGEN_OUTPUT_DIR})
+endif()

@llvmbot
Copy link
Member

llvmbot commented May 13, 2025

@llvm/pr-subscribers-clangir

Author: Andy Kaylor (andykaylor)

Changes

This adds code to attach the OpenACC PointerLikeType interface to cir::PointerType, along with a unit test for the interface.


Full diff: https://github.com/llvm/llvm-project/pull/139768.diff

11 Files Affected:

  • (added) clang/include/clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h (+36)
  • (added) clang/include/clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h (+22)
  • (modified) clang/lib/CIR/CodeGen/CIRGenerator.cpp (+7)
  • (modified) clang/lib/CIR/CodeGen/CMakeLists.txt (+1)
  • (modified) clang/lib/CIR/Dialect/CMakeLists.txt (+1)
  • (added) clang/lib/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.cpp (+41)
  • (added) clang/lib/CIR/Dialect/OpenACC/CMakeLists.txt (+10)
  • (added) clang/lib/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.cpp (+27)
  • (added) clang/unittests/CIR/CMakeLists.txt (+11)
  • (added) clang/unittests/CIR/PointerLikeTest.cpp (+160)
  • (modified) clang/unittests/CMakeLists.txt (+10-1)
diff --git a/clang/include/clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h b/clang/include/clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h
new file mode 100644
index 0000000000000..eccb6838a491f
--- /dev/null
+++ b/clang/include/clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains external dialect interfaces for CIR.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_CIR_DIALECT_OPENACC_CIROPENACCTYPEINTERFACES_H
+#define CLANG_CIR_DIALECT_OPENACC_CIROPENACCTYPEINTERFACES_H
+
+#include "mlir/Dialect/OpenACC/OpenACC.h"
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
+
+namespace cir::acc {
+
+template <typename T>
+struct OpenACCPointerLikeModel
+    : public mlir::acc::PointerLikeType::ExternalModel<
+          OpenACCPointerLikeModel<T>, T> {
+  mlir::Type getElementType(mlir::Type pointer) const {
+    return mlir::cast<T>(pointer).getPointee();
+  }
+  mlir::acc::VariableTypeCategory
+  getPointeeTypeCategory(mlir::Type pointer,
+                         mlir::TypedValue<mlir::acc::PointerLikeType> varPtr,
+                         mlir::Type varType) const;
+};
+
+} // namespace cir::acc
+
+#endif // CLANG_CIR_DIALECT_OPENACC_CIROPENACCTYPEINTERFACES_H
diff --git a/clang/include/clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h b/clang/include/clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h
new file mode 100644
index 0000000000000..13780a01ea1bb
--- /dev/null
+++ b/clang/include/clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_CIR_DIALECT_OPENACC_REGISTEROPENACCEXTENSIONS_H
+#define CLANG_CIR_DIALECT_OPENACC_REGISTEROPENACCEXTENSIONS_H
+
+namespace mlir {
+class DialectRegistry;
+} // namespace mlir
+
+namespace cir::acc {
+
+void registerOpenACCExtensions(mlir::DialectRegistry &registry);
+
+} // namespace cir::acc
+
+#endif // CLANG_CIR_DIALECT_OPENACC_REGISTEROPENACCEXTENSIONS_H
diff --git a/clang/lib/CIR/CodeGen/CIRGenerator.cpp b/clang/lib/CIR/CodeGen/CIRGenerator.cpp
index aa3864deb733c..40252ffecfba1 100644
--- a/clang/lib/CIR/CodeGen/CIRGenerator.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenerator.cpp
@@ -18,6 +18,7 @@
 #include "clang/AST/DeclGroup.h"
 #include "clang/CIR/CIRGenerator.h"
 #include "clang/CIR/Dialect/IR/CIRDialect.h"
+#include "clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h"
 
 using namespace cir;
 using namespace clang;
@@ -38,6 +39,12 @@ void CIRGenerator::Initialize(ASTContext &astContext) {
   mlirContext = std::make_unique<mlir::MLIRContext>();
   mlirContext->loadDialect<cir::CIRDialect>();
   mlirContext->getOrLoadDialect<mlir::acc::OpenACCDialect>();
+
+  // Register extensions to integrate CIR types with OpenACC.
+  mlir::DialectRegistry registry;
+  cir::acc::registerOpenACCExtensions(registry);
+  mlirContext->appendDialectRegistry(registry);
+
   cgm = std::make_unique<clang::CIRGen::CIRGenModule>(
       *mlirContext.get(), astContext, codeGenOpts, diags);
 }
diff --git a/clang/lib/CIR/CodeGen/CMakeLists.txt b/clang/lib/CIR/CodeGen/CMakeLists.txt
index 7a701c3c0b82b..8f5796e59d3bb 100644
--- a/clang/lib/CIR/CodeGen/CMakeLists.txt
+++ b/clang/lib/CIR/CodeGen/CMakeLists.txt
@@ -35,6 +35,7 @@ add_clang_library(clangCIR
   clangBasic
   clangLex
   ${dialect_libs}
+  CIROpenACCSupport
   MLIRCIR
   MLIRCIRInterfaces
 )
diff --git a/clang/lib/CIR/Dialect/CMakeLists.txt b/clang/lib/CIR/Dialect/CMakeLists.txt
index 9f57627c321fb..c825a61b2779b 100644
--- a/clang/lib/CIR/Dialect/CMakeLists.txt
+++ b/clang/lib/CIR/Dialect/CMakeLists.txt
@@ -1,2 +1,3 @@
 add_subdirectory(IR)
+add_subdirectory(OpenACC)
 add_subdirectory(Transforms)
diff --git a/clang/lib/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.cpp b/clang/lib/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.cpp
new file mode 100644
index 0000000000000..ea563ecdfb3bb
--- /dev/null
+++ b/clang/lib/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Implementation of external dialect interfaces for CIR.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h"
+
+namespace cir::acc {
+
+template <>
+mlir::acc::VariableTypeCategory
+OpenACCPointerLikeModel<cir::PointerType>::getPointeeTypeCategory(
+    mlir::Type pointer, mlir::TypedValue<mlir::acc::PointerLikeType> varPtr,
+    mlir::Type varType) const {
+  mlir::Type eleTy = mlir::cast<cir::PointerType>(pointer).getPointee();
+
+  if (auto mappableTy = mlir::dyn_cast<mlir::acc::MappableType>(eleTy))
+    return mappableTy.getTypeCategory(varPtr);
+
+  if (isAnyIntegerOrFloatingPointType(eleTy) ||
+      mlir::isa<cir::BoolType>(eleTy) || mlir::isa<cir::PointerType>(eleTy))
+    return mlir::acc::VariableTypeCategory::scalar;
+  if (mlir::isa<cir::ArrayType>(eleTy))
+    return mlir::acc::VariableTypeCategory::array;
+  if (mlir::isa<cir::RecordType>(eleTy))
+    return mlir::acc::VariableTypeCategory::composite;
+  if (mlir::isa<cir::FuncType>(eleTy) || mlir::isa<cir::VectorType>(eleTy))
+    return mlir::acc::VariableTypeCategory::nonscalar;
+
+  // Without further checking, this type cannot be categorized.
+  return mlir::acc::VariableTypeCategory::uncategorized;
+}
+
+} // namespace cir::acc
diff --git a/clang/lib/CIR/Dialect/OpenACC/CMakeLists.txt b/clang/lib/CIR/Dialect/OpenACC/CMakeLists.txt
new file mode 100644
index 0000000000000..5b0a1620a1bff
--- /dev/null
+++ b/clang/lib/CIR/Dialect/OpenACC/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_clang_library(CIROpenACCSupport
+  CIROpenACCTypeInterfaces.cpp
+  RegisterOpenACCExtensions.cpp
+
+  DEPENDS
+  MLIRCIRTypeConstraintsIncGen
+
+  LINK_LIBS PUBLIC
+  MLIRIR
+  )
diff --git a/clang/lib/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.cpp b/clang/lib/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.cpp
new file mode 100644
index 0000000000000..3dfe7aeb6b1d6
--- /dev/null
+++ b/clang/lib/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Registration for OpenACC extensions as applied to CIR dialect.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h"
+#include "clang/CIR/Dialect/IR/CIRDialect.h"
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
+#include "clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h"
+
+namespace cir::acc {
+
+void registerOpenACCExtensions(mlir::DialectRegistry &registry) {
+  registry.addExtension(+[](mlir::MLIRContext *ctx, cir::CIRDialect *dialect) {
+    cir::PointerType::attachInterface<
+        OpenACCPointerLikeModel<cir::PointerType>>(*ctx);
+  });
+}
+
+} // namespace cir::acc
diff --git a/clang/unittests/CIR/CMakeLists.txt b/clang/unittests/CIR/CMakeLists.txt
new file mode 100644
index 0000000000000..171201b7beb23
--- /dev/null
+++ b/clang/unittests/CIR/CMakeLists.txt
@@ -0,0 +1,11 @@
+add_clang_unittest(CIRUnitTests
+  PointerLikeTest.cpp
+  LLVM_COMPONENTS
+  Core
+
+  LINK_LIBS
+  MLIRCIR
+  CIROpenACCSupport
+  MLIRIR
+  MLIROpenACCDialect
+  )
diff --git a/clang/unittests/CIR/PointerLikeTest.cpp b/clang/unittests/CIR/PointerLikeTest.cpp
new file mode 100644
index 0000000000000..af8f32d237e71
--- /dev/null
+++ b/clang/unittests/CIR/PointerLikeTest.cpp
@@ -0,0 +1,160 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Unit tests for CIR implementation of OpenACC's PointertLikeType interface
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/OpenACC/OpenACC.h"
+#include "mlir/IR/BuiltinTypes.h"
+#include "mlir/IR/Diagnostics.h"
+#include "mlir/IR/MLIRContext.h"
+#include "mlir/IR/Value.h"
+#include "clang/CIR/Dialect/Builder/CIRBaseBuilder.h"
+#include "clang/CIR/Dialect/IR/CIRDialect.h"
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
+#include "clang/CIR/Dialect/OpenACC/CIROpenACCTypeInterfaces.h"
+#include "clang/CIR/Dialect/OpenACC/RegisterOpenACCExtensions.h"
+#include "gtest/gtest.h"
+
+using namespace mlir;
+using namespace cir;
+
+//===----------------------------------------------------------------------===//
+// Test Fixture
+//===----------------------------------------------------------------------===//
+
+class CIROpenACCPointerLikeTest : public ::testing::Test {
+protected:
+  CIROpenACCPointerLikeTest() : b(&context), loc(UnknownLoc::get(&context)) {
+    context.loadDialect<cir::CIRDialect>();
+    context.loadDialect<mlir::acc::OpenACCDialect>();
+
+    // Register extension to integrate CIR types with OpenACC.
+    mlir::DialectRegistry registry;
+    cir::acc::registerOpenACCExtensions(registry);
+    context.appendDialectRegistry(registry);
+  }
+
+  MLIRContext context;
+  OpBuilder b;
+  Location loc;
+
+  mlir::IntegerAttr getSizeFromCharUnits(mlir::MLIRContext *ctx,
+                                         clang::CharUnits size) {
+    // Note that mlir::IntegerType is used instead of cir::IntType here
+    // because we don't need sign information for this to be useful, so keep
+    // it simple.
+    return mlir::IntegerAttr::get(mlir::IntegerType::get(ctx, 64),
+                                  size.getQuantity());
+  }
+
+  // General handler for types without a specific test
+  void testElementType(mlir::Type ty) {
+    mlir::Type ptrTy = cir::PointerType::get(ty);
+
+    // cir::PointerType should be castable to acc::PointerLikeType
+    auto pltTy = dyn_cast_if_present<mlir::acc::PointerLikeType>(ptrTy);
+    ASSERT_NE(pltTy, nullptr);
+
+    EXPECT_EQ(pltTy.getElementType(), ty);
+
+    OwningOpRef<cir::AllocaOp> varPtrOp = b.create<cir::AllocaOp>(
+        loc, ptrTy, ty, "",
+        getSizeFromCharUnits(&context, clang::CharUnits::One()));
+
+    mlir::Value val = varPtrOp.get();
+    mlir::acc::VariableTypeCategory typeCategory = pltTy.getPointeeTypeCategory(
+        cast<TypedValue<mlir::acc::PointerLikeType>>(val),
+        mlir::acc::getVarType(varPtrOp.get()));
+
+    if (isAnyIntegerOrFloatingPointType(ty) ||
+        mlir::isa<cir::PointerType>(ty) || mlir::isa<cir::BoolType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::scalar);
+    } else if (mlir::isa<cir::ArrayType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::array);
+    } else if (mlir::isa<cir::RecordType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::composite);
+    } else if (mlir::isa<cir::FuncType, cir::VectorType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::nonscalar);
+    } else if (mlir::isa<cir::VoidType>(ty)) {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::uncategorized);
+    } else {
+      EXPECT_EQ(typeCategory, mlir::acc::VariableTypeCategory::uncategorized);
+      // If we hit this, we need to add support for a new type.
+      ASSERT_TRUE(false);
+    }
+  }
+};
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToInt) {
+  // Test various scalar types.
+  testElementType(cir::IntType::get(&context, 8, true));
+  testElementType(cir::IntType::get(&context, 8, false));
+  testElementType(cir::IntType::get(&context, 16, true));
+  testElementType(cir::IntType::get(&context, 16, false));
+  testElementType(cir::IntType::get(&context, 32, true));
+  testElementType(cir::IntType::get(&context, 32, false));
+  testElementType(cir::IntType::get(&context, 64, true));
+  testElementType(cir::IntType::get(&context, 64, false));
+  testElementType(cir::IntType::get(&context, 128, true));
+  testElementType(cir::IntType::get(&context, 128, false));
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToBool) {
+  testElementType(cir::BoolType::get(&context));
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToFloat) {
+  testElementType(cir::SingleType::get(&context));
+  testElementType(cir::DoubleType::get(&context));
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToPointer) {
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  mlir::Type ptrTy = cir::PointerType::get(i32Ty);
+  testElementType(ptrTy);
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToArray) {
+  // Test an array type.
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  testElementType(cir::ArrayType::get(i32Ty, 10));
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToStruct) {
+  // Test a struct type.
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  llvm::ArrayRef<mlir::Type> fields = {i32Ty, i32Ty};
+  cir::RecordType structTy = cir::RecordType::get(
+      &context, b.getStringAttr("S"), cir::RecordType::RecordKind::Struct);
+  structTy.complete(fields, false, false);
+  testElementType(structTy);
+
+  // Test a union type.
+  cir::RecordType unionTy = cir::RecordType::get(
+      &context, b.getStringAttr("U"), cir::RecordType::RecordKind::Union);
+  unionTy.complete(fields, false, false);
+  testElementType(unionTy);
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToFunction) {
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  cir::FuncType::get(SmallVector<mlir::Type, 2>{i32Ty, i32Ty}, i32Ty);
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToVector) {
+  mlir::Type i32Ty = cir::IntType::get(&context, 32, true);
+  mlir::Type vecTy = cir::VectorType::get(i32Ty, 4);
+  testElementType(vecTy);
+}
+
+TEST_F(CIROpenACCPointerLikeTest, testPointerToVoid) {
+  mlir::Type voidTy = cir::VoidType::get(&context);
+  testElementType(voidTy);
+}
diff --git a/clang/unittests/CMakeLists.txt b/clang/unittests/CMakeLists.txt
index b4114d419b75c..2a84607aa0937 100644
--- a/clang/unittests/CMakeLists.txt
+++ b/clang/unittests/CMakeLists.txt
@@ -105,7 +105,9 @@ add_subdirectory(Index)
 add_subdirectory(InstallAPI)
 add_subdirectory(Serialization)
 add_subdirectory(Support)
-
+if (CLANG_ENABLE_CIR)
+  add_subdirectory(CIR)
+endif()
 
 # If we're doing a single merged clang unit test binary, add that target after
 # all the previous subdirectories have been processed.
@@ -127,3 +129,10 @@ add_distinct_clang_unittest(AllClangUnitTests
 # the merged clang unit test binary, we can update the include paths and make
 # this the default.
 include_directories(Tooling)
+
+if (CLANG_ENABLE_CIR)
+  set(MLIR_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include )
+  set(MLIR_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/mlir/include)
+  include_directories(SYSTEM ${MLIR_INCLUDE_DIR})
+  include_directories(${MLIR_TABLEGEN_OUTPUT_DIR})
+endif()

Copy link
Collaborator

@erichkeane erichkeane left a comment

Choose a reason for hiding this comment

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

I am not a good reviewer for this, hopefully @razvanlupusoru and @clementval can affirm this is right.

namespace cir::acc {

template <typename T>
struct OpenACCPointerLikeModel
Copy link
Collaborator

Choose a reason for hiding this comment

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

Silly question perhaps, why is this not part of MLIR? It doesn't seem to refer to CIR at all? Or am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

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

#define CLANG_CIR_DIALECT_OPENACC_CIROPENACCTYPEINTERFACES_H

#include "mlir/Dialect/OpenACC/OpenACC.h"
#include "clang/CIR/Dialect/IR/CIRTypes.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What are we using from this include?

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 guess nothing here. I probably thought I was going to need it and added it proactively.


if (isAnyIntegerOrFloatingPointType(eleTy) ||
mlir::isa<cir::BoolType>(eleTy) || mlir::isa<cir::PointerType>(eleTy))
return mlir::acc::VariableTypeCategory::scalar;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems the CIR type system allows computation of interior pointers: https://godbolt.org/z/aPn1j5a69
Which means that scalar categorization might capture things which it shouldn't. More specifically, "a member of a composite variable" is not considered a "scalar" in OpenACC terminology - and the CIR type system by itself does not provide the appropriate features to distinguish this.

Here is how we dealt with this case in FIR which allows the same: https://github.com/llvm/llvm-project/blob/main/flang/lib/Optimizer/OpenACC/FIROpenACCTypeInterfaces.cpp#L386

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, so it's not just a property of the type, but an interpretation of the type within the context of the value it is associated with. That makes sense now for the extra parameters that I'm ignoring here.

@razvanlupusoru
Copy link
Contributor

I just had one concern - otherwise looks great! Nice job!

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Neat unit tests! LGTM


EXPECT_EQ(pltTy.getElementType(), ty);

OwningOpRef<cir::AllocaOp> varPtrOp = b.create<cir::AllocaOp>(
Copy link
Member

Choose a reason for hiding this comment

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

Do you really need a OwningOpRef here? Thought those were only for top level operations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The purpose here is to make have it automatically delete the op on return from the function.

Copy link
Contributor

@xlauko xlauko left a comment

Choose a reason for hiding this comment

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

LGTM

// int *f1;
// int *f2;
// } *p;
// int *pMember = p->f2;
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 talked this over with @razvanlupusoru offline, and if I understood what he was telling me correctly this case ins't reachable from OpenACC source code. What I'm testing here is the pointer loaded from p->f2 but if one were to put pMember in a OpenACC copy clause, we'd get a subsequent load from the cir.alloca instruction (which is covered by other tests), not the load from p->f2 which is what I'm testing here. My understanding is that if you put p->f2 in the OpenACC copy clause, we'd be using the result of the cir.get_member operation, which is also covered by other tests.

I added this test because I wanted to cover the behavior of checking arbitrary cir.load operations in the middle of the CIR, but it sounds like that's not required by the acc dialect. Does that mean the "correct" result for this case is unspecified?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed.

The current implementation seems reasonable to me that once dereferences - it categorizes as the actual field type. So I would leave it in place instead of doing something else with this unspecified case.

@andykaylor
Copy link
Contributor Author

@razvanlupusoru and @erichkeane Are you OK with committing this now?

@erichkeane
Copy link
Collaborator

@razvanlupusoru and @erichkeane Are you OK with committing this now?

I am if @razvanlupusoru is. It'll probably take me a pretty decent amount of time to figure out if this is good enough for my uses, so I'd rather have it done now and fixup later if necessary.

Copy link
Contributor

@razvanlupusoru razvanlupusoru left a comment

Choose a reason for hiding this comment

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

Thank you! Nice work!

@andykaylor andykaylor merged commit fc7857c into llvm:main May 15, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented May 15, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building clang at step 4 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[221/2504] Building CXX object libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj
[222/2504] Generating header inttypes.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/inttypes.yaml
[223/2504] Building CXX object libc/src/stdio/baremetal/CMakeFiles/libc.src.stdio.baremetal.putchar.dir/putchar.cpp.obj
[224/2504] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.labs.dir/labs.cpp.obj
[225/2504] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strncmp.dir/strncmp.cpp.obj
[226/2504] Copying CXX header __algorithm/ranges_binary_search.h
[227/2504] Copying CXX header __algorithm/shuffle.h
[228/2504] Generating header complex.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/complex.yaml
[229/2504] Generating header locale.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/locale.yaml
[230/2504] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj
FAILED: libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-73fcrucs/./bin/clang++ --target=armv6m-none-eabi -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-73fcrucs/include/armv6m-unknown-none-eabi --target=armv6m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-73fcrucs/runtimes/runtimes-armv6m-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=armv6m-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj -MF libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj.d -o libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp:20:3: error: unknown type name 'uintptr_t'
   20 |   uintptr_t addr = reinterpret_cast<uintptr_t>(p);
      |   ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp:20:37: error: unknown type name 'uintptr_t'
   20 |   uintptr_t addr = reinterpret_cast<uintptr_t>(p);
      |                                     ^
2 errors generated.
[231/2504] Copying CXX header __algorithm/remove_copy_if.h
[232/2504] Copying CXX header __algorithm/ranges_all_of.h
[233/2504] Building CXX object libc/src/stdio/baremetal/CMakeFiles/libc.src.stdio.baremetal.puts.dir/puts.cpp.obj
[234/2504] Copying CXX header __algorithm/ranges_find_first_of.h
[235/2504] Copying CXX header __algorithm/ranges_contains.h
[236/2504] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.srand.dir/srand.cpp.obj
[237/2504] Copying CXX header __atomic/check_memory_order.h
[238/2504] Copying CXX header __algorithm/unique_copy.h
[239/2504] Copying CXX header __algorithm/ranges_any_of.h
[240/2504] Copying CXX header __algorithm/ranges_copy_n.h
[241/2504] Generating header fenv.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/fenv.yaml
[242/2504] Copying CXX header __algorithm/ranges_find_if.h
[243/2504] Copying CXX header __algorithm/ranges_transform.h
[244/2504] Copying CXX header __algorithm/remove.h
[245/2504] Generating header strings.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/strings.yaml
[246/2504] Copying CXX header __atomic/to_gcc_order.h
[247/2504] Generating header stdckdint.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdckdint.yaml
[248/2504] Copying CXX header __algorithm/ranges_stable_partition.h
[249/2504] Generating header uchar.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/uchar.yaml
[250/2504] Building CXX object libc/src/compiler/generic/CMakeFiles/libc.src.compiler.generic.__stack_chk_fail.dir/__stack_chk_fail.cpp.obj
[251/2504] Copying CXX header __algorithm/transform.h
[252/2504] Copying CXX header __algorithm/prev_permutation.h
[253/2504] Generating header float.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/float.yaml
[254/2504] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.strncasecmp.dir/strncasecmp.cpp.obj
[255/2504] Copying CXX header __algorithm/ranges_count.h
[256/2504] Copying CXX header __algorithm/ranges_reverse.h
[257/2504] Copying CXX header __algorithm/ranges_starts_with.h
[258/2504] Copying CXX header __algorithm/ranges_replace_if.h
[259/2504] Copying CXX header __algorithm/ranges_swap_ranges.h
[260/2504] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.strcasecmp.dir/strcasecmp.cpp.obj
Step 6 (build) failure: build (failure)
...
[221/2504] Building CXX object libc/startup/baremetal/CMakeFiles/libc.startup.baremetal.fini.dir/fini.cpp.obj
[222/2504] Generating header inttypes.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/inttypes.yaml
[223/2504] Building CXX object libc/src/stdio/baremetal/CMakeFiles/libc.src.stdio.baremetal.putchar.dir/putchar.cpp.obj
[224/2504] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.labs.dir/labs.cpp.obj
[225/2504] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strncmp.dir/strncmp.cpp.obj
[226/2504] Copying CXX header __algorithm/ranges_binary_search.h
[227/2504] Copying CXX header __algorithm/shuffle.h
[228/2504] Generating header complex.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/complex.yaml
[229/2504] Generating header locale.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/locale.yaml
[230/2504] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj
FAILED: libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-73fcrucs/./bin/clang++ --target=armv6m-none-eabi -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-73fcrucs/include/armv6m-unknown-none-eabi --target=armv6m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-73fcrucs/runtimes/runtimes-armv6m-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=armv6m-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj -MF libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj.d -o libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp:20:3: error: unknown type name 'uintptr_t'
   20 |   uintptr_t addr = reinterpret_cast<uintptr_t>(p);
      |   ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp:20:37: error: unknown type name 'uintptr_t'
   20 |   uintptr_t addr = reinterpret_cast<uintptr_t>(p);
      |                                     ^
2 errors generated.
[231/2504] Copying CXX header __algorithm/remove_copy_if.h
[232/2504] Copying CXX header __algorithm/ranges_all_of.h
[233/2504] Building CXX object libc/src/stdio/baremetal/CMakeFiles/libc.src.stdio.baremetal.puts.dir/puts.cpp.obj
[234/2504] Copying CXX header __algorithm/ranges_find_first_of.h
[235/2504] Copying CXX header __algorithm/ranges_contains.h
[236/2504] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.srand.dir/srand.cpp.obj
[237/2504] Copying CXX header __atomic/check_memory_order.h
[238/2504] Copying CXX header __algorithm/unique_copy.h
[239/2504] Copying CXX header __algorithm/ranges_any_of.h
[240/2504] Copying CXX header __algorithm/ranges_copy_n.h
[241/2504] Generating header fenv.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/fenv.yaml
[242/2504] Copying CXX header __algorithm/ranges_find_if.h
[243/2504] Copying CXX header __algorithm/ranges_transform.h
[244/2504] Copying CXX header __algorithm/remove.h
[245/2504] Generating header strings.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/strings.yaml
[246/2504] Copying CXX header __atomic/to_gcc_order.h
[247/2504] Generating header stdckdint.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdckdint.yaml
[248/2504] Copying CXX header __algorithm/ranges_stable_partition.h
[249/2504] Generating header uchar.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/uchar.yaml
[250/2504] Building CXX object libc/src/compiler/generic/CMakeFiles/libc.src.compiler.generic.__stack_chk_fail.dir/__stack_chk_fail.cpp.obj
[251/2504] Copying CXX header __algorithm/transform.h
[252/2504] Copying CXX header __algorithm/prev_permutation.h
[253/2504] Generating header float.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/float.yaml
[254/2504] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.strncasecmp.dir/strncasecmp.cpp.obj
[255/2504] Copying CXX header __algorithm/ranges_count.h
[256/2504] Copying CXX header __algorithm/ranges_reverse.h
[257/2504] Copying CXX header __algorithm/ranges_starts_with.h
[258/2504] Copying CXX header __algorithm/ranges_replace_if.h
[259/2504] Copying CXX header __algorithm/ranges_swap_ranges.h
[260/2504] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.strcasecmp.dir/strcasecmp.cpp.obj

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 15, 2025

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

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

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'lit :: timeout-hang.py' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 13
not env -u FILECHECK_OPTS "/usr/bin/python3.10" /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/utils/lit/lit.py -j1 --order=lexical Inputs/timeout-hang/run-nonexistent.txt  --timeout=1 --param external=0 | "/usr/bin/python3.10" /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/utils/lit/tests/timeout-hang.py 1
# executed command: not env -u FILECHECK_OPTS /usr/bin/python3.10 /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/utils/lit/lit.py -j1 --order=lexical Inputs/timeout-hang/run-nonexistent.txt --timeout=1 --param external=0
# .---command stderr------------
# | lit.py: /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 1 seconds was requested on the command line. Forcing timeout to be 1 seconds.
# `-----------------------------
# executed command: /usr/bin/python3.10 /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/utils/lit/tests/timeout-hang.py 1
# .---command stdout------------
# | Testing took as long or longer than timeout
# `-----------------------------
# error: command failed with exit status: 1

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented May 15, 2025

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

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

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)
...
PASS: Profile-powerpc64le :: Linux/binary-id-offset.c (962 of 2608)
PASS: MemorySanitizer-POWERPC64LE :: ifaddrs.cpp (963 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/assert.cpp (964 of 2608)
PASS: Profile-powerpc64le :: Linux/binary-id-lookup.c (965 of 2608)
PASS: Profile-powerpc64le :: instrprof-bufferio.c (966 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/sl_add.cpp (967 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/strlcat.cpp (968 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/strlcpy.cpp (969 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/closedir.c (970 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/strtonum.cpp (971 of 2608)
FAIL: LeakSanitizer-Standalone-powerpc64le :: TestCases/create_thread_leak.cpp (972 of 2608)
******************** TEST 'LeakSanitizer-Standalone-powerpc64le :: TestCases/create_thread_leak.cpp' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/./bin/clang  --driver-mode=g++ -O0  -m64 -fno-function-sections  -gline-tables-only -fsanitize=leak -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp # RUN: at line 3
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/./bin/clang --driver-mode=g++ -O0 -m64 -fno-function-sections -gline-tables-only -fsanitize=leak -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123 # RUN: at line 4
+ not /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0
+ FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234 # RUN: at line 5
+ FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
+ not /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234 # RUN: at line 6
+ not /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1
+ FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
FileCheck error: '<stdin>' is empty.
FileCheck command line:  FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234

--

********************
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/sysctl.cpp (973 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/copy_file_range.c (974 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/vis.cpp (975 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/fgetc_ungetc_getc.cpp (976 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/prctl.cpp (977 of 2608)
PASS: Profile-powerpc64le :: instrprof-hostname.c (978 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Windows/dump_registers_aarch64.cpp (979 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Windows/dump_registers_i386.cpp (980 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Windows/dump_registers_x86_64.cpp (981 of 2608)
PASS: Profile-powerpc64le :: instrprof-set-file-object.c (982 of 2608)
PASS: Profile-powerpc64le :: Linux/coverage_test.cpp (983 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/mallopt.cpp (984 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: corelimit.cpp (985 of 2608)
PASS: MemorySanitizer-Unit :: ./Msan-powerpc64le-with-call-Test/99/287 (986 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: disable_symbolizer_path_search.cpp (987 of 2608)
PASS: Profile-powerpc64le :: Linux/extern_template.test (988 of 2608)
Step 9 (test compiler-rt debug) failure: test compiler-rt debug (failure)
...
PASS: Profile-powerpc64le :: Linux/binary-id-offset.c (962 of 2608)
PASS: MemorySanitizer-POWERPC64LE :: ifaddrs.cpp (963 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/assert.cpp (964 of 2608)
PASS: Profile-powerpc64le :: Linux/binary-id-lookup.c (965 of 2608)
PASS: Profile-powerpc64le :: instrprof-bufferio.c (966 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/sl_add.cpp (967 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/strlcat.cpp (968 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/strlcpy.cpp (969 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/closedir.c (970 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/strtonum.cpp (971 of 2608)
FAIL: LeakSanitizer-Standalone-powerpc64le :: TestCases/create_thread_leak.cpp (972 of 2608)
******************** TEST 'LeakSanitizer-Standalone-powerpc64le :: TestCases/create_thread_leak.cpp' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/./bin/clang  --driver-mode=g++ -O0  -m64 -fno-function-sections  -gline-tables-only -fsanitize=leak -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp # RUN: at line 3
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/./bin/clang --driver-mode=g++ -O0 -m64 -fno-function-sections -gline-tables-only -fsanitize=leak -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123 # RUN: at line 4
+ not /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0
+ FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234 # RUN: at line 5
+ FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
+ not /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234 # RUN: at line 6
+ not /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1
+ FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
FileCheck error: '<stdin>' is empty.
FileCheck command line:  FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234

--

********************
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/sysctl.cpp (973 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/copy_file_range.c (974 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/vis.cpp (975 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/fgetc_ungetc_getc.cpp (976 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/prctl.cpp (977 of 2608)
PASS: Profile-powerpc64le :: instrprof-hostname.c (978 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Windows/dump_registers_aarch64.cpp (979 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Windows/dump_registers_i386.cpp (980 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: Windows/dump_registers_x86_64.cpp (981 of 2608)
PASS: Profile-powerpc64le :: instrprof-set-file-object.c (982 of 2608)
PASS: Profile-powerpc64le :: Linux/coverage_test.cpp (983 of 2608)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/mallopt.cpp (984 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: corelimit.cpp (985 of 2608)
PASS: MemorySanitizer-Unit :: ./Msan-powerpc64le-with-call-Test/99/287 (986 of 2608)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: disable_symbolizer_path_search.cpp (987 of 2608)
PASS: Profile-powerpc64le :: Linux/extern_template.test (988 of 2608)

@nico
Copy link
Contributor

nico commented May 15, 2025

It looks like this adds a dependency of clang/ on mlir/. Is that correct? As far as I can tell, this is the first dependency from clang to mlir. (Test-only, but still.) Can we make that optional?

@nico
Copy link
Contributor

nico commented May 15, 2025

…aha, it looks it's behind CLANG_ENABLE_CIR already.

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 15, 2025

LLVM Buildbot has detected a new failure on builder premerge-monolithic-windows running on premerge-windows-1 while building clang at step 5 "clean-build-dir".

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

Here is the relevant piece of the build log for the reference
Step 5 (clean-build-dir) failure: Delete failed. (failure)
Step 8 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'lit :: timeout-hang.py' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 13
not env -u FILECHECK_OPTS "C:\Python39\python.exe" C:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\utils\lit\lit.py -j1 --order=lexical Inputs/timeout-hang/run-nonexistent.txt  --timeout=1 --param external=0 | "C:\Python39\python.exe" C:\ws\buildbot\premerge-monolithic-windows\build\utils\lit\tests\timeout-hang.py 1
# executed command: not env -u FILECHECK_OPTS 'C:\Python39\python.exe' 'C:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\utils\lit\lit.py' -j1 --order=lexical Inputs/timeout-hang/run-nonexistent.txt --timeout=1 --param external=0
# .---command stderr------------
# | lit.py: C:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\utils\lit\lit\main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 1 seconds was requested on the command line. Forcing timeout to be 1 seconds.
# `-----------------------------
# executed command: 'C:\Python39\python.exe' 'C:\ws\buildbot\premerge-monolithic-windows\build\utils\lit\tests\timeout-hang.py' 1
# .---command stdout------------
# | Testing took as long or longer than timeout
# `-----------------------------
# error: command failed with exit status: 1

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented May 15, 2025

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

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

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)
...
[       OK ] AddressSanitizer.AtoiAndFriendsOOBTest (2226 ms)
[ RUN      ] AddressSanitizer.HasFeatureAddressSanitizerTest
[       OK ] AddressSanitizer.HasFeatureAddressSanitizerTest (0 ms)
[ RUN      ] AddressSanitizer.CallocReturnsZeroMem
[       OK ] AddressSanitizer.CallocReturnsZeroMem (7 ms)
[ DISABLED ] AddressSanitizer.DISABLED_TSDTest
[ RUN      ] AddressSanitizer.IgnoreTest
[       OK ] AddressSanitizer.IgnoreTest (0 ms)
[ RUN      ] AddressSanitizer.SignalTest
[       OK ] AddressSanitizer.SignalTest (190 ms)
[ RUN      ] AddressSanitizer.ReallocTest
[       OK ] AddressSanitizer.ReallocTest (27 ms)
[ RUN      ] AddressSanitizer.WrongFreeTest
[       OK ] AddressSanitizer.WrongFreeTest (149 ms)
[ RUN      ] AddressSanitizer.LongJmpTest
[       OK ] AddressSanitizer.LongJmpTest (0 ms)
[ RUN      ] AddressSanitizer.ThreadStackReuseTest
[       OK ] AddressSanitizer.ThreadStackReuseTest (2 ms)
[ DISABLED ] AddressSanitizer.DISABLED_MemIntrinsicUnalignedAccessTest
[ DISABLED ] AddressSanitizer.DISABLED_LargeFunctionSymbolizeTest
[ DISABLED ] AddressSanitizer.DISABLED_MallocFreeUnwindAndSymbolizeTest
[ RUN      ] AddressSanitizer.UseThenFreeThenUseTest
[       OK ] AddressSanitizer.UseThenFreeThenUseTest (135 ms)
[ RUN      ] AddressSanitizer.FileNameInGlobalReportTest
[       OK ] AddressSanitizer.FileNameInGlobalReportTest (116 ms)
[ DISABLED ] AddressSanitizer.DISABLED_StressStackReuseAndExceptionsTest
[ RUN      ] AddressSanitizer.MlockTest
[       OK ] AddressSanitizer.MlockTest (0 ms)
[ DISABLED ] AddressSanitizer.DISABLED_DemoThreadedTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoStackTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoThreadStackTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowIn
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowLeft
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowRight
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFHigh
[ DISABLED ] AddressSanitizer.DISABLED_DemoOOM
[ DISABLED ] AddressSanitizer.DISABLED_DemoDoubleFreeTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoNullDerefTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoFunctionStaticTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoTooMuchMemoryTest
[ RUN      ] AddressSanitizer.LongDoubleNegativeTest
[       OK ] AddressSanitizer.LongDoubleNegativeTest (0 ms)
[----------] 19 tests from AddressSanitizer (27860 ms total)

[----------] Global test environment tear-down
[==========] 22 tests from 2 test suites ran. (27863 ms total)
[  PASSED  ] 22 tests.

  YOU HAVE 1 DISABLED TEST

Step 9 (run cmake) failure: run cmake (failure)
...
CMake Warning at /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/third-party/benchmark/CMakeLists.txt:319 (message):
  Using std::regex with exceptions disabled is not fully supported
-- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES -- compiled but failed to run
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_STEADY_CLOCK -- compiled but failed to run
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Failed
-- Compiling and running to test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- compiled but failed to run
CMake Warning at /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/third-party/benchmark/CMakeLists.txt:319 (message):
  Using std::regex with exceptions disabled is not fully supported
-- Compiling and running to test HAVE_STEADY_CLOCK
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Compiling and running to test HAVE_PTHREAD_AFFINITY
-- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
-- Configuring done (23.5s)
-- Performing Test HAVE_STEADY_CLOCK -- compiled but failed to run
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Compiling and running to test HAVE_POSIX_REGEX
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Compiling and running to test HAVE_PTHREAD_AFFINITY
-- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
-- Configuring done (24.3s)
-- Performing Test HAVE_POSIX_REGEX -- compiled but failed to run
CMake Warning at /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/third-party/benchmark/CMakeLists.txt:319 (message):
  Using std::regex with exceptions disabled is not fully supported
-- Compiling and running to test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- compiled but failed to run
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Compiling and running to test HAVE_PTHREAD_AFFINITY
-- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
-- Configuring done (25.2s)

-- Generating done (2.8s)
-- Build files have been written to: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build_android_i686
-- Generating done (2.9s)
-- Build files have been written to: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build_android_aarch64
-- Generating done (3.1s)
-- Build files have been written to: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build_android_arm
Step 12 (build android/i686) failure: build android/i686 (failure)
...
[637/678] Building CXX object lib/TargetParser/CMakeFiles/LLVMTargetParser.dir/TargetParser.cpp.o
[638/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/ArchitectureSet.cpp.o
[639/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Architecture.cpp.o
[640/678] Building CXX object lib/TargetParser/CMakeFiles/LLVMTargetParser.dir/RISCVTargetParser.cpp.o
[641/678] Building CXX object lib/TargetParser/CMakeFiles/LLVMTargetParser.dir/X86TargetParser.cpp.o
[642/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/PackedVersion.cpp.o
[643/678] Building CXX object lib/TargetParser/CMakeFiles/LLVMTargetParser.dir/Triple.cpp.o
[644/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Platform.cpp.o
[645/678] Building CXX object lib/TargetParser/CMakeFiles/LLVMTargetParser.dir/RISCVISAInfo.cpp.o
[646/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/TextAPIError.cpp.o
[647/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Symbol.cpp.o
[648/678] Building Opts.inc...
[649/678] Linking CXX static library lib/libLLVMTargetParser.a
[650/678] Linking CXX static library lib/libLLVMBinaryFormat.a
[651/678] Linking CXX static library lib/libLLVMCore.a
[652/678] Linking CXX static library lib/libLLVMBitReader.a
[653/678] Linking CXX static library lib/libLLVMMC.a
[654/678] Linking CXX static library lib/libLLVMMCParser.a
[655/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/RecordVisitor.cpp.o
[656/678] Building CXX object lib/AsmParser/CMakeFiles/LLVMAsmParser.dir/Parser.cpp.o
[657/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/SymbolSet.cpp.o
[658/678] Building CXX object lib/DebugInfo/Symbolize/CMakeFiles/LLVMSymbolize.dir/Symbolize.cpp.o
[659/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Target.cpp.o
[660/678] Building CXX object tools/llvm-symbolizer/CMakeFiles/llvm-symbolizer.dir/llvm-symbolizer-driver.cpp.o
[661/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/RecordsSlice.cpp.o
[662/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/InterfaceFile.cpp.o
[663/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/TextStubCommon.cpp.o
[664/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/Utils.cpp.o
[665/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/TextStubV5.cpp.o
[666/678] Building CXX object tools/llvm-symbolizer/CMakeFiles/llvm-symbolizer.dir/llvm-symbolizer.cpp.o
[667/678] Building CXX object lib/TextAPI/CMakeFiles/LLVMTextAPI.dir/TextStub.cpp.o
[668/678] Linking CXX static library lib/libLLVMTextAPI.a
[669/678] Building CXX object lib/AsmParser/CMakeFiles/LLVMAsmParser.dir/LLParser.cpp.o
[670/678] Linking CXX static library lib/libLLVMAsmParser.a
[671/678] Linking CXX static library lib/libLLVMIRReader.a
[672/678] Linking CXX static library lib/libLLVMObject.a
[673/678] Linking CXX static library lib/libLLVMDebugInfoDWARF.a
[674/678] Linking CXX static library lib/libLLVMDebugInfoPDB.a
[675/678] Linking CXX static library lib/libLLVMDebugInfoGSYM.a
[676/678] Linking CXX static library lib/libLLVMSymbolize.a
[677/678] Linking CXX static library lib/libLLVMDebuginfod.a
[678/678] Linking CXX executable bin/llvm-symbolizer
ninja: Entering directory `compiler_rt_build_android_i686'
ninja: error: loading 'build.ninja': No such file or directory

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild




Step 34 (run instrumented asan tests [aarch64/bluejay-userdebug/TQ3A.230805.001]) failure: run instrumented asan tests [aarch64/bluejay-userdebug/TQ3A.230805.001] (failure)
...
[ RUN      ] AddressSanitizer.HasFeatureAddressSanitizerTest
[       OK ] AddressSanitizer.HasFeatureAddressSanitizerTest (0 ms)
[ RUN      ] AddressSanitizer.CallocReturnsZeroMem
[       OK ] AddressSanitizer.CallocReturnsZeroMem (7 ms)
[ DISABLED ] AddressSanitizer.DISABLED_TSDTest
[ RUN      ] AddressSanitizer.IgnoreTest
[       OK ] AddressSanitizer.IgnoreTest (0 ms)
[ RUN      ] AddressSanitizer.SignalTest
[       OK ] AddressSanitizer.SignalTest (190 ms)
[ RUN      ] AddressSanitizer.ReallocTest
[       OK ] AddressSanitizer.ReallocTest (27 ms)
[ RUN      ] AddressSanitizer.WrongFreeTest
[       OK ] AddressSanitizer.WrongFreeTest (149 ms)
[ RUN      ] AddressSanitizer.LongJmpTest
[       OK ] AddressSanitizer.LongJmpTest (0 ms)
[ RUN      ] AddressSanitizer.ThreadStackReuseTest
[       OK ] AddressSanitizer.ThreadStackReuseTest (2 ms)
[ DISABLED ] AddressSanitizer.DISABLED_MemIntrinsicUnalignedAccessTest
[ DISABLED ] AddressSanitizer.DISABLED_LargeFunctionSymbolizeTest
[ DISABLED ] AddressSanitizer.DISABLED_MallocFreeUnwindAndSymbolizeTest
[ RUN      ] AddressSanitizer.UseThenFreeThenUseTest
[       OK ] AddressSanitizer.UseThenFreeThenUseTest (135 ms)
[ RUN      ] AddressSanitizer.FileNameInGlobalReportTest
[       OK ] AddressSanitizer.FileNameInGlobalReportTest (116 ms)
[ DISABLED ] AddressSanitizer.DISABLED_StressStackReuseAndExceptionsTest
[ RUN      ] AddressSanitizer.MlockTest
[       OK ] AddressSanitizer.MlockTest (0 ms)
[ DISABLED ] AddressSanitizer.DISABLED_DemoThreadedTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoStackTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoThreadStackTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowIn
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowLeft
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFLowRight
[ DISABLED ] AddressSanitizer.DISABLED_DemoUAFHigh
[ DISABLED ] AddressSanitizer.DISABLED_DemoOOM
[ DISABLED ] AddressSanitizer.DISABLED_DemoDoubleFreeTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoNullDerefTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoFunctionStaticTest
[ DISABLED ] AddressSanitizer.DISABLED_DemoTooMuchMemoryTest
[ RUN      ] AddressSanitizer.LongDoubleNegativeTest
[       OK ] AddressSanitizer.LongDoubleNegativeTest (0 ms)
[----------] 19 tests from AddressSanitizer (27860 ms total)

[----------] Global test environment tear-down
[==========] 22 tests from 2 test suites ran. (27863 ms total)
[  PASSED  ] 22 tests.

  YOU HAVE 1 DISABLED TEST
program finished with exit code 1
elapsedTime=2217.288523

@andykaylor
Copy link
Contributor Author

…aha, it looks it's behind CLANG_ENABLE_CIR already.

Yes. CLANG_ENABLE_CIR brings in the MLIR dependency and a whole bunch of ClangIR code that needs it. This was just the first unit test associated with that code. If I missed something that leads to a rogue MLIR dependency because of this change, I would certainly want to fix that.

@andykaylor andykaylor deleted the cir-pointer-like branch May 16, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants