quick_exit_check2.fail.cpp 657 B

1234567891011121314151617181920212223242526
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // UNSUPPORTED: c++98, c++03
  9. // test that referencing quick_exit when _LIBCPP_HAS_QUICK_EXIT is not defined
  10. // results in a compile error.
  11. #include <cstdlib>
  12. void f() {}
  13. int main(int, char**)
  14. {
  15. #ifndef _LIBCPP_HAS_QUICK_EXIT
  16. std::quick_exit(0);
  17. #else
  18. #error
  19. #endif
  20. return 0;
  21. }