xref: /llvm-project/libc/test/src/stdlib/quick_exit_test.cpp (revision 07bd43945789e3fc8f57d21484a7f683d17166f3)
1*07bd4394SRoseZhang03 //===-- Unittests for quick_exit ------------------------------------------===//
2*07bd4394SRoseZhang03 //
3*07bd4394SRoseZhang03 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*07bd4394SRoseZhang03 // See https://llvm.org/LICENSE.txt for license information.
5*07bd4394SRoseZhang03 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*07bd4394SRoseZhang03 //
7*07bd4394SRoseZhang03 //===----------------------------------------------------------------------===//
8*07bd4394SRoseZhang03 
9*07bd4394SRoseZhang03 #include "src/stdlib/exit.h"
10*07bd4394SRoseZhang03 #include "src/stdlib/quick_exit.h"
11*07bd4394SRoseZhang03 #include "test/UnitTest/Test.h"
12*07bd4394SRoseZhang03 
TEST(LlvmLibcStdlib,quick_exit)13*07bd4394SRoseZhang03 TEST(LlvmLibcStdlib, quick_exit) {
14*07bd4394SRoseZhang03   EXPECT_EXITS([] { LIBC_NAMESPACE::quick_exit(1); }, 1);
15*07bd4394SRoseZhang03   EXPECT_EXITS([] { LIBC_NAMESPACE::quick_exit(65); }, 65);
16*07bd4394SRoseZhang03 }
17