summaryrefslogtreecommitdiff
path: root/test/lit/passes/reorder-functions-by-name.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/reorder-functions-by-name.wast')
-rw-r--r--test/lit/passes/reorder-functions-by-name.wast107
1 files changed, 107 insertions, 0 deletions
diff --git a/test/lit/passes/reorder-functions-by-name.wast b/test/lit/passes/reorder-functions-by-name.wast
new file mode 100644
index 000000000..ab5b35bc2
--- /dev/null
+++ b/test/lit/passes/reorder-functions-by-name.wast
@@ -0,0 +1,107 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; RUN: foreach %s %t wasm-opt -all --reorder-functions-by-name -S -o - | filecheck %s
+
+(module
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (func $a (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: )
+
+ ;; CHECK: (func $b (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 20)
+ ;; CHECK-NEXT: )
+
+ ;; CHECK: (func $c (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 30)
+ ;; CHECK-NEXT: )
+ (func $c (result i32)
+ (i32.const 30)
+ )
+
+ (func $b (result i32)
+ (i32.const 20)
+ )
+
+ (func $a (result i32)
+ (i32.const 10)
+ )
+)
+
+(module
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (func $a (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: )
+ (func $a (result i32)
+ (i32.const 10)
+ )
+
+ ;; CHECK: (func $b (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 20)
+ ;; CHECK-NEXT: )
+ (func $b (result i32)
+ (i32.const 20)
+ )
+
+ ;; CHECK: (func $c (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 30)
+ ;; CHECK-NEXT: )
+ (func $c (result i32)
+ (i32.const 30)
+ )
+)
+
+(module
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (func $a (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: )
+
+ ;; CHECK: (func $b (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 20)
+ ;; CHECK-NEXT: )
+ (func $b (result i32)
+ (i32.const 20)
+ )
+
+ (func $a (result i32)
+ (i32.const 10)
+ )
+
+ ;; CHECK: (func $c (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 30)
+ ;; CHECK-NEXT: )
+ (func $c (result i32)
+ (i32.const 30)
+ )
+)
+
+(module
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (func $a (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: )
+
+ ;; CHECK: (func $b (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 20)
+ ;; CHECK-NEXT: )
+
+ ;; CHECK: (func $c (type $none_=>_i32) (result i32)
+ ;; CHECK-NEXT: (i32.const 30)
+ ;; CHECK-NEXT: )
+ (func $c (result i32)
+ (i32.const 30)
+ )
+
+ (func $a (result i32)
+ (i32.const 10)
+ )
+
+ (func $b (result i32)
+ (i32.const 20)
+ )
+)