--- /dev/null
+; RUN: llc -filetype=obj %s -o %t.o
+; RUN: not wasm-ld --check-signatures --undefined _Z3fooi \
+; RUN: -o %t.wasm %t.o 2>&1 | FileCheck %s
+
+; CHECK: error: undefined symbol: foo(int)
+
+; RUN: not wasm-ld --check-signatures --no-demangle --undefined _Z3fooi \
+; RUN: -o %t.wasm %t.o 2>&1 | FileCheck -check-prefix=CHECK-NODEMANGLE %s
+
+; CHECK-NODEMANGLE: error: undefined symbol: _Z3fooi
+
+target triple = "wasm32-unknown-unknown-wasm"
+
+define hidden void @_start() local_unnamed_addr {
+entry:
+ ret void
+}
Config->AllowUndefined = Args.hasArg(OPT_allow_undefined);
Config->CheckSignatures =
Args.hasFlag(OPT_check_signatures, OPT_no_check_signatures, false);
+ Config->Demangle = Args.hasFlag(OPT_demangle, OPT_no_demangle, true);
Config->Entry = getEntry(Args, Args.hasArg(OPT_relocatable) ? "" : "_start");
Config->ImportMemory = Args.hasArg(OPT_import_memory);
Config->OutputFile = Args.getLastArgValue(OPT_o);
def _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(NAME)>;
}
+multiclass B<string name, string help1, string help2> {
+ def NAME: Flag<["--", "-"], name>, HelpText<help1>;
+ def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText<help2>;
+}
+
// The follow flags are shared with the ELF linker
def color_diagnostics: F<"color-diagnostics">,
HelpText<"Use colors in diagnostics">;
def color_diagnostics_eq: J<"color-diagnostics=">,
HelpText<"Use colors in diagnostics">;
+defm demangle: B<"demangle",
+ "Demangle symbol names",
+ "Do not demangle symbol names">;
+
def entry: S<"entry">, MetaVarName<"<entry>">,
HelpText<"Name of entry point symbol">;