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