xref: /llvm-project/llvm/test/tools/llvm-ar/regular-to-thin-archive-special.test (revision c913c5598b026f0968f3c25db14e232c5b52277e)
1## Test regular archives do not convert to thin archives
2## in the special case of replacing a single file in an
3## archive with itself from the current directory.
4
5# RUN: rm -rf %t && mkdir -p %t && cd %t
6# RUN: echo "a" > a.txt
7# RUN: llvm-ar --format=gnu cr foo.a a.txt 2>&1
8
9## Check that an error is issued.
10# RUN: not llvm-ar --format=gnu cr --thin foo.a a.txt 2>&1 | FileCheck %s
11# CHECK: error: cannot convert a regular archive to a thin one
12
13## Check that the archive is still the correct flavor.
14# RUN: FileCheck --input-file=foo.a %s --check-prefix=REGULAR
15# REGULAR: !<arch>
16