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 | \
6 # RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=report-all 2>&1 | \
9 # RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --warn-unresolved-symbols 2>&1 | \
12 # RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=ignore-all 2>&1 | \
15 # RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=import-dynamic 2>&1 | \
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`
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`
40 .functype _start () -> ()
41 call use_undefined_function
42 call use_undefined_data