diff --git a/clang/lib/CIR/CodeGen/CIRGenBuilder.h b/clang/lib/CIR/CodeGen/CIRGenBuilder.h index 7208e12fec5d..adc3bc4efc50 100644 --- a/clang/lib/CIR/CodeGen/CIRGenBuilder.h +++ b/clang/lib/CIR/CodeGen/CIRGenBuilder.h @@ -529,7 +529,8 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { bool isSized(mlir::Type ty) { if (mlir::isa(ty)) + cir::BoolType, cir::IntType, cir::CIRFPTypeInterface, + cir::ComplexType>(ty)) return true; if (mlir::isa(ty)) { return isSized(mlir::cast(ty).getElementType()); diff --git a/clang/test/CIR/CodeGen/array.cpp b/clang/test/CIR/CodeGen/array.cpp index 51e9044be202..f62a8ff49b13 100644 --- a/clang/test/CIR/CodeGen/array.cpp +++ b/clang/test/CIR/CodeGen/array.cpp @@ -90,3 +90,7 @@ void testPointerDecayedArrayMultiDimSubscriptAccess(int arr[][3]) { // CHECK: %[[#V5:]] = cir.cast(array_to_ptrdecay, %[[#V3]] : !cir.ptr>), !cir.ptr // CHECK: cir.ptr_stride(%[[#V5]] : !cir.ptr, %[[#V4]] : !s32i), !cir.ptr } + +void testArrayOfComplexType() { int _Complex a[4]; } + +// CHECK: %[[ARR:.*]] = cir.alloca !cir.array x 4>, !cir.ptr x 4>>, ["a"]