xref: /netbsd-src/external/apache2/llvm/dist/clang/utils/VtableTest/check-ztt (revision 7330f729ccf0bd976a06f95fad452fe774fc7fd1)
1*7330f729Sjoerg#!/bin/sh
2*7330f729Sjoerg
3*7330f729SjoergN_STRUCTS=300
4*7330f729Sjoerg
5*7330f729Sjoerg# Utility routine to "hand" check VTTs.
6*7330f729Sjoerg
7*7330f729Sjoerglet i=1;
8*7330f729Sjoergwhile [ $i != $N_STRUCTS ]; do
9*7330f729Sjoerg  sed -n "/^__ZTT.*s$i:/,/\.[sgm][elo]/p" test-clang.s |
10*7330f729Sjoerg    grep -v '\.[sgm][elo]' | sed -e 's/[()]//g' -e '/^$/d'  >test-clang-ztt
11*7330f729Sjoerg  sed -n "/^__ZTT.*s$i:/,/\.[sgm][elo]/p" test-gcc.s |
12*7330f729Sjoerg    grep -v '\.[sgm][elo]' | sed -e 's/[()]//g' -e 's/ + /+/'  >test-gcc-ztt
13*7330f729Sjoerg  diff -U3 test-gcc-ztt test-clang-ztt
14*7330f729Sjoerg  if [ $? != 0 ]; then
15*7330f729Sjoerg     echo "FAIL: s$i VTT"
16*7330f729Sjoerg  else
17*7330f729Sjoerg     echo "PASS: s$i VTT"
18*7330f729Sjoerg  fi
19*7330f729Sjoerg  let i=i+1
20*7330f729Sjoergdone
21