llvm-project
16 строк · 642.0 Байт
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
5
6.globl _start
7_start:
8.functype _start () -> (i32)
9i32.const 0
10i32.load data_external
11end_function
12
13.size data_external, 4
14
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
17