summaryrefslogtreecommitdiff
path: root/libc/test/src/stdlib/_Exit_test.cpp
diff options
context:
space:
mode:
authorAlex Brachet <alexbrachetmialot@gmail.com>2020-03-05 14:21:18 -0500
committerAlex Brachet <alexbrachetmialot@gmail.com>2020-03-05 14:21:18 -0500
commita499d6805664350095658878e25f6ae20a106748 (patch)
tree51b9d4e29320bef530f6abb633103d2be01e9a6f /libc/test/src/stdlib/_Exit_test.cpp
parentef4282e0ee2d6539bbb92447a7464d9d089409f1 (diff)
[libc] Create abort and _Exit
This revision creates abort and _Exit implementations Differential Revision: https://reviews.llvm.org/D74949
Diffstat (limited to 'libc/test/src/stdlib/_Exit_test.cpp')
-rw-r--r--libc/test/src/stdlib/_Exit_test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/libc/test/src/stdlib/_Exit_test.cpp b/libc/test/src/stdlib/_Exit_test.cpp
new file mode 100644
index 000000000000..49878bfd506e
--- /dev/null
+++ b/libc/test/src/stdlib/_Exit_test.cpp
@@ -0,0 +1,16 @@
+//===----------------------- Unittests for _Exit --------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "include/stdlib.h"
+#include "src/stdlib/_Exit.h"
+#include "utils/UnitTest/Test.h"
+
+TEST(Stdlib, _Exit) {
+ EXPECT_EXITS([] { __llvm_libc::_Exit(1); }, 1);
+ EXPECT_EXITS([] { __llvm_libc::_Exit(65); }, 65);
+}