Skip to content

Commit

Permalink
add lit test case
Browse files Browse the repository at this point in the history
  • Loading branch information
chen ruixiang committed Feb 23, 2023
1 parent e951f70 commit 9f6268c
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/lit/source-map.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
;; RUN: wasm-opt %s -o %t.wasm -osm %t.map -g -q
;; RUN: wasm-opt %t.wasm -ism %t.map -q -o - -S | filecheck %s

(module
(func $foo (param $x i32) (param $y i32)
;;@ src.cpp:10:1
(if
;;@ src.cpp:20:1
(i32.add
;;@ src.cpp:30:1
(local.get $x)
;;@ src.cpp:40:1
(local.get $y)
)
;;@ src.cpp:50:1
(return)
)
;;@ src.cpp:60:1
(call $foo
;;@ src.cpp:70:1
(local.get $x)
;;@ src.cpp:80:1
(local.get $y)
)
)
)

;; CHECK: (func $foo (param $x i32) (param $y i32)
;; CHECK-NEXT: ;;@ src.cpp:20:1
;; CHECK-NEXT: (if
;; CHECK-NEXT: (i32.add
;; CHECK-NEXT: ;;@ src.cpp:30:1
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: ;;@ src.cpp:40:1
;; CHECK-NEXT: (local.get $y)
;; CHECK-NEXT: )
;; CHECK-NEXT: ;;@ src.cpp:50:1
;; CHECK-NEXT: (return)
;; CHECK-NEXT: )
;; CHECK-NEXT: ;;@ src.cpp:60:1
;; CHECK-NEXT: (call $foo
;; CHECK-NEXT: ;;@ src.cpp:70:1
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: ;;@ src.cpp:80:1
;; CHECK-NEXT: (local.get $y)
;; CHECK-NEXT: )

0 comments on commit 9f6268c

Please sign in to comment.