#!/bin/sh

set -e
X="attribute2 attribute"
T="vars struct  for while switch cast goto nested function incdec \
spec_array spec_bitfield spec_class spec_decl spec_expr \
spec_main spec_number spec_punctuation spec_sizeof spec_string \
spec_type spec_unionstruct function_kr  spec_comma spec_complit spec_struct \
spec_punctuation typedef typespec spec_restrict  expr bad1 \
spec_switch spec_loop ptr struct2 anonymous spec_typedef comma anonymous2 \
spec_func initlist spec_arrayinit index spec_vla for2 index2 declmany \
backslash typeof comments struct3 spec_typedef2 virtual_block asm pragma \
"


tmp=`mktemp -t`
for t in $T
do
	#drop location
	sed 's/ ([^\)]*)$/ ()/' $t.OUT >$tmp
	echo $t
	../c99tree -tind -Tc <$t.OUT |../c99tree -vall -L |diff -u $tmp -
done
