summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Bebenita <mbebenita@gmail.com>2016-05-11 09:03:44 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-05-11 09:03:44 -0700
commit0cd4f81442cdeac61ec611d94f381832bdbd361f (patch)
tree441b3e4191acd34406e2192bd744b3a3777c99b7 /test
parent7ab2885a399f4f8084c92546a82375af598371c1 (diff)
downloadbinaryen-0cd4f81442cdeac61ec611d94f381832bdbd361f.tar.gz
binaryen-0cd4f81442cdeac61ec611d94f381832bdbd361f.tar.bz2
binaryen-0cd4f81442cdeac61ec611d94f381832bdbd361f.zip
Add a pass to order functions by their use frequency. (#452)
Diffstat (limited to 'test')
-rw-r--r--test/passes/reorder-functions.txt15
-rw-r--r--test/passes/reorder-functions.wast6
2 files changed, 21 insertions, 0 deletions
diff --git a/test/passes/reorder-functions.txt b/test/passes/reorder-functions.txt
new file mode 100644
index 000000000..b9c0f1154
--- /dev/null
+++ b/test/passes/reorder-functions.txt
@@ -0,0 +1,15 @@
+(module
+ (memory 256 256)
+ (func $c
+ (call $c)
+ (call $c)
+ (call $c)
+ )
+ (func $b
+ (call $b)
+ (call $b)
+ )
+ (func $a
+ (call $a)
+ )
+)
diff --git a/test/passes/reorder-functions.wast b/test/passes/reorder-functions.wast
new file mode 100644
index 000000000..99a8363d4
--- /dev/null
+++ b/test/passes/reorder-functions.wast
@@ -0,0 +1,6 @@
+(module
+ (memory 256 256)
+ (func $a (call $a))
+ (func $b (call $b) (call $b))
+ (func $c (call $c) (call $c) (call $c))
+)