brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 2d5cfaa Raw
65 lines · plain
1; Generate bitcode files with summary, as well as minimized bitcode without2; the debug metadata for the thin link.3; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t2 -thinlto-split-lto-unit -o %t %s4; RUN: llvm-modextract -b -n 0 -o %t0.bc %t5; RUN: llvm-modextract -b -n 1 -o %t1.bc %t6; RUN: llvm-modextract -b -n 0 -o %t0.thinlink.bc %t27; RUN: llvm-modextract -b -n 1 -o %t1.thinlink.bc %t28; RUN: not llvm-modextract -b -n 2 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s9; RUN: llvm-dis -preserve-ll-uselistorder -o - %t0.bc | FileCheck --check-prefix=M0 %s10; RUN: llvm-dis -preserve-ll-uselistorder -o - %t1.bc | FileCheck --check-prefix=M1 %s11; RUN: llvm-bcanalyzer -dump %t0.bc | FileCheck --check-prefix=BCA0 %s12; RUN: llvm-bcanalyzer -dump %t1.bc | FileCheck --check-prefix=BCA1 %s13 14; Make sure the combined index files produced by both the normal and the15; thin link bitcode files are identical16; RUN: llvm-lto -thinlto -o %t3 %t0.bc17; Copy the minimized bitcode to the regular bitcode path so the module18; paths in the index are the same.19; RUN: cp %t0.thinlink.bc %t0.bc20; RUN: llvm-lto -thinlto -o %t4 %t0.bc21; RUN: diff %t3.thinlto.bc %t4.thinlto.bc22 23; ERROR: llvm-modextract: error: module index out of range; bitcode file contains 2 module(s)24 25; BCA0: <GLOBALVAL_SUMMARY_BLOCK26; BCA1: <FULL_LTO_GLOBALVAL_SUMMARY_BLOCK27; 16 = not eligible to import28; BCA1: <PERMODULE_GLOBALVAR_INIT_REFS {{.*}} op1=1629; BCA1-NOT: <GLOBALVAL_SUMMARY_BLOCK30 31$g = comdat any32 33; M0: @g = external global i8{{$}}34; M1: @g = global i8 42, comdat, !type !035@g = global i8 42, comdat, !type !036 37; M0: @g1 = external global i8{{$}}38; M1: @g1 = global i8 43, !type !039@g1 = global i8 43, !type !040 41; M0: define ptr @f()42; M1-NOT: @f()43define ptr @f() {44  ret ptr @g45}46 47; M0: define void @h(ptr %ptr)48; M1-NOT: @h(49 50define void @h(ptr %ptr) {51  store ptr @g1, ptr %ptr52  store ptr @g1, ptr %ptr53  store ptr @g1, ptr %ptr54  store ptr @g1, ptr %ptr55  ret void56}57 58; M0: uselistorder ptr @g1, { 3, 2, 0, 1 }59; M1-NOT: uselistorder60 61uselistorder ptr @g1, { 3, 2, 0, 1 }62 63; M1: !0 = !{i32 0, !"typeid"}64!0 = !{i32 0, !"typeid"}65