1REQUIRES: x86 2 3RUN: rm -rf %t && mkdir -p %t && cd %t 4RUN: llvm-as %S/Inputs/undefined-symbol-lto-a.ll -o t.obj 5RUN: llvm-as %S/Inputs/undefined-symbol-lto-b.ll -o b.obj 6RUN: llvm-lib b.obj -out:b.lib 7RUN: not lld-link -entry:main -nodefaultlib t.obj b.lib -subsystem:console 2>&1 | FileCheck %s 8 9CHECK: undefined symbol: main 10CHECK: undefined symbol: void __cdecl undefined_ref(void) 11CHECK: referenced by 12 13Originally reported as PR42536. 14 15a.ll corresponds to this C++: 16 17struct __declspec(dllimport) S { 18 virtual void foo(); 19}; 20void undefined_ref(); 21struct Init { 22 Init() { undefined_ref(); } 23 S c; 24} d; 25 26b.ll is from this C++: 27 28struct S { 29 virtual void foo(); 30}; 31void S::foo() {} 32