f51be2e4b97f136f9c87a421b55cf9b66b11213a
[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
13 # Try out SCCP
14 ../tools/as/as < $1 | ../tools/opt/opt -q -inline -dce -sccp -dce | ../tools/dis/dis | ../tools/as/as > $1.bc.3 || exit 1
15
16 # Should not be able to optimize further!
17 #../tools/opt/opt -q -sccp -dce < $1.bc.3 > $1.bc.4 || exit 2
18
19 #diff $1.bc.[34] || exit 3
20 rm $1.bc.[123]
21