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