1 ; REQUIRES: x86, non-root-user
2 ;; Test a few properties not tested by thinlto-index-only.ll
4 ; RUN: opt -module-summary %s -o %t1.o
5 ; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
6 ; RUN: opt -module-summary %p/Inputs/thinlto_empty.ll -o %t3.o
8 ; Ensure lld generates error if unable to write to imports file.
9 ; RUN: rm -f %t3.o.imports
10 ; RUN: touch %t3.o.imports
11 ; RUN: chmod 400 %t3.o.imports
12 ; RUN: not ld.lld --plugin-opt=thinlto-index-only --plugin-opt=thinlto-emit-imports-files -shared %t1.o %t2.o %t3.o -o /dev/null 2>&1 | FileCheck -DMSG=%errc_EACCES %s --check-prefix=ERR
13 ; ERR: 'cannot open {{.*}}3.o.imports': [[MSG]]
15 ; RUN: rm -f %t1.o.imports %t2.o.imports rm -f %t3.o.imports
16 ; RUN: ld.lld --plugin-opt=thinlto-emit-imports-files -shared %t1.o %t2.o %t3.o -o %t4
17 ; RUN: not ls %t1.o.imports
18 ; RUN: not ls %t2.o.imports
19 ; RUN: not ls %t3.o.imports
21 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
22 target triple = "x86_64-unknown-linux-gnu"