[libc-commits] [libc] 710ffb6 - [libc] Fix warnings for freelist_heap_test/fuzz (#136634)

via libc-commits libc-commits at lists.llvm.org
Tue Apr 22 11:11:34 PDT 2025


Author: Daniel Thornburgh
Date: 2025-04-22T11:11:31-07:00
New Revision: 710ffb69bfdc9281eaaad267ad85ca60ddbb94f0

URL: https://github.com/llvm/llvm-project/commit/710ffb69bfdc9281eaaad267ad85ca60ddbb94f0
DIFF: https://github.com/llvm/llvm-project/commit/710ffb69bfdc9281eaaad267ad85ca60ddbb94f0.diff

LOG: [libc] Fix warnings for freelist_heap_test/fuzz (#136634)

Fixes #122367

Added: 
    

Modified: 
    libc/fuzzing/__support/CMakeLists.txt
    libc/fuzzing/__support/freelist_heap_fuzz.cpp
    libc/test/src/__support/CMakeLists.txt
    libc/test/src/__support/freelist_heap_test.cpp

Removed: 
    libc/fuzzing/__support/fake_heap.s
    libc/test/src/__support/fake_heap.s


################################################################################
diff  --git a/libc/fuzzing/__support/CMakeLists.txt b/libc/fuzzing/__support/CMakeLists.txt
index 7742ee43860d5..cfe51605ed2aa 100644
--- a/libc/fuzzing/__support/CMakeLists.txt
+++ b/libc/fuzzing/__support/CMakeLists.txt
@@ -30,7 +30,6 @@ if(LLVM_LIBC_FULL_BUILD AND NOT LIBC_TARGET_OS_IS_GPU)
   add_libc_fuzzer(
     freelist_heap_fuzz
     SRCS
-      fake_heap.s
       freelist_heap_fuzz.cpp
     DEPENDS
       libc.src.__support.freelist_heap

diff  --git a/libc/fuzzing/__support/fake_heap.s b/libc/fuzzing/__support/fake_heap.s
deleted file mode 100644
index 69522f53c8b1f..0000000000000
--- a/libc/fuzzing/__support/fake_heap.s
+++ /dev/null
@@ -1,15 +0,0 @@
-//===-- Test fake definition for heap symbols -----------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-.globl _end, __llvm_libc_heap_limit
-
-.bss
-_end:
-.fill 1024
-__llvm_libc_heap_limit:
-

diff  --git a/libc/fuzzing/__support/freelist_heap_fuzz.cpp b/libc/fuzzing/__support/freelist_heap_fuzz.cpp
index d152d0f35499f..7b7985a83c3e6 100644
--- a/libc/fuzzing/__support/freelist_heap_fuzz.cpp
+++ b/libc/fuzzing/__support/freelist_heap_fuzz.cpp
@@ -17,6 +17,15 @@
 #include "src/string/memory_utils/inline_memmove.h"
 #include "src/string/memory_utils/inline_memset.h"
 
+asm(R"(
+.globl _end, __llvm_libc_heap_limit
+
+.bss
+_end:
+  .fill 1024
+__llvm_libc_heap_limit:
+)";
+
 using LIBC_NAMESPACE::FreeListHeap;
 using LIBC_NAMESPACE::inline_memset;
 using LIBC_NAMESPACE::cpp::nullopt;

diff  --git a/libc/test/src/__support/CMakeLists.txt b/libc/test/src/__support/CMakeLists.txt
index b50bf245f202c..c1736c8fe59e2 100644
--- a/libc/test/src/__support/CMakeLists.txt
+++ b/libc/test/src/__support/CMakeLists.txt
@@ -63,7 +63,6 @@ if(LLVM_LIBC_FULL_BUILD AND NOT LIBC_TARGET_OS_IS_GPU)
     SUITE
       libc-support-tests
     SRCS
-      fake_heap.s
       freelist_heap_test.cpp
     DEPENDS
       libc.src.__support.CPP.span

diff  --git a/libc/test/src/__support/fake_heap.s b/libc/test/src/__support/fake_heap.s
deleted file mode 100644
index 69522f53c8b1f..0000000000000
--- a/libc/test/src/__support/fake_heap.s
+++ /dev/null
@@ -1,15 +0,0 @@
-//===-- Test fake definition for heap symbols -----------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-.globl _end, __llvm_libc_heap_limit
-
-.bss
-_end:
-.fill 1024
-__llvm_libc_heap_limit:
-

diff  --git a/libc/test/src/__support/freelist_heap_test.cpp b/libc/test/src/__support/freelist_heap_test.cpp
index 0623272dd5b9f..93e23619661a0 100644
--- a/libc/test/src/__support/freelist_heap_test.cpp
+++ b/libc/test/src/__support/freelist_heap_test.cpp
@@ -13,6 +13,15 @@
 #include "src/string/memcpy.h"
 #include "test/UnitTest/Test.h"
 
+asm(R"(
+.globl _end, __llvm_libc_heap_limit
+
+.bss
+_end:
+  .fill 1024
+__llvm_libc_heap_limit:
+)");
+
 using LIBC_NAMESPACE::Block;
 using LIBC_NAMESPACE::freelist_heap;
 using LIBC_NAMESPACE::FreeListHeap;


        


More information about the libc-commits mailing list