2 changes: 1 addition & 1 deletion libc/src/string/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ add_entrypoint_object(
DEPENDS
.memory_utils.inline_memcpy
.string_utils
libc.include.stdlib
libc.hdr.stdlib_macros
libc.src.errno.errno
libc.include.llvm-libc-types.size_t
)
Expand Down
3 changes: 1 addition & 2 deletions libc/src/string/strdup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
//===----------------------------------------------------------------------===//

#include "src/string/strdup.h"
#include "hdr/stdlib_macros.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include "src/string/allocating_string_utils.h"
#include "src/string/memory_utils/inline_memcpy.h"

#include "src/__support/common.h"

#include <stdlib.h>

namespace LIBC_NAMESPACE_DECL {

LLVM_LIBC_FUNCTION(char *, strdup, (const char *src)) {
Expand Down
1 change: 0 additions & 1 deletion libc/src/unistd/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ add_entrypoint_object(
HDRS
../getcwd.h
DEPENDS
libc.include.stdlib
libc.include.unistd
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
Expand Down
1 change: 0 additions & 1 deletion libc/src/unistd/linux/getcwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include "src/errno/libc_errno.h"
#include <linux/limits.h> // This is safe to include without any name pollution.
#include <stdlib.h>
#include <sys/syscall.h> // For syscall numbers.

namespace LIBC_NAMESPACE_DECL {
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/__support/File/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_libc_test(
LibcMemoryHelpers
DEPENDS
libc.include.stdio
libc.include.stdlib
libc.hdr.types.size_t
libc.src.errno.errno
libc.src.__support.CPP.new
libc.src.__support.File.file
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/__support/File/file_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "test/UnitTest/MemoryMatcher.h"
#include "test/UnitTest/Test.h"

#include <stdlib.h>
#include "hdr/types/size_t.h"

using ModeFlags = LIBC_NAMESPACE::File::ModeFlags;
using MemoryView = LIBC_NAMESPACE::testing::MemoryView;
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/__support/str_to_float_comparison_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// #include "src/__support/str_float_conv_utils.h"

#include <stdlib.h>
#include <stdlib.h> // For string to float functions

// #include "src/__support/FPUtil/FPBits.h"

Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ add_libc_test(
fopencookie_test.cpp
DEPENDS
libc.include.stdio
libc.include.stdlib
libc.hdr.types.size_t
libc.src.errno.errno
libc.src.stdio.clearerr
libc.src.stdio.fclose
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdio/fopencookie_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include "test/UnitTest/Test.h"

#include "hdr/stdio_macros.h"
#include "hdr/types/size_t.h"
#include "src/errno/libc_errno.h"
#include <stdlib.h>

using MemoryView = LIBC_NAMESPACE::testing::MemoryView;

Expand Down
13 changes: 5 additions & 8 deletions libc/test/src/stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ add_libc_test(
HDRS
DivTest.h
DEPENDS
libc.include.stdlib
libc.hdr.types.div_t
libc.src.stdlib.div
)

Expand All @@ -272,7 +272,7 @@ add_libc_test(
HDRS
DivTest.h
DEPENDS
libc.include.stdlib
libc.hdr.types.ldiv_t
libc.src.stdlib.ldiv
)

Expand All @@ -285,7 +285,7 @@ add_libc_test(
HDRS
DivTest.h
DEPENDS
libc.include.stdlib
libc.hdr.types.lldiv_t
libc.src.stdlib.lldiv
)

Expand All @@ -296,7 +296,7 @@ add_libc_test(
SRCS
bsearch_test.cpp
DEPENDS
libc.include.stdlib
libc.hdr.types.size_t
libc.src.stdlib.bsearch
)

Expand Down Expand Up @@ -343,7 +343,7 @@ add_libc_test(
SRCS
qsort_r_test.cpp
DEPENDS
libc.include.stdlib
libc.hdr.types.size_t
libc.src.stdlib.qsort_r
)

Expand All @@ -354,7 +354,6 @@ add_libc_test(
SRCS
rand_test.cpp
DEPENDS
libc.include.stdlib
libc.src.stdlib.rand
libc.src.stdlib.srand
)
Expand All @@ -370,7 +369,6 @@ if(LLVM_LIBC_FULL_BUILD)
SRCS
_Exit_test.cpp
DEPENDS
libc.include.stdlib
libc.src.stdlib._Exit
libc.src.stdlib.exit
)
Expand Down Expand Up @@ -414,7 +412,6 @@ if(LLVM_LIBC_FULL_BUILD)
SRCS
abort_test.cpp
DEPENDS
libc.include.stdlib
libc.include.signal
libc.src.stdlib.abort
libc.src.stdlib._Exit
Expand Down
2 changes: 0 additions & 2 deletions libc/test/src/stdlib/_Exit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include "src/stdlib/exit.h"
#include "test/UnitTest/Test.h"

#include <stdlib.h>

TEST(LlvmLibcStdlib, _Exit) {
EXPECT_EXITS([] { LIBC_NAMESPACE::_Exit(1); }, 1);
EXPECT_EXITS([] { LIBC_NAMESPACE::_Exit(65); }, 65);
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/stdlib/abort_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "test/UnitTest/Test.h"

#include <signal.h>
#include <stdlib.h>

TEST(LlvmLibcStdlib, abort) {
// -1 matches against any signal, which is necessary for now until
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/stdlib/bsearch_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "test/UnitTest/Test.h"

#include <stdlib.h>
#include "hdr/types/size_t.h"

static int int_compare(const void *l, const void *r) {
int li = *reinterpret_cast<const int *>(l);
Expand Down
3 changes: 1 addition & 2 deletions libc/test/src/stdlib/div_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

#include "DivTest.h"

#include "hdr/types/div_t.h"
#include "src/stdlib/div.h"

#include <stdlib.h>

LIST_DIV_TESTS(int, div_t, LIBC_NAMESPACE::div)
3 changes: 1 addition & 2 deletions libc/test/src/stdlib/ldiv_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

#include "DivTest.h"

#include "hdr/types/ldiv_t.h"
#include "src/stdlib/ldiv.h"

#include <stdlib.h>

LIST_DIV_TESTS(long, ldiv_t, LIBC_NAMESPACE::ldiv)
3 changes: 1 addition & 2 deletions libc/test/src/stdlib/lldiv_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

#include "DivTest.h"

#include "hdr/types/lldiv_t.h"
#include "src/stdlib/lldiv.h"

#include <stdlib.h>

LIST_DIV_TESTS(long long, lldiv_t, LIBC_NAMESPACE::lldiv)
2 changes: 1 addition & 1 deletion libc/test/src/stdlib/qsort_r_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "test/UnitTest/Test.h"

#include <stdlib.h>
#include "hdr/types/size_t.h"

static int int_compare_count(const void *l, const void *r, void *count_arg) {
int li = *reinterpret_cast<const int *>(l);
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/stdlib/rand_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "test/UnitTest/Test.h"

#include <stddef.h>
#include <stdlib.h>

TEST(LlvmLibcRandTest, UnsetSeed) {
static int vals[1000];
Expand Down
2 changes: 0 additions & 2 deletions libc/test/src/string/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ add_libc_test(
SRCS
strdup_test.cpp
DEPENDS
libc.include.stdlib
libc.src.string.strdup
libc.src.errno.errno
)
Expand Down Expand Up @@ -315,7 +314,6 @@ add_libc_test(
SRCS
strndup_test.cpp
DEPENDS
libc.include.stdlib
libc.src.string.strndup
)

Expand Down
2 changes: 0 additions & 2 deletions libc/test/src/string/strdup_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include "src/string/strdup.h"
#include "test/UnitTest/Test.h"

#include <stdlib.h>

TEST(LlvmLibcStrDupTest, EmptyString) {
const char *empty = "";

Expand Down
1 change: 0 additions & 1 deletion libc/test/src/string/strlcat_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "src/string/strlcat.h"
#include "test/UnitTest/Test.h"
#include <stdlib.h>

TEST(LlvmLibcStrlcatTest, TooBig) {
const char *str = "cd";
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/string/strlcpy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "src/string/strlcpy.h"
#include "test/UnitTest/Test.h"
#include <stdlib.h>

TEST(LlvmLibcStrlcpyTest, TooBig) {
const char *str = "abc";
Expand Down
1 change: 0 additions & 1 deletion libc/test/src/string/strndup_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "src/string/strndup.h"
#include "test/UnitTest/Test.h"
#include <stdlib.h>

TEST(LlvmLibcstrndupTest, EmptyString) {
const char *empty = "";
Expand Down