2013-12-11 16:18:50 +08:00
|
|
|
// Test that we can include header with TSan atomic interface.
|
2014-05-01 05:34:17 +08:00
|
|
|
// RUN: %clang_tsan %s -o %t && %run %t | FileCheck %s
|
2013-12-11 16:18:50 +08:00
|
|
|
#include <sanitizer/tsan_interface_atomic.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
__tsan_atomic32 a;
|
|
|
|
__tsan_atomic32_store(&a, 100, __tsan_memory_order_release);
|
|
|
|
int res = __tsan_atomic32_load(&a, __tsan_memory_order_acquire);
|
|
|
|
if (res == 100) {
|
|
|
|
// CHECK: PASS
|
|
|
|
printf("PASS\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|