brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 6f5acd8 Raw
96 lines · plain
1; Test distributed build thin link output from llvm-lto22 3; Generate bitcode files with summary, as well as minimized bitcode containing just the summary4; RUN: opt -thinlto-bc %s -thin-link-bitcode-file=%t1.thinlink.bc -o %t1.bc5; RUN: opt -thinlto-bc %p/Inputs/distributed_import.ll -thin-link-bitcode-file=%t2.thinlink.bc -o %t2.bc6; RUN: llvm-bcanalyzer -dump %t1.thinlink.bc | FileCheck --check-prefix=THINLINKBITCODE %s7 8; First perform the thin link on the normal bitcode file.9; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \10; RUN:     -thinlto-distributed-indexes \11; RUN:     -r=%t1.bc,g, \12; RUN:     -r=%t1.bc,analias, \13; RUN:     -r=%t1.bc,f,px \14; RUN:     -r=%t2.bc,g,px \15; RUN:     -r=%t2.bc,analias,px \16; RUN:     -r=%t2.bc,aliasee,px17; RUN: opt -passes=function-import -import-all-index -enable-import-metadata -summary-file %t1.bc.thinlto.bc %t1.bc -o %t1.out18; RUN: opt -passes=function-import -import-all-index -summary-file %t2.bc.thinlto.bc %t2.bc -o %t2.out19; RUN: llvm-dis -o - %t1.out | FileCheck %s --check-prefix=IMPORT20; RUN: llvm-dis -o - %t2.out | FileCheck %s --check-prefix=EXPORT21 22; Save the generated index files.23; RUN: cp %t1.bc.thinlto.bc %t1.bc.thinlto.bc.orig24; RUN: cp %t2.bc.thinlto.bc %t2.bc.thinlto.bc.orig25 26; Copy the minimized bitcode to the regular bitcode path so the module27; paths in the index are the same (save the regular bitcode for use again28; further down).29; RUN: cp %t1.bc %t1.bc.sv30; RUN: cp %t1.thinlink.bc %t1.bc31; RUN: cp %t2.bc %t2.bc.sv32; RUN: cp %t2.thinlink.bc %t2.bc33 34; Next perform the thin link on the minimized bitcode files, and compare dumps35; of the resulting indexes to the above dumps to ensure they are identical.36; RUN: rm -f %t1.bc.thinlto.bc %t2.bc.thinlto.bc37; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \38; RUN:     -thinlto-distributed-indexes \39; RUN:     -r=%t1.bc,g, \40; RUN:     -r=%t1.bc,analias, \41; RUN:     -r=%t1.bc,f,px \42; RUN:     -r=%t2.bc,g,px \43; RUN:     -r=%t2.bc,analias,px \44; RUN:     -r=%t2.bc,aliasee,px45; RUN: diff %t1.bc.thinlto.bc.orig %t1.bc.thinlto.bc46; RUN: diff %t2.bc.thinlto.bc.orig %t2.bc.thinlto.bc47 48; Make sure importing occurs as expected49; RUN: cp %t1.bc.sv %t1.bc50; RUN: cp %t2.bc.sv %t2.bc51; RUN: opt -passes=function-import -import-all-index -enable-import-metadata -summary-file %t1.bc.thinlto.bc %t1.bc -o %t1.out52; RUN: opt -passes=function-import -import-all-index -summary-file %t2.bc.thinlto.bc %t2.bc -o %t2.out53; RUN: llvm-dis -o - %t1.out | FileCheck %s --check-prefix=IMPORT54; RUN: llvm-dis -o - %t2.out | FileCheck %s --check-prefix=EXPORT55 56; IMPORT: define available_externally i32 @g() !thinlto_src_module57; IMPORT: define available_externally void @analias() !thinlto_src_module58; EXPORT: @G.llvm.59 60target triple = "x86_64-unknown-linux-gnu"61target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"62 63declare i32 @g(...)64declare void @analias(...)65 66define void @f() {67entry:68  call i32 (...) @g()69  call void (...) @analias()70  ret void71}72 73; THINLINKBITCODE-NOT: IDENTIFICATION_BLOCK_ID74; THINLINKBITCODE-NOT: BLOCKINFO_BLOCK75; THINLINKBITCODE-NOT: TYPE_BLOCK_ID76; THINLINKBITCODE-NOT: VSTOFFSET77; THINLINKBITCODE-NOT: CONSTANTS_BLOCK78; THINLINKBITCODE-NOT: METADATA_KIND_BLOCK79; THINLINKBITCODE-NOT: METADATA_BLOCK80; THINLINKBITCODE-NOT: OPERAND_BUNDLE_TAGS_BLOCK81; THINLINKBITCODE-NOT: UnknownBlock2682; THINLINKBITCODE-NOT: FUNCTION_BLOCK83; THINLINKBITCODE-NOT: VALUE_SYMTAB84; THINLINKBITCODE: MODULE_BLOCK85; THINLINKBITCODE: VERSION86; THINLINKBITCODE: SOURCE_FILENAME87; THINLINKBITCODE: GLOBALVAL_SUMMARY_BLOCK88; THINLINKBITCODE: HASH89; THINLINKBITCODE: SYMTAB_BLOCK90; THINLINKBITCODE: STRTAB_BLOCK91 92!llvm.dbg.cu = !{}93 94!1 = !{i32 2, !"Debug Info Version", i32 3}95!llvm.module.flags = !{!1}96