[flang] Support OPEN(..., FORM="BINARY") (#124657)
[llvm-project.git] / lld / test / wasm / unsupported-pic-relocations.s
blob2f85afa02c88b160acab201c7769b2b26d106312
1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
3 # RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null 2>&1 | \
4 # RUN: FileCheck %s
6 # RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=report-all 2>&1 | \
7 # RUN: FileCheck %s
9 # RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --warn-unresolved-symbols 2>&1 | \
10 # RUN: FileCheck %s
12 # RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=ignore-all 2>&1 | \
13 # RUN: FileCheck %s
15 # RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=import-dynamic 2>&1 | \
16 # RUN: FileCheck %s
18 ## These errors should not be reported under -r/--relocation (i.e. when
19 ## generating an object file)
20 # RUN: wasm-ld --experimental-pic -r %t.o -o /dev/null
22 .functype external_func () -> ()
24 use_undefined_function:
25 .functype use_undefined_function () -> ()
26 i32.const external_func@TBREL
27 # CHECK: error: {{.*}}.o: relocation R_WASM_TABLE_INDEX_REL_SLEB is not supported against an undefined symbol `external_func`
28 drop
29 end_function
31 use_undefined_data:
32 .functype use_undefined_data () -> ()
33 i32.const external_data@MBREL
34 # CHECK: error: {{.*}}.o: relocation R_WASM_MEMORY_ADDR_REL_SLEB is not supported against an undefined symbol `external_data`
35 drop
36 end_function
38 .globl _start
39 _start:
40 .functype _start () -> ()
41 call use_undefined_function
42 call use_undefined_data
43 end_function