1; RUN: opt -module-summary -o %t1.o %s 2; RUN: opt -module-summary -o %t2.o %S/Inputs/thinlto_backend.ll 3; RUN: llvm-lto -thinlto -o %t %t1.o %t2.o 4 5; Ensure clang -cc1 give expected error for incorrect input type 6; RUN: not %clang_cc1 -O2 -o %t1.o -x c %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-WARNING 7; CHECK-WARNING: error: invalid argument '-fthinlto-index={{.*}}' only allowed with '-x ir' 8 9; Ensure we get expected error for missing index file 10; RUN: %clang -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=bad.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-ERROR 11; CHECK-ERROR: Error loading index file 'bad.thinlto.bc' 12 13; Ensure f2 was imported 14; RUN: %clang -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc 15; RUN: llvm-nm %t3.o | FileCheck --check-prefix=CHECK-OBJ %s 16; CHECK-OBJ: T f1 17; CHECK-OBJ-NOT: U f2 18 19target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 20target triple = "x86_64-unknown-linux-gnu" 21 22declare void @f2() 23 24define void @f1() { 25 call void @f2() 26 ret void 27} 28