1 | // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s |
2 | |
3 | #include <stdio.h> |
4 | #include <stdlib.h> |
5 | |
6 | class Logger { |
7 | public: |
8 | Logger() { |
9 | fprintf(stderr, format: "Logger ctor\n" ); |
10 | } |
11 | |
12 | ~Logger() { |
13 | fprintf(stderr, format: "Logger dtor\n" ); |
14 | } |
15 | }; |
16 | |
17 | Logger logger; |
18 | |
19 | void log_from_atexit() { |
20 | fprintf(stderr, format: "In log_from_atexit\n" ); |
21 | } |
22 | |
23 | int main() { |
24 | atexit(func: log_from_atexit); |
25 | } |
26 | |
27 | // CHECK: Logger ctor |
28 | // CHECK: In log_from_atexit |
29 | // CHECK: Logger dtor |
30 | |