1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2 # RUN: not wasm-ld -o %t.wasm %t.o 2>&1 | FileCheck %s -check-prefix=UNDEF
3 # RUN: wasm-ld --allow-undefined -o %t.wasm %t.o
4 # RUN: not wasm-ld --shared -o %t.wasm %t.o 2>&1 | FileCheck %s -check-prefix=SHARED
8 .functype _start () -> (i32)
10 i32.load data_external
13 .size data_external, 4
15 # UNDEF: error: {{.*}}undefined-data.s.tmp.o: undefined symbol: data_external
16 # SHARED: error: {{.*}}undefined-data.s.tmp.o: relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `data_external`; recompile with -fPIC