You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
634 B

// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <stdlib.h>
static void atexit5() {
fprintf(stderr, "5");
}
static void atexit4() {
fprintf(stderr, "4");
}
static void atexit3() {
fprintf(stderr, "3");
}
static void atexit2() {
fprintf(stderr, "2");
}
static void atexit1() {
fprintf(stderr, "1");
}
static void atexit0() {
fprintf(stderr, "\n");
}
int main() {
atexit(atexit0);
atexit(atexit1);
atexit(atexit2);
atexit(atexit3);
atexit(atexit4);
atexit(atexit5);
}
// CHECK-NOT: FATAL: ThreadSanitizer
// CHECK-NOT: WARNING: ThreadSanitizer
// CHECK: 54321