Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / atexit3.cpp
blob43ba5bbf6919f03563adde886be5d04943cacb16
1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
3 #include <stdio.h>
4 #include <stdlib.h>
6 static void atexit5() {
7 fprintf(stderr, "5");
10 static void atexit4() {
11 fprintf(stderr, "4");
14 static void atexit3() {
15 fprintf(stderr, "3");
18 static void atexit2() {
19 fprintf(stderr, "2");
22 static void atexit1() {
23 fprintf(stderr, "1");
26 static void atexit0() {
27 fprintf(stderr, "\n");
30 int main() {
31 atexit(atexit0);
32 atexit(atexit1);
33 atexit(atexit2);
34 atexit(atexit3);
35 atexit(atexit4);
36 atexit(atexit5);
39 // CHECK-NOT: FATAL: ThreadSanitizer
40 // CHECK-NOT: WARNING: ThreadSanitizer
41 // CHECK: 54321