44 lines · plain
1# RUN: llvm-mc -filetype=obj -triple=wasm64-unknown-unknown -o %t.o %s2 3# RUN: not wasm-ld -mwasm64 --experimental-pic -shared %t.o -o /dev/null 2>&1 | \4# RUN: FileCheck %s5 6# RUN: not wasm-ld -mwasm64 --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=report-all 2>&1 | \7# RUN: FileCheck %s8 9# RUN: not wasm-ld -mwasm64 --experimental-pic -shared %t.o -o /dev/null --warn-unresolved-symbols 2>&1 | \10# RUN: FileCheck %s11 12# RUN: not wasm-ld -mwasm64 --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=ignore-all 2>&1 | \13# RUN: FileCheck %s14 15# RUN: not wasm-ld -mwasm64 --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=import-dynamic 2>&1 | \16# RUN: FileCheck %s17 18## These errors should not be reported under -r/--relocation (i.e. when19## generating an object file)20# RUN: wasm-ld -mwasm64 --experimental-pic -r %t.o -o /dev/null21 22.functype external_func () -> ()23 24use_undefined_function:25 .functype use_undefined_function () -> ()26 i64.const external_func@TBREL27 # CHECK: error: {{.*}}.o: relocation R_WASM_TABLE_INDEX_REL_SLEB64 is not supported against an undefined symbol `external_func`28 drop29 end_function30 31use_undefined_data:32 .functype use_undefined_data () -> ()33 i64.const external_data@MBREL34 # CHECK: error: {{.*}}.o: relocation R_WASM_MEMORY_ADDR_REL_SLEB64 is not supported against an undefined symbol `external_data`35 drop36 end_function37 38.globl _start39_start:40 .functype _start () -> ()41 call use_undefined_function42 call use_undefined_data43 end_function44