Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / atexit.cpp
blob69acb4dd783fd462c3de76f829093d1907f9a46a
1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
3 #include <stdio.h>
4 #include <stdlib.h>
6 class Logger {
7 public:
8 Logger() {
9 fprintf(stderr, "Logger ctor\n");
12 ~Logger() {
13 fprintf(stderr, "Logger dtor\n");
17 Logger logger;
19 void log_from_atexit() {
20 fprintf(stderr, "In log_from_atexit\n");
23 int main() {
24 atexit(log_from_atexit);
27 // CHECK: Logger ctor
28 // CHECK: In log_from_atexit
29 // CHECK: Logger dtor