llvm-project/clang/test/CodeGen/code-coverage-tsan.c
Fangrui Song 71a35f7e3d [gcov] Simplify cc1 options and remove CodeGenOptions EmitCovNotes/EmitCovArcs
After a07b135ce0c0111bd83450b5dc29ef0381cdbc39, we always pass
-coverage-notes-file/-coverage-data-file for driver options
-ftest-coverage/-fprofile-arcs/--coverage. As a bonus, we can make the following
simplification to cc1 options:

* `-ftest-coverage -coverage-notes-file a.gcno` => `-coverage-notes-file a.gcno`
* `-fprofile-arcs -coverage-data-file a.gcda` => `-coverage-data-file a.gcda`

and remove EmitCovNotes/EmitCovArcs.
2023-05-17 16:09:12 -07:00

13 lines
547 B
C

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