File: wasm-basic.s

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (59 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download | duplicates (7)
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
# REQUIRES: webassembly-registered-target
# RUN: llvm-mc -triple=wasm32-unknown-unknown -filetype=obj %s -o %t.o -g
# RUN: llvm-symbolizer --basenames --output-style=GNU -e %t.o 1 2 3 4 5 6 7 8 9 10 11 12 13 | FileCheck %s

foo:
    .functype foo () -> ()
    nop
    return
    end_function

bar:
    .functype bar (i32) -> (i32)
    local.get 0
    nop
    return
    end_function


## Symbols start from (including) the function length and should cover all the
## way to the next symbol start.
## TODO: create a loc for .functype? It could go with the local declarations.

## Byte 1 is the function length, has no loc but the symbol table considers it
## the start of the function
# CHECK: foo
# CHECK-NEXT: ??:0
## Byte 2 is the local declaration, but for some reason DWARF is marking it as line 7.
## TODO: figure out why.
# CHECK-NEXT: foo
# CHECK-NEXT: wasm-basic.s:7
## Byte 3 is actually the nop, line 7
# CHECK-NEXT: foo
# CHECK-NEXT: wasm-basic.s:7
## Byte 4 is the return, line 8
# CHECK-NEXT: foo
# CHECK-NEXT: wasm-basic.s:8
## Byte 5 is the end_function, line 9
# CHECK-NEXT: foo
# CHECK-NEXT: wasm-basic.s:9
## Byte 6 is bar's function length, symbol table considers it part of bar
# CHECK-NEXT: bar
# CHECK-NEXT: ??:0
## Byte 7 bar's local declaration, but DWARF marks it as line 13, like above
# CHECK-NEXT: bar
# CHECK-NEXT: wasm-basic.s:13
## Byte 8 and 9 are actually the local.get on line 13
# CHECK-NEXT: bar
# CHECK-NEXT: wasm-basic.s:13
# CHECK-NEXT: bar
# CHECK-NEXT: wasm-basic.s:13
## Byte 10 is the nop
# CHECK-NEXT: bar
# CHECK-NEXT: wasm-basic.s:14
## Byte b is the return
# CHECK-NEXT: bar
# CHECK-NEXT: wasm-basic.s:15
## Byte c is end_function
# CHECK-NEXT: bar
# CHECK-NEXT: wasm-basic.s:16