[clang] [CIR] Implement __builtin_object_size and __builtin_dynamic_object_size (PR #166191)

Morris Hafner via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 5 00:29:51 PST 2025


================
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s --check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll
+// RUN: FileCheck --input-file=%t-cir.ll %s --check-prefix=LLVM
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
+// RUN: FileCheck --input-file=%t.ll %s --check-prefix=OGCG
+
+typedef unsigned long size_t;
----------------
mmha wrote:

Done. Only two things not working were DerivedToBase casts and void pointer arithmetic.

https://github.com/llvm/llvm-project/pull/166191


More information about the cfe-commits mailing list