about summary refs log tree commit diff homepage
path: root/test/CXX/symex/libc++/atexit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/symex/libc++/atexit.cpp')
-rw-r--r--test/CXX/symex/libc++/atexit.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CXX/symex/libc++/atexit.cpp b/test/CXX/symex/libc++/atexit.cpp
new file mode 100644
index 00000000..3d9e6834
--- /dev/null
+++ b/test/CXX/symex/libc++/atexit.cpp
@@ -0,0 +1,15 @@
+// RUN: sh %S/compile_with_libcxx.sh "%llvmgxx" "%s" "%S" "%t" "%klee" "%libcxx_include" | FileCheck %s
+//
+// CHECK: Returning from main
+// CHECK: atexit_1
+// CHECK: atexit_2
+
+#include <iostream>
+#include <cstdlib>
+
+int main(int argc, char** args){
+  auto atexithandler2 = std::atexit([](){std::cout << "atexit_2" << std::endl;});
+  auto atexithandler1 = std::atexit([](){std::cout << "atexit_1" << std::endl;});
+  std::cout << "Returning from main" << std::endl;
+  return 0;
+}