aboutsummaryrefslogtreecommitdiff
path: root/final/ABI-Testsuite/test/s3_3_5/lambda.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'final/ABI-Testsuite/test/s3_3_5/lambda.cpp')
-rwxr-xr-xfinal/ABI-Testsuite/test/s3_3_5/lambda.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/final/ABI-Testsuite/test/s3_3_5/lambda.cpp b/final/ABI-Testsuite/test/s3_3_5/lambda.cpp
new file mode 100755
index 00000000..cb4041fd
--- /dev/null
+++ b/final/ABI-Testsuite/test/s3_3_5/lambda.cpp
@@ -0,0 +1,24 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler %s -c cxx_11 -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out |FileCheck %s
+
+// section 1: testing number of functions registered with atexit()
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void fn01() { printf("%s()", __FUNCTION__); }
+void fn02() { printf("%s()", __FUNCTION__); }
+
+int main(int argc, char *argv[]) {
+ printf("main()");
+
+ // CHECK: main()fn02()operator()()fn01()
+ atexit(fn01);
+ atexit([]() { printf("%s()", __FUNCTION__); });
+ atexit(fn02);
+
+ return 0;
+}