[TSan][Darwin] Test fix external-swift-debugging.cpp
authorJulian Lettner <julian.lettner@apple.com>
Thu, 23 Mar 2023 18:01:33 +0000 (11:01 -0700)
committerJulian Lettner <julian.lettner@apple.com>
Thu, 23 Mar 2023 18:28:15 +0000 (11:28 -0700)
My recent change [1] extended the external-swift-debugging.cpp test, but
didn't account for PAC under which function pointers aren't trivially
comparable. We could use `ptrauth_strip()`, but for the test it's easier
to just the symbol name.

[1] https://reviews.llvm.org/D146264

compiler-rt/test/tsan/Darwin/external-swift-debugging.cpp

index 64475a3..8f8b2d5 100644 (file)
@@ -30,9 +30,6 @@ int main(int argc, char *argv[]) {
   fprintf(stderr, "Start.\n");
   // CHECK: Start.
 
-  fprintf(stderr, "ExternalWrite function address: %p\n", &ExternalWrite);
-  // CHECK: ExternalWrite function address: [[ExternalWrite_addr:0x[0-9a-z]+]]
-
   void *opaque_object = malloc(16);
   std::thread t1([opaque_object] {
     ExternalWrite(opaque_object);
@@ -85,7 +82,7 @@ __tsan_on_report(void *report) {
             info.dli_saddr, info.dli_sname);
   }
   // Ensure ExternalWrite() function is top of trace
-  // CHECK: 0: frame: 0x{{[0-9a-z]+}}, function: [[ExternalWrite_addr]] _Z13ExternalWritePv
+  // CHECK: 0: frame: 0x{{[0-9a-z]+}}, function: 0x{{[0-9a-z]+}} _Z13ExternalWritePv
 }
 
 // CHECK: Done.