35 lines · plain
1RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/start.s -o %t.o2RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/ret32.s -o %t.ret32.o3RUN: rm -f %t.a4RUN: llvm-ar rcs %t.a %t.ret32.o5 6Should not add symbols from the archive by default as they are not required7RUN: wasm-ld --no-gc-sections -o %t.wasm %t.o %t.a8RUN: obj2yaml %t.wasm | FileCheck --check-prefix=NOTADDED %s9NOTADDED: FunctionNames:10NOTADDED-NOT: Name: ret3211NOTADDED: ...12 13Should add symbols from the archive if --whole-archive is used14RUN: wasm-ld --no-gc-sections -o %t.wasm %t.o --whole-archive %t.a15RUN: obj2yaml %t.wasm | FileCheck --check-prefix=ADDED %s16ADDED: FunctionNames:17ADDED: Name: ret3218ADDED: ...19 20--no-whole-archive should restore default behaviour21RUN: wasm-ld --no-gc-sections -o %t.wasm %t.o --whole-archive --no-whole-archive %t.a22RUN: obj2yaml %t.wasm | FileCheck --check-prefix=NOTADDED %s23 24--whole-archive and --no-whole-archive should affect only archives which follow them25RUN: wasm-ld --no-gc-sections -o %t.wasm %t.o %t.a --whole-archive --no-whole-archive26RUN: obj2yaml %t.wasm | FileCheck --check-prefix=NOTADDED %s27RUN: wasm-ld --no-gc-sections -o %t.wasm %t.o --whole-archive %t.a --no-whole-archive28RUN: obj2yaml %t.wasm | FileCheck --check-prefix=ADDED %s29 30--whole-archive should also work with thin archives31RUN: rm -f %tthin.a32RUN: llvm-ar --format=gnu rcsT %tthin.a %t.ret32.o33RUN: wasm-ld --no-gc-sections -o %t.wasm %t.o --whole-archive %tthin.a34RUN: obj2yaml %t.wasm | FileCheck --check-prefix=ADDED %s35