blob: 79ff5c314a7f20d78b46b9bfdffe1e53b51b448a [file] [log] [blame]
Chris Lattner00950542001-06-06 20:29:01 +00001#!/bin/sh
2# test that every step outputs something that is consumable by
3# another step
4
5rm -f test.bc.temp[12]
6
Chris Lattner8cb23b22002-01-23 18:04:21 +00007LD_LIBRARY_PATH=../../lib/Debug
Chris Lattner00950542001-06-06 20:29:01 +00008export LD_LIBRARY_PATH
9
Chris Lattner8cb23b22002-01-23 18:04:21 +000010AS=../../tools/Debug/as
11DIS=../../tools/Debug/dis
Chris Lattnerf074cfc2001-09-07 22:58:50 +000012
Chris Lattner8cb23b22002-01-23 18:04:21 +000013echo "======== Running assembler/disassembler test on $1"
Chris Lattnerf074cfc2001-09-07 22:58:50 +000014
Chris Lattner00950542001-06-06 20:29:01 +000015# Two full cycles are needed for bitwise stability
Chris Lattner8cb23b22002-01-23 18:04:21 +000016(
17 $AS < $1 > $1.bc.1 || exit 1
18 $DIS < $1.bc.1 > $1.ll.1 || exit 2
19 $AS < $1.ll.1 > $1.bc.2 || exit 3
20 $DIS < $1.bc.2 > $1.ll.2 || exit 4
Chris Lattner00950542001-06-06 20:29:01 +000021
Chris Lattner8cb23b22002-01-23 18:04:21 +000022 diff $1.ll.[12] || exit 7
Chris Lattner00950542001-06-06 20:29:01 +000023
Chris Lattner8cb23b22002-01-23 18:04:21 +000024 # FIXME: When we sort things correctly and deterministically, we can
25 # reenable this
26 #diff $1.bc.[12] || exit 8
Chris Lattner8ce06692001-07-26 16:30:18 +000027
Chris Lattner8cb23b22002-01-23 18:04:21 +000028 rm $1.[bl][cl].[12]
29 touch Output/$1.asmdis
Chris Lattnerfa149902002-01-23 20:39:56 +000030) || ../Failure.sh "$1 ASM/DIS"
Chris Lattner00950542001-06-06 20:29:01 +000031