summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/debugInfo.asm.js62
-rw-r--r--test/debugInfo.fromasm156
-rw-r--r--test/debugInfo.fromasm.clamp156
-rw-r--r--test/debugInfo.fromasm.clamp.no-opts200
-rw-r--r--test/debugInfo.fromasm.imprecise152
-rw-r--r--test/debugInfo.fromasm.imprecise.no-opts200
-rw-r--r--test/debugInfo.fromasm.no-opts200
7 files changed, 1093 insertions, 33 deletions
diff --git a/test/debugInfo.asm.js b/test/debugInfo.asm.js
index 929d79804..29b08575a 100644
--- a/test/debugInfo.asm.js
+++ b/test/debugInfo.asm.js
@@ -1,5 +1,6 @@
function () {
"use asm";
+ var STACKTOP = 0;
function add(x, y) {
x = x | 0;
y = y | 0;
@@ -21,6 +22,65 @@ function () {
x = (x | 0) % (y | 0); //@line 3 "even-opted.cpp"
return x + y | 0;
}
- return { add: add, ret: ret, opts: opts };
+ function fib($0) {
+ $0 = $0|0;
+ var $$0$lcssa = 0, $$01518 = 0, $$01518$phi = 0, $$01617 = 0, $$019 = 0, $1 = 0, $2 = 0, $3 = 0, $exitcond = 0, label = 0, sp = 0;
+ sp = STACKTOP;
+ $1 = ($0|0)>(0); //@line 3 "fib.c"
+ if ($1) {
+ $$01518 = 0;$$01617 = 0;$$019 = 1;
+ } else {
+ $$0$lcssa = 1;
+ return ($$0$lcssa|0); //@line 8 "fib.c"
+ }
+ while(1) {
+ $2 = (($$019) + ($$01518))|0; //@line 4 "fib.c"
+ $3 = (($$01617) + 1)|0; //@line 3 "fib.c"
+ $exitcond = ($3|0)==($0|0); //@line 3 "fib.c"
+ if ($exitcond) {
+ $$0$lcssa = $2;
+ break;
+ } else {
+ $$01518$phi = $$019;$$01617 = $3;$$019 = $2;$$01518 = $$01518$phi;
+ }
+ }
+ return ($$0$lcssa|0); //@line 8 "fib.c"
+ }
+ function switch_reach($p) {
+ $p = $p|0;
+ var $0 = 0, $call = 0, $magic = 0, $rc$0 = 0, $switch$split2D = 0, label = 0, sp = 0;
+ sp = STACKTOP;
+ $magic = ((($p)) + 52|0);
+ $0 = $magic;
+ $switch$split2D = ($0|0)<(1369188723);
+ if ($switch$split2D) {
+ switch ($0|0) {
+ case -1108210269: {
+ label = 2;
+ break;
+ }
+ default: {
+ $rc$0 = 0;
+ }
+ }
+ } else {
+ switch ($0|0) {
+ case 1369188723: {
+ label = 2;
+ break;
+ }
+ default: {
+ $rc$0 = 0;
+ }
+ }
+ }
+ if ((label|0) == 2) {
+ $call = switch_reach($p) | 0;
+ $rc$0 = $call;
+ }
+ switch_reach($p) | 0;
+ return ($rc$0|0); //@line 59950 "/tmp/emscripten_test_binaryen2_28hnAe/src.c"
+ }
+ return { add: add, ret: ret, opts: opts, fib: fib, switch_reach: switch_reach };
}
diff --git a/test/debugInfo.fromasm b/test/debugInfo.fromasm
index e9526aba7..84fb4aece 100644
--- a/test/debugInfo.fromasm
+++ b/test/debugInfo.fromasm
@@ -8,18 +8,26 @@
(export "add" (func $add))
(export "ret" (func $ret))
(export "opts" (func $opts))
+ (export "fib" (func $fib))
+ (export "switch_reach" (func $switch_reach))
(func $add (param $0 i32) (param $1 i32) (result i32)
+ ;; tests/other_file.cpp:314159
(i32.add
(get_local $1)
(get_local $1)
)
)
(func $ret (param $0 i32) (result i32)
- (i32.add
+ ;; return.cpp:50
+ (set_local $0
(i32.shl
(get_local $0)
(i32.const 1)
)
+ )
+ ;; return.cpp:100
+ (i32.add
+ (get_local $0)
(i32.const 1)
)
)
@@ -34,28 +42,154 @@
)
)
(func $opts (param $0 i32) (param $1 i32) (result i32)
+ ;; even-opted.cpp:1
+ (set_local $0
+ (i32.add
+ (get_local $0)
+ (get_local $1)
+ )
+ )
;; even-opted.cpp:2
(set_local $1
(i32.shr_s
(get_local $1)
- (tee_local $0
- (i32.add
- (get_local $0)
- (get_local $1)
- )
- )
+ (get_local $0)
)
)
;; even-opted.cpp:3
- (set_local $0
+ (i32.add
(call $i32s-rem
(get_local $0)
(get_local $1)
)
- )
- (i32.add
- (get_local $0)
(get_local $1)
)
)
+ (func $fib (param $0 i32) (result i32)
+ (local $1 i32)
+ (local $2 i32)
+ (local $3 i32)
+ (local $4 i32)
+ (if
+ ;; fib.c:3
+ (i32.gt_s
+ (get_local $0)
+ (i32.const 0)
+ )
+ (block
+ (set_local $4
+ (i32.const 0)
+ )
+ (set_local $2
+ (i32.const 0)
+ )
+ (set_local $3
+ (i32.const 1)
+ )
+ )
+ (block
+ (set_local $1
+ (i32.const 1)
+ )
+ ;; fib.c:8
+ (return
+ (get_local $1)
+ )
+ )
+ )
+ (loop $while-in
+ ;; fib.c:4
+ (set_local $1
+ (i32.add
+ (get_local $3)
+ (get_local $4)
+ )
+ )
+ ;; fib.c:3
+ (set_local $2
+ (i32.add
+ (get_local $2)
+ (i32.const 1)
+ )
+ )
+ (if
+ ;; fib.c:3
+ (i32.ne
+ (get_local $2)
+ (get_local $0)
+ )
+ (block
+ (set_local $4
+ (get_local $3)
+ )
+ (set_local $3
+ (get_local $1)
+ )
+ (br $while-in)
+ )
+ )
+ )
+ ;; fib.c:8
+ (get_local $1)
+ )
+ (func $switch_reach (param $0 i32) (result i32)
+ (local $1 i32)
+ (set_local $1
+ (block $__rjto$0 i32
+ (block $__rjti$0
+ (br $__rjto$0
+ (if i32
+ (i32.lt_s
+ (tee_local $1
+ (i32.add
+ (get_local $0)
+ (i32.const 52)
+ )
+ )
+ (i32.const 1369188723)
+ )
+ (block $switch i32
+ (block $switch-default
+ (block $switch-case
+ (br_table $switch-case $switch-default
+ (i32.sub
+ (get_local $1)
+ (i32.const -1108210269)
+ )
+ )
+ )
+ (br $__rjti$0)
+ )
+ (i32.const 0)
+ )
+ (block $switch0 i32
+ (block $switch-default2
+ (block $switch-case1
+ (br_table $switch-case1 $switch-default2
+ (i32.sub
+ (get_local $1)
+ (i32.const 1369188723)
+ )
+ )
+ )
+ (br $__rjti$0)
+ )
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ (call $switch_reach
+ (get_local $0)
+ )
+ )
+ )
+ (drop
+ (call $switch_reach
+ (get_local $0)
+ )
+ )
+ ;; /tmp/emscripten_test_binaryen2_28hnAe/src.c:59950
+ (get_local $1)
+ )
)
diff --git a/test/debugInfo.fromasm.clamp b/test/debugInfo.fromasm.clamp
index e9526aba7..84fb4aece 100644
--- a/test/debugInfo.fromasm.clamp
+++ b/test/debugInfo.fromasm.clamp
@@ -8,18 +8,26 @@
(export "add" (func $add))
(export "ret" (func $ret))
(export "opts" (func $opts))
+ (export "fib" (func $fib))
+ (export "switch_reach" (func $switch_reach))
(func $add (param $0 i32) (param $1 i32) (result i32)
+ ;; tests/other_file.cpp:314159
(i32.add
(get_local $1)
(get_local $1)
)
)
(func $ret (param $0 i32) (result i32)
- (i32.add
+ ;; return.cpp:50
+ (set_local $0
(i32.shl
(get_local $0)
(i32.const 1)
)
+ )
+ ;; return.cpp:100
+ (i32.add
+ (get_local $0)
(i32.const 1)
)
)
@@ -34,28 +42,154 @@
)
)
(func $opts (param $0 i32) (param $1 i32) (result i32)
+ ;; even-opted.cpp:1
+ (set_local $0
+ (i32.add
+ (get_local $0)
+ (get_local $1)
+ )
+ )
;; even-opted.cpp:2
(set_local $1
(i32.shr_s
(get_local $1)
- (tee_local $0
- (i32.add
- (get_local $0)
- (get_local $1)
- )
- )
+ (get_local $0)
)
)
;; even-opted.cpp:3
- (set_local $0
+ (i32.add
(call $i32s-rem
(get_local $0)
(get_local $1)
)
- )
- (i32.add
- (get_local $0)
(get_local $1)
)
)
+ (func $fib (param $0 i32) (result i32)
+ (local $1 i32)
+ (local $2 i32)
+ (local $3 i32)
+ (local $4 i32)
+ (if
+ ;; fib.c:3
+ (i32.gt_s
+ (get_local $0)
+ (i32.const 0)
+ )
+ (block
+ (set_local $4
+ (i32.const 0)
+ )
+ (set_local $2
+ (i32.const 0)
+ )
+ (set_local $3
+ (i32.const 1)
+ )
+ )
+ (block
+ (set_local $1
+ (i32.const 1)
+ )
+ ;; fib.c:8
+ (return
+ (get_local $1)
+ )
+ )
+ )
+ (loop $while-in
+ ;; fib.c:4
+ (set_local $1
+ (i32.add
+ (get_local $3)
+ (get_local $4)
+ )
+ )
+ ;; fib.c:3
+ (set_local $2
+ (i32.add
+ (get_local $2)
+ (i32.const 1)
+ )
+ )
+ (if
+ ;; fib.c:3
+ (i32.ne
+ (get_local $2)
+ (get_local $0)
+ )
+ (block
+ (set_local $4
+ (get_local $3)
+ )
+ (set_local $3
+ (get_local $1)
+ )
+ (br $while-in)
+ )
+ )
+ )
+ ;; fib.c:8
+ (get_local $1)
+ )
+ (func $switch_reach (param $0 i32) (result i32)
+ (local $1 i32)
+ (set_local $1
+ (block $__rjto$0 i32
+ (block $__rjti$0
+ (br $__rjto$0
+ (if i32
+ (i32.lt_s
+ (tee_local $1
+ (i32.add
+ (get_local $0)
+ (i32.const 52)
+ )
+ )
+ (i32.const 1369188723)
+ )
+ (block $switch i32
+ (block $switch-default
+ (block $switch-case
+ (br_table $switch-case $switch-default
+ (i32.sub
+ (get_local $1)
+ (i32.const -1108210269)
+ )
+ )
+ )
+ (br $__rjti$0)
+ )
+ (i32.const 0)
+ )
+ (block $switch0 i32
+ (block $switch-default2
+ (block $switch-case1
+ (br_table $switch-case1 $switch-default2
+ (i32.sub
+ (get_local $1)
+ (i32.const 1369188723)
+ )
+ )
+ )
+ (br $__rjti$0)
+ )
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ (call $switch_reach
+ (get_local $0)
+ )
+ )
+ )
+ (drop
+ (call $switch_reach
+ (get_local $0)
+ )
+ )
+ ;; /tmp/emscripten_test_binaryen2_28hnAe/src.c:59950
+ (get_local $1)
+ )
)
diff --git a/test/debugInfo.fromasm.clamp.no-opts b/test/debugInfo.fromasm.clamp.no-opts
index 9c5718e4f..9e3050695 100644
--- a/test/debugInfo.fromasm.clamp.no-opts
+++ b/test/debugInfo.fromasm.clamp.no-opts
@@ -4,9 +4,12 @@
(import "env" "table" (table 0 0 anyfunc))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
+ (global $STACKTOP (mut i32) (i32.const 0))
(export "add" (func $add))
(export "ret" (func $ret))
(export "opts" (func $opts))
+ (export "fib" (func $fib))
+ (export "switch_reach" (func $switch_reach))
(func $add (param $x i32) (param $y i32) (result i32)
;; tests/hello_world.c:5
(set_local $x
@@ -42,7 +45,6 @@
(i32.const 1)
)
)
- (unreachable)
)
(func $i32s-rem (param $0 i32) (param $1 i32) (result i32)
(if i32
@@ -85,4 +87,200 @@
)
)
)
+ (func $fib (param $$0 i32) (result i32)
+ (local $$$0$lcssa i32)
+ (local $$$01518 i32)
+ (local $$$01518$phi i32)
+ (local $$$01617 i32)
+ (local $$$019 i32)
+ (local $$1 i32)
+ (local $$2 i32)
+ (local $$3 i32)
+ (local $$exitcond i32)
+ (local $label i32)
+ (local $sp i32)
+ (set_local $sp
+ (get_global $STACKTOP)
+ )
+ ;; fib.c:3
+ (set_local $$1
+ (i32.gt_s
+ (get_local $$0)
+ (i32.const 0)
+ )
+ )
+ (if
+ (get_local $$1)
+ (block
+ (set_local $$$01518
+ (i32.const 0)
+ )
+ (set_local $$$01617
+ (i32.const 0)
+ )
+ (set_local $$$019
+ (i32.const 1)
+ )
+ )
+ (block
+ (set_local $$$0$lcssa
+ (i32.const 1)
+ )
+ ;; fib.c:8
+ (return
+ (get_local $$$0$lcssa)
+ )
+ )
+ )
+ (loop $while-in
+ (block $while-out
+ ;; fib.c:4
+ (set_local $$2
+ (i32.add
+ (get_local $$$019)
+ (get_local $$$01518)
+ )
+ )
+ ;; fib.c:3
+ (set_local $$3
+ (i32.add
+ (get_local $$$01617)
+ (i32.const 1)
+ )
+ )
+ ;; fib.c:3
+ (set_local $$exitcond
+ (i32.eq
+ (get_local $$3)
+ (get_local $$0)
+ )
+ )
+ (if
+ (get_local $$exitcond)
+ (block
+ (set_local $$$0$lcssa
+ (get_local $$2)
+ )
+ (br $while-out)
+ )
+ (block
+ (set_local $$$01518$phi
+ (get_local $$$019)
+ )
+ (set_local $$$01617
+ (get_local $$3)
+ )
+ (set_local $$$019
+ (get_local $$2)
+ )
+ (set_local $$$01518
+ (get_local $$$01518$phi)
+ )
+ )
+ )
+ (br $while-in)
+ )
+ )
+ ;; fib.c:8
+ (return
+ (get_local $$$0$lcssa)
+ )
+ )
+ (func $switch_reach (param $$p i32) (result i32)
+ (local $$0 i32)
+ (local $$call i32)
+ (local $$magic i32)
+ (local $$rc$0 i32)
+ (local $$switch$split2D i32)
+ (local $label i32)
+ (local $sp i32)
+ (set_local $sp
+ (get_global $STACKTOP)
+ )
+ (set_local $$magic
+ (i32.add
+ (get_local $$p)
+ (i32.const 52)
+ )
+ )
+ (set_local $$0
+ (get_local $$magic)
+ )
+ (set_local $$switch$split2D
+ (i32.lt_s
+ (get_local $$0)
+ (i32.const 1369188723)
+ )
+ )
+ (if
+ (get_local $$switch$split2D)
+ (block $switch
+ (block $switch-default
+ (block $switch-case
+ (br_table $switch-case $switch-default
+ (i32.sub
+ (get_local $$0)
+ (i32.const -1108210269)
+ )
+ )
+ )
+ (block
+ (set_local $label
+ (i32.const 2)
+ )
+ (br $switch)
+ )
+ )
+ (set_local $$rc$0
+ (i32.const 0)
+ )
+ )
+ (block $switch0
+ (block $switch-default2
+ (block $switch-case1
+ (br_table $switch-case1 $switch-default2
+ (i32.sub
+ (get_local $$0)
+ (i32.const 1369188723)
+ )
+ )
+ )
+ (block
+ (set_local $label
+ (i32.const 2)
+ )
+ (br $switch0)
+ )
+ )
+ (set_local $$rc$0
+ (i32.const 0)
+ )
+ )
+ )
+ (if
+ (i32.eq
+ (get_local $label)
+ (i32.const 2)
+ )
+ (block
+ (set_local $$call
+ (call $switch_reach
+ (get_local $$p)
+ )
+ )
+ (set_local $$rc$0
+ (get_local $$call)
+ )
+ )
+ )
+ (drop
+ (call $switch_reach
+ (get_local $$p)
+ )
+ )
+ ;; /tmp/emscripten_test_binaryen2_28hnAe/src.c:59950
+ (return
+ (get_local $$rc$0)
+ )
+ )
)
diff --git a/test/debugInfo.fromasm.imprecise b/test/debugInfo.fromasm.imprecise
index 5533d4cae..4919d624d 100644
--- a/test/debugInfo.fromasm.imprecise
+++ b/test/debugInfo.fromasm.imprecise
@@ -7,34 +7,45 @@
(export "add" (func $add))
(export "ret" (func $ret))
(export "opts" (func $opts))
+ (export "fib" (func $fib))
+ (export "switch_reach" (func $switch_reach))
(func $add (param $0 i32) (param $1 i32) (result i32)
+ ;; tests/other_file.cpp:314159
(i32.add
(get_local $1)
(get_local $1)
)
)
(func $ret (param $0 i32) (result i32)
- (i32.add
+ ;; return.cpp:50
+ (set_local $0
(i32.shl
(get_local $0)
(i32.const 1)
)
+ )
+ ;; return.cpp:100
+ (i32.add
+ (get_local $0)
(i32.const 1)
)
)
(func $opts (param $0 i32) (param $1 i32) (result i32)
+ ;; even-opted.cpp:1
+ (set_local $0
+ (i32.add
+ (get_local $0)
+ (get_local $1)
+ )
+ )
;; even-opted.cpp:2
(set_local $1
(i32.shr_s
(get_local $1)
- (tee_local $0
- (i32.add
- (get_local $0)
- (get_local $1)
- )
- )
+ (get_local $0)
)
)
+ ;; even-opted.cpp:3
(i32.add
(i32.rem_s
(get_local $0)
@@ -43,4 +54,131 @@
(get_local $1)
)
)
+ (func $fib (param $0 i32) (result i32)
+ (local $1 i32)
+ (local $2 i32)
+ (local $3 i32)
+ (local $4 i32)
+ (if
+ ;; fib.c:3
+ (i32.gt_s
+ (get_local $0)
+ (i32.const 0)
+ )
+ (block
+ (set_local $4
+ (i32.const 0)
+ )
+ (set_local $2
+ (i32.const 0)
+ )
+ (set_local $3
+ (i32.const 1)
+ )
+ )
+ (block
+ (set_local $1
+ (i32.const 1)
+ )
+ ;; fib.c:8
+ (return
+ (get_local $1)
+ )
+ )
+ )
+ (loop $while-in
+ ;; fib.c:4
+ (set_local $1
+ (i32.add
+ (get_local $3)
+ (get_local $4)
+ )
+ )
+ ;; fib.c:3
+ (set_local $2
+ (i32.add
+ (get_local $2)
+ (i32.const 1)
+ )
+ )
+ (if
+ ;; fib.c:3
+ (i32.ne
+ (get_local $2)
+ (get_local $0)
+ )
+ (block
+ (set_local $4
+ (get_local $3)
+ )
+ (set_local $3
+ (get_local $1)
+ )
+ (br $while-in)
+ )
+ )
+ )
+ ;; fib.c:8
+ (get_local $1)
+ )
+ (func $switch_reach (param $0 i32) (result i32)
+ (local $1 i32)
+ (set_local $1
+ (block $__rjto$0 i32
+ (block $__rjti$0
+ (br $__rjto$0
+ (if i32
+ (i32.lt_s
+ (tee_local $1
+ (i32.add
+ (get_local $0)
+ (i32.const 52)
+ )
+ )
+ (i32.const 1369188723)
+ )
+ (block $switch i32
+ (block $switch-default
+ (block $switch-case
+ (br_table $switch-case $switch-default
+ (i32.sub
+ (get_local $1)
+ (i32.const -1108210269)
+ )
+ )
+ )
+ (br $__rjti$0)
+ )
+ (i32.const 0)
+ )
+ (block $switch0 i32
+ (block $switch-default2
+ (block $switch-case1
+ (br_table $switch-case1 $switch-default2
+ (i32.sub
+ (get_local $1)
+ (i32.const 1369188723)
+ )
+ )
+ )
+ (br $__rjti$0)
+ )
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ (call $switch_reach
+ (get_local $0)
+ )
+ )
+ )
+ (drop
+ (call $switch_reach
+ (get_local $0)
+ )
+ )
+ ;; /tmp/emscripten_test_binaryen2_28hnAe/src.c:59950
+ (get_local $1)
+ )
)
diff --git a/test/debugInfo.fromasm.imprecise.no-opts b/test/debugInfo.fromasm.imprecise.no-opts
index 06066ff29..4bea2c355 100644
--- a/test/debugInfo.fromasm.imprecise.no-opts
+++ b/test/debugInfo.fromasm.imprecise.no-opts
@@ -4,9 +4,12 @@
(import "env" "table" (table 0 0 anyfunc))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
+ (global $STACKTOP (mut i32) (i32.const 0))
(export "add" (func $add))
(export "ret" (func $ret))
(export "opts" (func $opts))
+ (export "fib" (func $fib))
+ (export "switch_reach" (func $switch_reach))
(func $add (param $x i32) (param $y i32) (result i32)
;; tests/hello_world.c:5
(set_local $x
@@ -42,7 +45,6 @@
(i32.const 1)
)
)
- (unreachable)
)
(func $opts (param $x i32) (param $y i32) (result i32)
;; even-opted.cpp:1
@@ -73,4 +75,200 @@
)
)
)
+ (func $fib (param $$0 i32) (result i32)
+ (local $$$0$lcssa i32)
+ (local $$$01518 i32)
+ (local $$$01518$phi i32)
+ (local $$$01617 i32)
+ (local $$$019 i32)
+ (local $$1 i32)
+ (local $$2 i32)
+ (local $$3 i32)
+ (local $$exitcond i32)
+ (local $label i32)
+ (local $sp i32)
+ (set_local $sp
+ (get_global $STACKTOP)
+ )
+ ;; fib.c:3
+ (set_local $$1
+ (i32.gt_s
+ (get_local $$0)
+ (i32.const 0)
+ )
+ )
+ (if
+ (get_local $$1)
+ (block
+ (set_local $$$01518
+ (i32.const 0)
+ )
+ (set_local $$$01617
+ (i32.const 0)
+ )
+ (set_local $$$019
+ (i32.const 1)
+ )
+ )
+ (block
+ (set_local $$$0$lcssa
+ (i32.const 1)
+ )
+ ;; fib.c:8
+ (return
+ (get_local $$$0$lcssa)
+ )
+ )
+ )
+ (loop $while-in
+ (block $while-out
+ ;; fib.c:4
+ (set_local $$2
+ (i32.add
+ (get_local $$$019)
+ (get_local $$$01518)
+ )
+ )
+ ;; fib.c:3
+ (set_local $$3
+ (i32.add
+ (get_local $$$01617)
+ (i32.const 1)
+ )
+ )
+ ;; fib.c:3
+ (set_local $$exitcond
+ (i32.eq
+ (get_local $$3)
+ (get_local $$0)
+ )
+ )
+ (if
+ (get_local $$exitcond)
+ (block
+ (set_local $$$0$lcssa
+ (get_local $$2)
+ )
+ (br $while-out)
+ )
+ (block
+ (set_local $$$01518$phi
+ (get_local $$$019)
+ )
+ (set_local $$$01617
+ (get_local $$3)
+ )
+ (set_local $$$019
+ (get_local $$2)
+ )
+ (set_local $$$01518
+ (get_local $$$01518$phi)
+ )
+ )
+ )
+ (br $while-in)
+ )
+ )
+ ;; fib.c:8
+ (return
+ (get_local $$$0$lcssa)
+ )
+ )
+ (func $switch_reach (param $$p i32) (result i32)
+ (local $$0 i32)
+ (local $$call i32)
+ (local $$magic i32)
+ (local $$rc$0 i32)
+ (local $$switch$split2D i32)
+ (local $label i32)
+ (local $sp i32)
+ (set_local $sp
+ (get_global $STACKTOP)
+ )
+ (set_local $$magic
+ (i32.add
+ (get_local $$p)
+ (i32.const 52)
+ )
+ )
+ (set_local $$0
+ (get_local $$magic)
+ )
+ (set_local $$switch$split2D
+ (i32.lt_s
+ (get_local $$0)
+ (i32.const 1369188723)
+ )
+ )
+ (if
+ (get_local $$switch$split2D)
+ (block $switch
+ (block $switch-default
+ (block $switch-case
+ (br_table $switch-case $switch-default
+ (i32.sub
+ (get_local $$0)
+ (i32.const -1108210269)
+ )
+ )
+ )
+ (block
+ (set_local $label
+ (i32.const 2)
+ )
+ (br $switch)
+ )
+ )
+ (set_local $$rc$0
+ (i32.const 0)
+ )
+ )
+ (block $switch0
+ (block $switch-default2
+ (block $switch-case1
+ (br_table $switch-case1 $switch-default2
+ (i32.sub
+ (get_local $$0)
+ (i32.const 1369188723)
+ )
+ )
+ )
+ (block
+ (set_local $label
+ (i32.const 2)
+ )
+ (br $switch0)
+ )
+ )
+ (set_local $$rc$0
+ (i32.const 0)
+ )
+ )
+ )
+ (if
+ (i32.eq
+ (get_local $label)
+ (i32.const 2)
+ )
+ (block
+ (set_local $$call
+ (call $switch_reach
+ (get_local $$p)
+ )
+ )
+ (set_local $$rc$0
+ (get_local $$call)
+ )
+ )
+ )
+ (drop
+ (call $switch_reach
+ (get_local $$p)
+ )
+ )
+ ;; /tmp/emscripten_test_binaryen2_28hnAe/src.c:59950
+ (return
+ (get_local $$rc$0)
+ )
+ )
)
diff --git a/test/debugInfo.fromasm.no-opts b/test/debugInfo.fromasm.no-opts
index 9c5718e4f..9e3050695 100644
--- a/test/debugInfo.fromasm.no-opts
+++ b/test/debugInfo.fromasm.no-opts
@@ -4,9 +4,12 @@
(import "env" "table" (table 0 0 anyfunc))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
+ (global $STACKTOP (mut i32) (i32.const 0))
(export "add" (func $add))
(export "ret" (func $ret))
(export "opts" (func $opts))
+ (export "fib" (func $fib))
+ (export "switch_reach" (func $switch_reach))
(func $add (param $x i32) (param $y i32) (result i32)
;; tests/hello_world.c:5
(set_local $x
@@ -42,7 +45,6 @@
(i32.const 1)
)
)
- (unreachable)
)
(func $i32s-rem (param $0 i32) (param $1 i32) (result i32)
(if i32
@@ -85,4 +87,200 @@
)
)
)
+ (func $fib (param $$0 i32) (result i32)
+ (local $$$0$lcssa i32)
+ (local $$$01518 i32)
+ (local $$$01518$phi i32)
+ (local $$$01617 i32)
+ (local $$$019 i32)
+ (local $$1 i32)
+ (local $$2 i32)
+ (local $$3 i32)
+ (local $$exitcond i32)
+ (local $label i32)
+ (local $sp i32)
+ (set_local $sp
+ (get_global $STACKTOP)
+ )
+ ;; fib.c:3
+ (set_local $$1
+ (i32.gt_s
+ (get_local $$0)
+ (i32.const 0)
+ )
+ )
+ (if
+ (get_local $$1)
+ (block
+ (set_local $$$01518
+ (i32.const 0)
+ )
+ (set_local $$$01617
+ (i32.const 0)
+ )
+ (set_local $$$019
+ (i32.const 1)
+ )
+ )
+ (block
+ (set_local $$$0$lcssa
+ (i32.const 1)
+ )
+ ;; fib.c:8
+ (return
+ (get_local $$$0$lcssa)
+ )
+ )
+ )
+ (loop $while-in
+ (block $while-out
+ ;; fib.c:4
+ (set_local $$2
+ (i32.add
+ (get_local $$$019)
+ (get_local $$$01518)
+ )
+ )
+ ;; fib.c:3
+ (set_local $$3
+ (i32.add
+ (get_local $$$01617)
+ (i32.const 1)
+ )
+ )
+ ;; fib.c:3
+ (set_local $$exitcond
+ (i32.eq
+ (get_local $$3)
+ (get_local $$0)
+ )
+ )
+ (if
+ (get_local $$exitcond)
+ (block
+ (set_local $$$0$lcssa
+ (get_local $$2)
+ )
+ (br $while-out)
+ )
+ (block
+ (set_local $$$01518$phi
+ (get_local $$$019)
+ )
+ (set_local $$$01617
+ (get_local $$3)
+ )
+ (set_local $$$019
+ (get_local $$2)
+ )
+ (set_local $$$01518
+ (get_local $$$01518$phi)
+ )
+ )
+ )
+ (br $while-in)
+ )
+ )
+ ;; fib.c:8
+ (return
+ (get_local $$$0$lcssa)
+ )
+ )
+ (func $switch_reach (param $$p i32) (result i32)
+ (local $$0 i32)
+ (local $$call i32)
+ (local $$magic i32)
+ (local $$rc$0 i32)
+ (local $$switch$split2D i32)
+ (local $label i32)
+ (local $sp i32)
+ (set_local $sp
+ (get_global $STACKTOP)
+ )
+ (set_local $$magic
+ (i32.add
+ (get_local $$p)
+ (i32.const 52)
+ )
+ )
+ (set_local $$0
+ (get_local $$magic)
+ )
+ (set_local $$switch$split2D
+ (i32.lt_s
+ (get_local $$0)
+ (i32.const 1369188723)
+ )
+ )
+ (if
+ (get_local $$switch$split2D)
+ (block $switch
+ (block $switch-default
+ (block $switch-case
+ (br_table $switch-case $switch-default
+ (i32.sub
+ (get_local $$0)
+ (i32.const -1108210269)
+ )
+ )
+ )
+ (block
+ (set_local $label
+ (i32.const 2)
+ )
+ (br $switch)
+ )
+ )
+ (set_local $$rc$0
+ (i32.const 0)
+ )
+ )
+ (block $switch0
+ (block $switch-default2
+ (block $switch-case1
+ (br_table $switch-case1 $switch-default2
+ (i32.sub
+ (get_local $$0)
+ (i32.const 1369188723)
+ )
+ )
+ )
+ (block
+ (set_local $label
+ (i32.const 2)
+ )
+ (br $switch0)
+ )
+ )
+ (set_local $$rc$0
+ (i32.const 0)
+ )
+ )
+ )
+ (if
+ (i32.eq
+ (get_local $label)
+ (i32.const 2)
+ )
+ (block
+ (set_local $$call
+ (call $switch_reach
+ (get_local $$p)
+ )
+ )
+ (set_local $$rc$0
+ (get_local $$call)
+ )
+ )
+ )
+ (drop
+ (call $switch_reach
+ (get_local $$p)
+ )
+ )
+ ;; /tmp/emscripten_test_binaryen2_28hnAe/src.c:59950
+ (return
+ (get_local $$rc$0)
+ )
+ )
)