quick_exit_check1.fail.cpp 666 B

123456789101112131415161718192021222324252627
  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. //
  9. // UNSUPPORTED: c++98, c++03
  10. // test that referencing at_quick_exit when _LIBCPP_HAS_QUICK_EXIT is not defined
  11. // results in a compile error.
  12. #include <cstdlib>
  13. void f() {}
  14. int main(int, char**)
  15. {
  16. #ifndef _LIBCPP_HAS_QUICK_EXIT
  17. std::at_quick_exit(f);
  18. #else
  19. #error
  20. #endif
  21. return 0;
  22. }