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