Skip to content

[libc] Remove _Exit proxy func header and use LIBC_NAMESPACE::_Exit in tests #114904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
2 commits merged into from Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions libc/hdr/func/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,3 @@ add_proxy_header_library(
FULL_BUILD_DEPENDS
libc.include.stdlib
)

add_proxy_header_library(
_Exit
HDRS
_Exit.h
DEPENDS
libc.hdr.stdlib_overlay
FULL_BUILD_DEPENDS
libc.include.stdlib
)
22 changes: 0 additions & 22 deletions libc/hdr/func/_Exit.h

This file was deleted.

3 changes: 1 addition & 2 deletions libc/test/src/stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ if(LLVM_LIBC_FULL_BUILD)
SRCS
atexit_test.cpp
DEPENDS
libc.hdr.func._Exit
libc.src.stdlib._Exit
libc.src.stdlib.exit
libc.src.stdlib.atexit
Expand All @@ -398,7 +397,7 @@ if(LLVM_LIBC_FULL_BUILD)
SRCS
at_quick_exit_test.cpp
DEPENDS
libc.hdr.func._Exit
libc.src.stdlib._Exit
libc.src.stdlib.quick_exit
libc.src.stdlib.at_quick_exit
libc.src.__support.CPP.array
Expand Down
3 changes: 1 addition & 2 deletions libc/test/src/stdlib/at_quick_exit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//

#include "hdr/func/_Exit.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/utility.h"
#include "src/stdlib/at_quick_exit.h"
Expand Down Expand Up @@ -34,7 +33,7 @@ TEST(LlvmLibcAtQuickExit, Basic) {

TEST(LlvmLibcAtQuickExit, AtQuickExitCallsSysExit) {
auto test = [] {
LIBC_NAMESPACE::at_quick_exit(+[] { _Exit(1); });
LIBC_NAMESPACE::at_quick_exit(+[] { LIBC_NAMESPACE::_Exit(1); });
LIBC_NAMESPACE::quick_exit(0);
};
EXPECT_EXITS(test, 1);
Expand Down
3 changes: 1 addition & 2 deletions libc/test/src/stdlib/atexit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//
//===----------------------------------------------------------------------===//

#include "hdr/func/_Exit.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you need to include _Exit here explicitly (#include "src/stdlib/_Exit.h). Applies to both tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok will fix it right now

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im working on it now. its building in full build mode

#include "src/__support/CPP/array.h"
#include "src/__support/CPP/utility.h"
#include "src/stdlib/atexit.h"
Expand Down Expand Up @@ -34,7 +33,7 @@ TEST(LlvmLibcAtExit, Basic) {

TEST(LlvmLibcAtExit, AtExitCallsSysExit) {
auto test = [] {
LIBC_NAMESPACE::atexit(+[] { _Exit(1); });
LIBC_NAMESPACE::atexit(+[] { LIBC_NAMESPACE::_Exit(1); });
LIBC_NAMESPACE::exit(0);
};
EXPECT_EXITS(test, 1);
Expand Down
Loading