| 1 |
/// -fprofile-update=atomic requires the (potentially concurrent) counter updates to be atomic. |
| 2 |
// RUN: %clang_cc1 %s -triple x86_64 -emit-llvm -fprofile-update=atomic \ |
| 3 |
// RUN: -coverage-notes-file=/dev/null -coverage-data-file=/dev/null -o - | FileCheck %s |
| 4 |
|
| 5 |
// CHECK-LABEL: void @foo() |
| 6 |
/// Two counters are incremented by __tsan_atomic64_fetch_add. |
| 7 |
// CHECK: atomicrmw add ptr @__llvm_gcov_ctr{{.*}} monotonic, align 8 |
| 8 |
// CHECK-NEXT: atomicrmw sub ptr |
| 9 |
|
| 10 |
_Atomic(int) cnt; |
| 11 |
void foo(void) { cnt--; } |