]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/tsan/check_analyze.sh
Reintegrate head revisions r273096-r277147
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / tsan / check_analyze.sh
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 wmops="write1 \
12       write2 \
13       write4 \
14       write8"
15 rmops="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 $wmops; do
31   check $f rsp 3
32   check $f push 1
33   check $f pop 5
34 done
35
36 for f in $rmops; do
37   check $f rsp 3
38   check $f push 1
39   check $f pop 4
40 done
41
42 for f in $func; do
43   check $f rsp 0
44   check $f push 0
45   check $f pop 0
46   check $f call 1  # TraceSwitch()
47 done
48
49 echo LGTM