summaryrefslogtreecommitdiff
path: root/test/Feature/TestOptimizer.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/Feature/TestOptimizer.sh')
-rwxr-xr-xtest/Feature/TestOptimizer.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Feature/TestOptimizer.sh b/test/Feature/TestOptimizer.sh
new file mode 100755
index 0000000000..b34aae2785
--- /dev/null
+++ b/test/Feature/TestOptimizer.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+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
+export LD_LIBRARY_PATH
+
+
+../tools/as/as < $1 | ../tools/opt/opt -q -inline -constprop -dce | ../tools/dis/dis | ../tools/as/as > $1.bc.1 || exit 1
+
+# Should not be able to optimize further!
+../tools/opt/opt -q -inline -constprop -dce < $1.bc.1 > $1.bc.2 || exit 2
+
+diff $1.bc.[12] || exit 3
+rm $1.bc.[12]
+