2019-03-16 09:18:12 +08:00
|
|
|
; RUN: llc -filetype=obj %s -o %t.o
|
|
|
|
; RUN: not wasm-ld -o %t.wasm %t.o 2>&1 | FileCheck %s -check-prefix=UNDEF
|
2020-05-02 01:00:53 +08:00
|
|
|
; RUN: wasm-ld --allow-undefined -o %t.wasm %t.o
|
2019-04-23 00:12:54 +08:00
|
|
|
; RUN: not wasm-ld --shared -o %t.wasm %t.o 2>&1 | FileCheck %s -check-prefix=SHARED
|
2019-03-16 09:18:12 +08:00
|
|
|
|
|
|
|
target triple = "wasm32-unknown-unknown"
|
|
|
|
|
|
|
|
@data_external = external global i32
|
|
|
|
|
|
|
|
define i32 @_start() {
|
|
|
|
entry:
|
|
|
|
%0 = load i32, i32* @data_external, align 4
|
|
|
|
ret i32 %0
|
|
|
|
}
|
|
|
|
|
2019-07-08 17:34:30 +08:00
|
|
|
; UNDEF: error: {{.*}}undefined-data.ll.tmp.o: undefined symbol: data_external
|
|
|
|
; SHARED: error: {{.*}}undefined-data.ll.tmp.o: relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol data_external; recompile with -fPIC
|