[PATCH] D98502: [clang][Checkers] Extend PthreadLockChecker state dump (NFC).

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 22 05:00:28 PDT 2021


steakhal added inline comments.


================
Comment at: clang/test/Analysis/pthreadlock_state.c:70
+  // CHECK-NEXT:      "Mutexes in unresolved possibly destroyed state:", 
+  // CHECK-NEXT:      "SymRegion{reg_$12<pthread_mutex_t * mtx1>}: conj_$15{int, LC1, S1921, #1}", 
+  // CHECK-NEXT:      ""
----------------
steakhal wrote:
> I recommend not hardcoding symbol identifier numbers. `reg$NN`, `conj_$NN`, `LCNN`, `SNNNN`
> It would result in a less fragile test.
> I'm pretty sure you can use some regexp to achieve this.
AFAIK only the line prefix is checked.
So you could use simply `"SymRegion{reg_${{[0-9]+}}<pthread_mutex_t * mtx1>}: conj_$"`

Make sure you mask the number out of the `reg_$12` as well, etc.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98502/new/

https://reviews.llvm.org/D98502



More information about the cfe-commits mailing list