Kostya Serebryany | b82ae88 | 2012-05-10 15:10:03 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -u |
| 3 | |
| 4 | RES=$(./analyze_libtsan.sh) |
| 5 | PrintRes() { |
| 6 | printf "%s\n" "$RES" |
| 7 | } |
| 8 | |
| 9 | PrintRes |
| 10 | |
Kostya Serebryany | b82ae88 | 2012-05-10 15:10:03 +0000 | [diff] [blame] | 11 | check() { |
| 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 Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 19 | for f in write1; do |
| 20 | check $f rsp 1 |
| 21 | check $f push 2 |
| 22 | check $f pop 2 |
| 23 | done |
| 24 | |
| 25 | for f in write2 write4 write8; do |
| 26 | check $f rsp 1 |
| 27 | check $f push 3 |
| 28 | check $f pop 3 |
| 29 | done |
| 30 | |
| 31 | for f in read1 read2 read4 read8; do |
| 32 | check $f rsp 1 |
| 33 | check $f push 5 |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 34 | check $f pop 5 |
| 35 | done |
| 36 | |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 37 | for f in func_entry func_exit; do |
Kostya Serebryany | b82ae88 | 2012-05-10 15:10:03 +0000 | [diff] [blame] | 38 | check $f rsp 0 |
| 39 | check $f push 0 |
| 40 | check $f pop 0 |
| 41 | check $f call 1 # TraceSwitch() |
| 42 | done |
| 43 | |
| 44 | echo LGTM |