• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2set -u
3
4RES=$(./analyze_libtsan.sh)
5PrintRes() {
6  printf "%s\n" "$RES"
7}
8
9PrintRes
10
11wmops="write1 \
12      write2 \
13      write4 \
14      write8"
15rmops="read1 \
16      read2 \
17      read4 \
18      read8"
19func="func_entry \
20      func_exit"
21
22check() {
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
30for f in $wmops; do
31  check $f rsp 3
32  check $f push 1
33  check $f pop 5
34done
35
36for f in $rmops; do
37  check $f rsp 3
38  check $f push 1
39  check $f pop 4
40done
41
42for 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()
47done
48
49echo LGTM
50