summaryrefslogtreecommitdiff
path: root/test/debugInfo.fromasm.no-opts
blob: af52ca902cf1a8cc7ba97efd1376f0062ca8b163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
(module
  (type $FUNCSIG$vii (func (param i32 i32)))
  (import "env" "memory" (memory $0 256 256))
  (import "env" "table" (table 0 0 anyfunc))
  (import "env" "memoryBase" (global $memoryBase i32))
  (import "env" "tableBase" (global $tableBase i32))
  (export "add" (func $add))
  (export "ret" (func $ret))
  (export "opts" (func $opts))
  (func $add (param $x i32) (param $y i32) (result i32)
    ;; tests/hello_world.c:5
    (set_local $x
      (get_local $x)
    )
    ;; tests/hello_world.c:6
    (set_local $y
      (get_local $y)
    )
    ;; tests/other_file.cpp:314159
    (set_local $x
      (get_local $y)
    )
    (return
      (i32.add
        (get_local $x)
        (get_local $y)
      )
    )
  )
  (func $ret (param $x i32) (result i32)
    ;; return.cpp:50
    (set_local $x
      (i32.shl
        (get_local $x)
        (i32.const 1)
      )
    )
    ;; return.cpp:100
    (return
      (i32.add
        (get_local $x)
        (i32.const 1)
      )
    )
  )
  (func $i32s-rem (param $0 i32) (param $1 i32) (result i32)
    (if i32
      (i32.eqz
        (get_local $1)
      )
      (i32.const 0)
      (i32.rem_s
        (get_local $0)
        (get_local $1)
      )
    )
  )
  (func $opts (param $x i32) (param $y i32) (result i32)
    ;; even-opted.cpp:1
    (set_local $x
      (i32.add
        (get_local $x)
        (get_local $y)
      )
    )
    ;; even-opted.cpp:2
    (set_local $y
      (i32.shr_s
        (get_local $y)
        (get_local $x)
      )
    )
    ;; even-opted.cpp:3
    (set_local $x
      (call $i32s-rem
        (get_local $x)
        (get_local $y)
      )
    )
    (return
      (i32.add
        (get_local $x)
        (get_local $y)
      )
    )
  )
)