xref: /llvm-project/libc/test/src/stdlib/_Exit_test.cpp (revision 33bdb53d864e3e244d8fd5649062f17b7d4c958d)
166d00febSPaula Toth //===-- Unittests for _Exit -----------------------------------------------===//
2a499d680SAlex Brachet //
3a499d680SAlex Brachet // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4a499d680SAlex Brachet // See https://llvm.org/LICENSE.txt for license information.
5a499d680SAlex Brachet // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6a499d680SAlex Brachet //
7a499d680SAlex Brachet //===----------------------------------------------------------------------===//
8a499d680SAlex Brachet 
9a499d680SAlex Brachet #include "src/stdlib/_Exit.h"
10d6698386SAlex Brachet #include "src/stdlib/exit.h"
11af1315c2SSiva Chandra Reddy #include "test/UnitTest/Test.h"
12a499d680SAlex Brachet 
131df0dbfcSMichael Jones TEST(LlvmLibcStdlib, _Exit) {
14*b6bc9d72SGuillaume Chatelet   EXPECT_EXITS([] { LIBC_NAMESPACE::_Exit(1); }, 1);
15*b6bc9d72SGuillaume Chatelet   EXPECT_EXITS([] { LIBC_NAMESPACE::_Exit(65); }, 65);
16d6698386SAlex Brachet 
17*b6bc9d72SGuillaume Chatelet   EXPECT_EXITS([] { LIBC_NAMESPACE::exit(1); }, 1);
18*b6bc9d72SGuillaume Chatelet   EXPECT_EXITS([] { LIBC_NAMESPACE::exit(65); }, 65);
19a499d680SAlex Brachet }
20