From 43de233e294530eef37cc185b5699ad60289803e Mon Sep 17 00:00:00 2001 From: Siva Chandra Reddy Date: Sun, 5 Mar 2023 00:23:48 +0000 Subject: [PATCH] [libc][NFC] Remove allocator definition in the api-test. The integration tests already have allocators so we will get all of them from there. --- libc/test/IntegrationTest/test.cpp | 5 +++++ libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libc/test/IntegrationTest/test.cpp b/libc/test/IntegrationTest/test.cpp index 3de4fa7..53f9c95 100644 --- a/libc/test/IntegrationTest/test.cpp +++ b/libc/test/IntegrationTest/test.cpp @@ -29,4 +29,9 @@ void *malloc(size_t s) { void free(void *) {} +void *realloc(void *ptr, size_t s) { + free(ptr); + return malloc(s); +} + } // extern "C" diff --git a/libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp b/libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp index 667d4eb..86f0220 100644 --- a/libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp +++ b/libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp @@ -95,12 +95,6 @@ bool TestGeneratorMain(llvm::raw_ostream &OS, llvm::RecordKeeper &records) { OS << " return 0;\n"; OS << "}\n\n"; - // We provide dummy malloc and free implementations to support the case - // when LLVM libc does to include them. - OS << "void *malloc(size_t) __NOEXCEPT { return nullptr; }\n"; - OS << "void *realloc(void *, size_t) __NOEXCEPT { return nullptr; }\n"; - OS << "void free(void *) __NOEXCEPT {}\n"; - return false; } -- 2.7.4