blob: 4b33393ef648fefb3a66fe5ce8d279ad017e7aef [file] [log] [blame]
Kostya Serebryanyb82ae882012-05-10 15:10:03 +00001#!/bin/bash
2set -u
3
4RES=$(./analyze_libtsan.sh)
5PrintRes() {
6 printf "%s\n" "$RES"
7}
8
9PrintRes
10
Kostya Serebryanyb82ae882012-05-10 15:10:03 +000011check() {
12 res=$(PrintRes | egrep "$1 .* $2 $3; ")
13 if [ "$res" == "" ]; then
14 echo FAILED $1 must contain $2 $3
15 exit 1
16 fi
17}
18
Stephen Hines86277eb2015-03-23 12:06:32 -070019for f in write1; do
20 check $f rsp 1
21 check $f push 2
22 check $f pop 2
23done
24
25for f in write2 write4 write8; do
26 check $f rsp 1
27 check $f push 3
28 check $f pop 3
29done
30
31for f in read1 read2 read4 read8; do
32 check $f rsp 1
33 check $f push 5
Stephen Hines6a211c52014-07-21 00:49:56 -070034 check $f pop 5
35done
36
Stephen Hines86277eb2015-03-23 12:06:32 -070037for f in func_entry func_exit; do
Kostya Serebryanyb82ae882012-05-10 15:10:03 +000038 check $f rsp 0
39 check $f push 0
40 check $f pop 0
41 check $f call 1 # TraceSwitch()
42done
43
44echo LGTM