[PATCH] D14638: [tsan] Expect memmove interceptor to be called from memcpy

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 01:56:11 PST 2015


kubabrecka created this revision.
kubabrecka added reviewers: dvyukov, kcc, samsonov, glider.
kubabrecka added subscribers: llvm-commits, zaks.anna, ismailp.

On OS X, memcpy and memmove are actually aliases of the same function, so the memmove interceptor can be invoked on a call to memcpy.  This patch updates the tests to expect either memmove or memcpy on a stack trace.

http://reviews.llvm.org/D14638

Files:
  test/tsan/inlined_memcpy_race.cc
  test/tsan/memcmp_race.cc
  test/tsan/memcpy_race.cc

Index: test/tsan/memcpy_race.cc
===================================================================
--- test/tsan/memcpy_race.cc
+++ test/tsan/memcpy_race.cc
@@ -34,8 +34,8 @@
 // CHECK: addr=[[ADDR:0x[0-9,a-f]+]]
 // CHECK: WARNING: ThreadSanitizer: data race
 // CHECK:   Write of size 1 at [[ADDR]] by thread T2:
-// CHECK:     #0 memcpy
+// CHECK:     #0 {{(memcpy|memmove)}}
 // CHECK:     #1 Thread2
 // CHECK:   Previous write of size 1 at [[ADDR]] by thread T1:
-// CHECK:     #0 memcpy
+// CHECK:     #0 {{(memcpy|memmove)}}
 // CHECK:     #1 Thread1
Index: test/tsan/memcmp_race.cc
===================================================================
--- test/tsan/memcmp_race.cc
+++ test/tsan/memcmp_race.cc
@@ -35,7 +35,7 @@
 // CHECK: addr=[[ADDR:0x[0-9,a-f]+]]
 // CHECK: WARNING: ThreadSanitizer: data race
 // CHECK:   Write of size 1 at [[ADDR]] by thread T2:
-// CHECK:     #0 memcpy
+// CHECK:     #0 {{(memcpy|memmove)}}
 // CHECK:     #1 Thread2
 // CHECK:   Previous read of size 1 at [[ADDR]] by thread T1:
 // CHECK:     #0 memcmp
Index: test/tsan/inlined_memcpy_race.cc
===================================================================
--- test/tsan/inlined_memcpy_race.cc
+++ test/tsan/inlined_memcpy_race.cc
@@ -32,6 +32,6 @@
 // CHECK:   #0 memset
 // CHECK:   #1 MemSetThread
 // CHECK:  Previous write
-// CHECK:   #0 memcpy
+// CHECK:   #0 {{(memcpy|memmove)}}
 // CHECK:   #1 MemCpyThread
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14638.40118.patch
Type: text/x-patch
Size: 1424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151113/bb1fac85/attachment.bin>


More information about the llvm-commits mailing list