1; Tests that `llvm-dis` could disassemble ThinLTO minimized bitcode 2; (e.g., bitcode generated by `opt --thin-link-bitcode-file=<minimized-bitcode>`, 3; or `clang -Xclang -fthin-link-bitcode=<minimized-bitcode>`) 4 5; %t.o is the thin-lto ready bitcode, and %t.thinlink.bc is the minimized bitcode. 6; RUN: opt -thinlto-bc %s -thin-link-bitcode-file=%t.thinlink.bc -o %t.o 7 8; With default options, `llvm-dis` returns invalid record for ThinLTO minimized bitcode. 9; RUN: not llvm-dis %t.thinlink.bc 2>&1 | FileCheck %s --check-prefix=INVALID-RECORD 10 11; INVALID-RECORD: Invalid record 12 13; Tests that `llvm-dis` could disassemble minimized bitcode with `--print-thinlto-index-only`, and verify its content. 14; RUN: llvm-dis --print-thinlto-index-only %t.thinlink.bc -o - | FileCheck %s --check-prefix=DIS 15 16; Tests that `llvm-dis` could disassemble ThinLTO-ready bitcode with `--print-thinlto-index-only`, 17; and verify its content. 18; RUN: llvm-dis --print-thinlto-index-only %t.o -o - | FileCheck %s --check-prefix=DIS 19 20; DIS: ^0 = module: (path: "{{.*}}thinlto-index-disassembled-by-llvm-dis.ll.tmp 21; DIS: ^1 = gv: (name: "aplusb", summaries: (function: (module: ^0, flags: (linkage: external, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0, importType: definition), insts: 2))) ; guid = 22 23source_filename = "add.cpp" 24target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 25target triple = "x86_64-unknown-linux-gnu" 26define i32 @aplusb(i32 %a, i32 %b) { 27 %add = add i32 %b, %a 28 ret i32 %add 29} 30