d7442a7af51ccfa2102e88a19ca9446c48dc281b
[oota-llvm.git] / test / Feature / TestOptimizer.sh
1 #!/bin/sh
2 LD_LIBRARY_PATH=../lib/Assembly/Parser/Debug:../lib/Assembly/Writer/Debug:../lib/Analysis/Debug:../lib/VMCore/Debug:../lib/Bytecode/Writer/Debug:../lib/Bytecode/Reader/Debug:../lib/Optimizations/Debug
3 export LD_LIBRARY_PATH
4
5
6 ../tools/as/as < $1 | ../tools/opt/opt -q -inline -dce -constprop -dce | ../tools/dis/dis | ../tools/as/as > $1.bc.1 || exit 1
7
8 # Should not be able to optimize further!
9 ../tools/opt/opt -q -constprop -dce < $1.bc.1 > $1.bc.2 || exit 2
10
11 diff $1.bc.[12] || exit 3
12 rm $1.bc.[12]
13