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