[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git] / test / tsan / interface_atomic_test.c
blob7f274a0d1d41b9fb8780f71a7e42a2a99313d5fe
1 // Test that we can include header with TSan atomic interface.
2 // RUN: %clang_tsan %s -o %t && %t | FileCheck %s
3 #include <sanitizer/tsan_interface_atomic.h>
4 #include <stdio.h>
6 int main() {
7 __tsan_atomic32 a;
8 __tsan_atomic32_store(&a, 100, __tsan_memory_order_release);
9 int res = __tsan_atomic32_load(&a, __tsan_memory_order_acquire);
10 if (res == 100) {
11 // CHECK: PASS
12 printf("PASS\n");
13 return 0;
15 return 1;