brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · c961179 Raw
51 lines · plain
1; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t2 -thinlto-split-lto-unit -o %t %s2; RUN: llvm-dis -o - %t | FileCheck %s3; RUN: llvm-bcanalyzer -dump %t | FileCheck --check-prefix=BCA %s4; When not splitting the module, the thin link bitcode file should simply be a5; copy of the regular module.6; RUN: diff %t %t27 8 9; Do it again, with preserved uselistorder10; RUN: opt --preserve-bc-uselistorder -thinlto-bc -thin-link-bitcode-file=%t2 -thinlto-split-lto-unit -o %t %s11; RUN: llvm-dis --preserve-ll-uselistorder -o - %t | FileCheck -check-prefixes=CHECK,USELISTORDER %s12; RUN: llvm-bcanalyzer -dump %t | FileCheck --check-prefix=BCA %s13; When not splitting the module, the thin link bitcode file should simply be a14; copy of the regular module.15; RUN: diff %t %t216 17 18; BCA: <FULL_LTO_GLOBALVAL_SUMMARY_BLOCK19; BCA-NOT: <GLOBALVAL_SUMMARY_BLOCK20 21; CHECK: @llvm.global_ctors = appending global22@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @f, ptr null }]23 24; CHECK: @g = internal global i8 42, !type !025@g = internal global i8 42, !type !026 27declare void @sink(ptr)28 29; CHECK: define internal void @f()30define internal void @f() {31  call void @sink(ptr @g)32  call void @sink(ptr @g)33  call void @sink(ptr @g)34  ret void35}36 37$h = comdat any38; CHECK: define void @h() comdat39define void @h() comdat {40  ret void41}42 43uselistorder ptr @g, { 2, 1, 0}44; USELISTORDER: uselistorder ptr @g, { 2, 1, 0 }45 46; CHECK: !llvm.module.flags = !{![[FLAG1:[0-9]+]], ![[FLAG2:[0-9]+]]}47; CHECK: ![[FLAG1]] = !{i32 1, !"EnableSplitLTOUnit", i32 1}48; CHECK: ![[FLAG2]] = !{i32 1, !"ThinLTO", i32 0}49 50!0 = !{i32 0, !"typeid"}51