150
|
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 static void atexit5() {
|
|
7 fprintf(stderr, "5");
|
|
8 }
|
|
9
|
|
10 static void atexit4() {
|
|
11 fprintf(stderr, "4");
|
|
12 }
|
|
13
|
|
14 static void atexit3() {
|
|
15 fprintf(stderr, "3");
|
|
16 }
|
|
17
|
|
18 static void atexit2() {
|
|
19 fprintf(stderr, "2");
|
|
20 }
|
|
21
|
|
22 static void atexit1() {
|
|
23 fprintf(stderr, "1");
|
|
24 }
|
|
25
|
|
26 static void atexit0() {
|
|
27 fprintf(stderr, "\n");
|
|
28 }
|
|
29
|
|
30 int main() {
|
|
31 atexit(atexit0);
|
|
32 atexit(atexit1);
|
|
33 atexit(atexit2);
|
|
34 atexit(atexit3);
|
|
35 atexit(atexit4);
|
|
36 atexit(atexit5);
|
|
37 }
|
|
38
|
|
39 // CHECK-NOT: FATAL: ThreadSanitizer
|
|
40 // CHECK-NOT: WARNING: ThreadSanitizer
|
|
41 // CHECK: 54321
|