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