brintos

brintos / llvm-project-archived public Read only

0
0
Text · 878 B · 0ad93b7 Raw
28 lines · plain
1; RUN: llc -filetype=obj %s -o %t.o2; RUN: wasm-ld --allow-undefined -o %t.wasm %t.o3 4; Fails due to undefined 'foo'5; RUN: not wasm-ld --undefined=baz -o %t.wasm %t.o 2>&1 | FileCheck %s6; CHECK: error: {{.*}}.o: undefined symbol: foo7; CHECK-NOT: undefined symbol: baz8 9; Succeeds if we pass a file containing 'foo' as --allow-undefined-file.10; RUN: echo 'foo' > %t.txt11; RUN: wasm-ld --allow-undefined-file=%t.txt -o %t.wasm %t.o12 13; Succeeds even if a missing symbol is added via --export14; RUN: wasm-ld --allow-undefined --export=xxx -o %t.wasm %t.o15 16target triple = "wasm32-unknown-unknown"17 18; Takes the address of the external foo() resulting in undefined external19@bar = global ptr @foo, align 420@llvm.used = appending global [1 x ptr] [ptr @bar], section "llvm.metadata"21 22declare i32 @foo() #023 24define hidden void @_start() local_unnamed_addr #0 {25entry:26    ret void27}28