Home | History | Annotate | Download | only in tsan
      1 #!/bin/bash
      2 set -u
      3 
      4 RES=$(./analyze_libtsan.sh)
      5 PrintRes() {
      6   printf "%s\n" "$RES"
      7 }
      8 
      9 PrintRes
     10 
     11 mops="write1 \
     12       write2 \
     13       write4 \
     14       write8 \
     15       read1 \
     16       read2 \
     17       read4 \
     18       read8"
     19 func="func_entry \
     20       func_exit"
     21 
     22 check() {
     23   res=$(PrintRes | egrep "$1 .* $2 $3; ")
     24   if [ "$res" == "" ]; then
     25     echo FAILED $1 must contain $2 $3
     26     exit 1
     27   fi
     28 }
     29 
     30 for f in $mops; do
     31   check $f rsp 1   # To read caller pc.
     32   check $f push 0
     33   check $f pop 0
     34 done
     35 
     36 for f in $func; do
     37   check $f rsp 0
     38   check $f push 0
     39   check $f pop 0
     40   check $f call 1  # TraceSwitch()
     41 done
     42 
     43 echo LGTM
     44