[clang][extract-api] Emit "navigator" property of "name" in SymbolGraph
[llvm-project.git] / compiler-rt / lib / tsan / check_analyze.sh
blobf507ba0172f34d1e46aa89d2d254d87d211a8b98
1 #!/usr/bin/env bash
3 # Script that checks that critical functions in TSan runtime have correct number
4 # of push/pop/rsp instructions to verify that runtime is efficient enough.
6 # This test can fail when backend code generation changes the output for various
7 # tsan interceptors. When such a change happens, you can ensure that the
8 # performance has not regressed by running the following benchmarks before and
9 # after the breaking change to verify that the values in this file are safe to
10 # update:
11 # ./projects/compiler-rt/lib/tsan/tests/rtl/TsanRtlTest-x86_64-Test
12 # --gtest_also_run_disabled_tests --gtest_filter=DISABLED_BENCH.Mop*
14 set -u
16 if [[ "$#" != 1 ]]; then
17 echo "Usage: $0 /path/to/binary/built/with/tsan"
18 exit 1
21 SCRIPTDIR=$(dirname $0)
22 RES=$(${SCRIPTDIR}/analyze_libtsan.sh $1)
23 PrintRes() {
24 printf "%s\n" "$RES"
27 PrintRes
29 check() {
30 res=$(PrintRes | egrep "$1 .* $2 $3; ")
31 if [ "$res" == "" ]; then
32 echo FAILED $1 must contain $2 $3
33 exit 1
37 # All hot functions must contain no PUSH/POP
38 # and no CALLs (everything is tail-called).
39 for f in write1 write2 write4 write8; do
40 check $f rsp 1
41 check $f push 0
42 check $f pop 0
43 check $f call 0
44 done
46 for f in read1 read2 read4 read8; do
47 check $f rsp 1
48 check $f push 0
49 check $f pop 0
50 check $f call 0
51 done
53 for f in func_entry func_exit; do
54 check $f rsp 0
55 check $f push 0
56 check $f pop 0
57 check $f call 0
58 done
60 echo LGTM