libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

terminate.pass.cpp (553B)


      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // test terminate
     11 
     12 #include <exception>
     13 #include <cstdlib>
     14 #include <cassert>
     15 
     16 void f1()
     17 {
     18     std::exit(0);
     19 }
     20 
     21 int main()
     22 {
     23     std::set_terminate(f1);
     24     std::terminate();
     25     assert(false);
     26 }