71 lines · plain
1## Show that CREATE/CREATETHIN overwrite existing files appropriately.2 3# RUN: rm -rf %t4# RUN: split-file %s %t5# RUN: cd %t6 7## Show that an existing file that is not an archive is overwritten by CREATE.8# RUN: touch test.a9# RUN: llvm-ar -M < create.mri10# RUN: FileCheck --input-file=test.a %s --check-prefixes=ARCH,TWO11 12## Show that an existing file that is not an archive is overwritten by CREATETHIN.13# RUN: rm -f test.a14# RUN: touch test.a15# RUN: llvm-ar --format=gnu -M < createthin.mri16# RUN: FileCheck --input-file=test.a %s --check-prefixes=THIN,TWO17 18## Show that an existing regular archive is overwritten by CREATE.19# RUN: rm -f test.a20# RUN: llvm-ar cr test.a 1.txt21# RUN: llvm-ar -M < create.mri22# RUN: llvm-ar tv test.a23# RUN: FileCheck --input-file=test.a %s --check-prefixes=ARCH,TWO --implicit-check-not=1.txt24 25## Show that an existing regular archive is overwritten by CREATETHIN.26# RUN: rm -f test.a27# RUN: llvm-ar --format=gnu cr test.a 1.txt28# RUN: llvm-ar --format=gnu -M < createthin.mri29# RUN: FileCheck --input-file=test.a %s --check-prefixes=THIN,TWO --implicit-check-not=1.txt30 31## Show that an existing thin archive is overwritten by CREATE.32# RUN: rm -f test.a33# RUN: llvm-ar --format=gnu crT test.a 1.txt34# RUN: llvm-ar --format=gnu -M < create.mri35# RUN: FileCheck --input-file=test.a %s --check-prefixes=ARCH,TWO --implicit-check-not=1.txt36 37## Show that an existing thin archive is overwritten by CREATETHIN.38# RUN: rm -f test.a39# RUN: llvm-ar --format=gnu crT test.a 1.txt40# RUN: llvm-ar --format=gnu -M < createthin.mri41# RUN: FileCheck --input-file=test.a %s --check-prefixes=THIN,TWO --implicit-check-not=1.txt42 43## Show that the output is not overwritten without a SAVE.44# RUN: rm -f test.a45# RUN: llvm-ar --format=gnu crT test.a 1.txt46# RUN: llvm-ar --format=gnu -M < nosave.mri47# RUN: FileCheck --input-file=test.a %s --check-prefixes=THIN,ONE --implicit-check-not=2.txt48 49# ARCH: {{!<arch>|<bigaf>}}50# THIN: !<thin>51# ONE: 1.txt52# TWO: 2.txt53 54#--- 1.txt55 56#--- 2.txt57 58#--- create.mri59CREATE test.a60ADDMOD 2.txt61SAVE62 63#--- createthin.mri64CREATETHIN test.a65ADDMOD 2.txt66SAVE67 68#--- nosave.mri69CREATE test.a70ADDMOD 2.txt71