summaryrefslogtreecommitdiff
path: root/tests/stdlib_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib_test.cpp')
-rw-r--r--tests/stdlib_test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp
index 3a3fe28ae..bb395f04f 100644
--- a/tests/stdlib_test.cpp
+++ b/tests/stdlib_test.cpp
@@ -202,3 +202,17 @@ TEST(stdlib, strtof) {
TEST(stdlib, strtold) {
ASSERT_DOUBLE_EQ(1.23, strtold("1.23", NULL));
}
+
+TEST(unistd, _Exit) {
+ int pid = fork();
+ ASSERT_NE(-1, pid) << strerror(errno);
+
+ if (pid == 0) {
+ _Exit(99);
+ }
+
+ int status;
+ ASSERT_EQ(pid, waitpid(pid, &status, 0));
+ ASSERT_TRUE(WIFEXITED(status));
+ ASSERT_EQ(99, WEXITSTATUS(status));
+}