[compiler-rt] [asan] Change zero_alloc.cpp testcase to use stdlib.h, re-enable on Mac (PR #156490)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 09:52:20 PDT 2025


https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/156490

Avoid build breakage on Mac (reported at https://github.com/llvm/llvm-project/pull/155943#issuecomment-3244593484)

>From 3d7e37fff91ad0fa26e65e440f3af38fa1cd8e7b Mon Sep 17 00:00:00 2001
From: Thurston Dang <thurston at google.com>
Date: Tue, 2 Sep 2025 16:49:04 +0000
Subject: [PATCH] [asan] Change zero_alloc.cpp testcase to use stdlib.h,
 re-enable on Mac

Avoid build breakage on Mac (reported at https://github.com/llvm/llvm-project/pull/155943#issuecomment-3244593484)
---
 compiler-rt/test/asan/TestCases/zero_alloc.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/compiler-rt/test/asan/TestCases/zero_alloc.cpp b/compiler-rt/test/asan/TestCases/zero_alloc.cpp
index 1cd00732a48e5..aa807f44ed3b3 100644
--- a/compiler-rt/test/asan/TestCases/zero_alloc.cpp
+++ b/compiler-rt/test/asan/TestCases/zero_alloc.cpp
@@ -1,10 +1,7 @@
 // RUN: %clang_asan -Wno-alloc-size -fsanitize-recover=address %s -o %t && %env_asan_opts=halt_on_error=0 %run %t 2>&1 | FileCheck %s
 
-// UNSUPPORTED: darwin
-// UNSUPPORTED: ios
-
-#include <malloc.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 int main(int argc, char **argv) {
   {



More information about the llvm-commits mailing list