brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · b1e5b4e Raw
73 lines · plain
1; RUN: opt -module-summary %s -o %t1.bc2; RUN: opt -module-summary %p/Inputs/emit_imports.ll -o %t2.bc3; RUN: opt -module-summary %p/Inputs/emit_imports2.ll -o %t2b.bc4; Include a file with an empty module summary index, to ensure that the expected5; output files are created regardless, for a distributed build system.6; RUN: opt -module-summary %p/Inputs/empty.ll -o %t3.bc7; RUN: rm -f %t3.bc.imports8; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc %t2.bc %t2b.bc %t3.bc9; RUN: llvm-lto -thinlto-action=emitimports -thinlto-index %t.index.bc %t1.bc %t2.bc %t2b.bc %t3.bc10 11; The imports file for this module contains the bitcode file for12; Inputs/emit_imports.ll13; RUN: cat %t1.bc.imports | count 214; RUN: cat %t1.bc.imports | FileCheck %s --check-prefix=IMPORTS115; IMPORTS1: emit_imports.ll.tmp2.bc16; IMPORTS1: emit_imports.ll.tmp2b.bc17 18; The imports file for Input/emit_imports.ll is empty as it does not import anything.19; RUN: cat %t2.bc.imports | count 020 21; The imports file for Input/empty.ll is empty but should exist.22; RUN: cat %t3.bc.imports | count 023 24; RUN: rm -f %t1.thinlto.bc %t1.bc.imports25; RUN: rm -f %t2.thinlto.bc %t2.bc.imports26; RUN: rm -f %t3.bc.thinlto.bc %t3.bc.imports27; RUN: llvm-lto2 run %t1.bc %t2.bc %t2b.bc %t3.bc -o %t.o -save-temps \28; RUN:     -thinlto-distributed-indexes \29; RUN:     -r=%t1.bc,g, \30; RUN:     -r=%t1.bc,h, \31; RUN:     -r=%t1.bc,f,px \32; RUN:     -r=%t2.bc,g,px \33; RUN:     -r=%t2b.bc,h,px34 35; Ensure imports weren't generated since -thinlto-emit-imports wasn't specified36; RUN: not ls %t1.bc.imports37; RUN: not ls %t2.bc.imports38; RUN: not ls %t3.bc.imports39 40; RUN: llvm-lto2 run %t1.bc %t2.bc %t2b.bc %t3.bc -o %t.o -save-temps \41; RUN:     -thinlto-distributed-indexes \42; RUN:     -thinlto-emit-imports \43; RUN:     -r=%t1.bc,g, \44; RUN:     -r=%t1.bc,h, \45; RUN:     -r=%t1.bc,f,px \46; RUN:     -r=%t2.bc,g,px \47; RUN:     -r=%t2b.bc,h,px48 49; RUN: cat %t1.bc.imports | count 250; RUN: cat %t1.bc.imports | FileCheck %s --check-prefix=IMPORTS151 52; The imports file for Input/emit_imports.ll is empty as it does not import anything.53; RUN: cat %t2.bc.imports | count 054 55; The imports file for Input/empty.ll is empty but should exist.56; RUN: cat %t3.bc.imports | count 057 58; The index file should be created even for the input with an empty summary.59; RUN: ls %t3.bc.thinlto.bc60 61target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"62target triple = "x86_64-unknown-linux-gnu"63 64declare void @g(...)65declare void @h(...)66 67define void @f() {68entry:69  call void (...) @g()70  call void (...) @h()71  ret void72}73