File: wasm-basic.s

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
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