[llvm] [llubi] Implements common library functions (PR #190147)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 10:58:19 PDT 2026


================
@@ -0,0 +1,13 @@
+; NOTE: Assertions have been autogenerated by utils/update_llubi_test_checks.py UTC_ARGS: --version 6
+; RUN: not llubi --verbose < %s 2>&1 | FileCheck %s
+
+declare ptr @calloc(i64, i64)
+
+define void @main() {
+entry:
+  %ptr = call ptr @calloc(i64 -1, i64 2)
+  ret void
+}
+; CHECK: Entering function: main
+; CHECK-NEXT: Immediate UB detected: calloc() with allocation size that overflows size_t.
----------------
dtcxzyw wrote:

Shouldn't it simply return null?


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


More information about the llvm-commits mailing list