File: no-shlib-sigcheck.s

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: 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 (39 lines) | stat: -rw-r--r-- 1,474 bytes parent folder | download | duplicates (12)
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
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-emscripten -o %t.o %s
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-emscripten %p/Inputs/ret32.s -o %t.ret32.o
# RUN: wasm-ld --experimental-pic -shared %t.ret32.o -o %t.lib.so

## Fails with signature mismatch by default
# RUN: not wasm-ld --experimental-pic -pie -o %t.wasm %t.o %t.lib.so 2>&1 | FileCheck --check-prefix=ERROR %s
## Same again with shared library first.
# RUN: not wasm-ld --experimental-pic -pie -o %t.wasm %t.lib.so %t.o 2>&1 | FileCheck --check-prefix=ERROR %s

## Succeeds with --no-shlib-sigcheck added
# RUN: wasm-ld --experimental-pic -pie -o %t.wasm %t.o %t.lib.so --no-shlib-sigcheck
# RUN: obj2yaml %t.wasm | FileCheck %s
## Same again with shared library first.
# RUN: wasm-ld --experimental-pic -pie -o %t.wasm %t.lib.so %t.o --no-shlib-sigcheck
# RUN: obj2yaml %t.wasm | FileCheck %s

.functype ret32 (f32) -> (i64)

.globl _start
_start:
  .functype _start () -> ()
  f32.const 0.0
  call ret32
  drop
  end_function

# ERROR: wasm-ld: error: function signature mismatch: ret32
# ERROR: >>> defined as (f32) -> i64 in {{.*}}.o

# CHECK:       - Type:            TYPE
# CHECK-NEXT:    Signatures:
# CHECK-NEXT:      - Index:           0
# CHECK-NEXT:        ParamTypes:
# CHECK-NEXT:          - F32
# CHECK-NEXT:        ReturnTypes:
# CHECK-NEXT:          - I64
# CHECK-NEXT:      - Index:           1
# CHECK-NEXT:        ParamTypes:      []
# CHECK-NEXT:        ReturnTypes:     []