about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2023-05-13 11:05:34 +0530
committerGitHub <noreply@github.com>2023-05-13 11:05:34 +0530
commit770fd738c7939701b5ecd996073a97d9ff60cf80 (patch)
treeae415683bfbcdcee08457e027c0ff937597bea50 /tests
parent05ca3e31df8366578d61f35a29a17bf48b20ac48 (diff)
parent6b58ff5cdf47da9460871a87cf43e5e8adfab9a8 (diff)
downloadrust-770fd738c7939701b5ecd996073a97d9ff60cf80.tar.gz
rust-770fd738c7939701b5ecd996073a97d9ff60cf80.zip
Rollup merge of #111469 - Dushistov:fix-coverage-data-race, r=wesleywiser
Fix data race in llvm source code coverage

Fixes #91092 .

Before this patch, increment of counters for code coverage looks like this:
```
 movq    .L__profc__RNvCsd6wgJFC5r19_3lib6bugaga+8(%rip), %rax
 addq    $1, %rax
movq    %rax, .L__profc__RNvCsd6wgJFC5r19_3lib6bugaga+8(%rip)
```

after this patch:

```
lock            incq    .L__profc__RNvCs3JgIB2SjHh2_3lib6bugaga+8(%rip)
```
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make/coverage-llvmir/filecheck.testprog.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/run-make/coverage-llvmir/filecheck.testprog.txt b/tests/run-make/coverage-llvmir/filecheck.testprog.txt
index c943261d799..b3a8808df05 100644
--- a/tests/run-make/coverage-llvmir/filecheck.testprog.txt
+++ b/tests/run-make/coverage-llvmir/filecheck.testprog.txt
@@ -36,7 +36,7 @@ CHECK-SAME:   section "llvm.metadata"
 CHECK:        [[DEFINE_INTERNAL]] { {{.*}} } @_R{{[a-zA-Z0-9_]+}}testprog14will_be_called() unnamed_addr #{{[0-9]+}} {
 CHECK-NEXT:   start:
 CHECK-NOT:    [[DEFINE_INTERNAL]]
-CHECK:        %pgocount = load i64, {{i64\*|ptr}}
+CHECK:        atomicrmw add ptr
 CHECK-SAME:   @__profc__R{{[a-zA-Z0-9_]+}}testprog14will_be_called,
 
 CHECK:        declare void @llvm.instrprof.increment({{i8\*|ptr}}, i64, i32, i32) #[[LLVM_INSTRPROF_INCREMENT_ATTR:[0-9]+]]