39 lines · plain
1; REQUIRES: arm2 3;; A bitcode file can generate undefined references to symbols that weren't4;; listed as undefined on the bitcode file itself, when lowering produces5;; calls to e.g. builtin helper functions. Ideally all those functions are6;; listed by lto::LTO::getRuntimeLibcallSymbols(), then we successfully7;; can link cases when the helper functions are provided as bitcode too.8;; (In practice, compiler-rt builtins are always compiled with -fno-lto, so9;; this shouldn't really happen anyway.)10 11; RUN: rm -rf %t.dir12; RUN: split-file %s %t.dir13; RUN: llvm-as %t.dir/main.ll -o %t.main.obj14; RUN: llvm-as %t.dir/sdiv.ll -o %t.sdiv.obj15; RUN: llvm-ar rcs %t.sdiv.lib %t.sdiv.obj16 17; RUN: lld-link /entry:entry %t.main.obj %t.sdiv.lib /out:%t.exe /subsystem:console18 19;--- main.ll20target datalayout = "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"21target triple = "thumbv7-w64-windows-gnu"22 23@num = dso_local global i32 10024 25define dso_local arm_aapcs_vfpcc i32 @entry(i32 %param) {26entry:27 %0 = load i32, ptr @num28 %div = sdiv i32 %0, %param29 ret i32 %div30}31;--- sdiv.ll32target datalayout = "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"33target triple = "thumbv7-w64-windows-gnu"34 35define dso_local arm_aapcs_vfpcc void @__rt_sdiv() {36entry:37 ret void38}39