diff --git a/llvm/test/tools/llvm-ifs/binary-read-add-soname.test b/llvm/test/tools/llvm-ifs/binary-read-add-soname.test --- a/llvm/test/tools/llvm-ifs/binary-read-add-soname.test +++ b/llvm/test/tools/llvm-ifs/binary-read-add-soname.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- --soname=best.so %t | FileCheck %s +# RUN: llvm-ifs --input-format=ELF --output-ifs=- --soname=best.so %t | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-arch.test b/llvm/test/tools/llvm-ifs/binary-read-arch.test --- a/llvm/test/tools/llvm-ifs/binary-read-arch.test +++ b/llvm/test/tools/llvm-ifs/binary-read-arch.test @@ -1,6 +1,6 @@ # RUN: yaml2obj --docnum=1 %s -o %t -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- %t | FileCheck %s -DTARGET="{ ObjectFormat: ELF, Arch: x86_64, Endianness: little, BitWidth: 64 }" -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- --hint-ifs-target="x86_64-linux-gnu" %t | FileCheck %s -DTARGET="x86_64-linux-gnu" +# RUN: llvm-ifs --input-format=ELF --output-ifs=- %t | FileCheck %s -DTARGET="{ ObjectFormat: ELF, Arch: x86_64, Endianness: little, BitWidth: 64 }" +# RUN: llvm-ifs --input-format=ELF --output-ifs=- --hint-ifs-target="x86_64-linux-gnu" %t | FileCheck %s -DTARGET="x86_64-linux-gnu" --- !ELF FileHeader: @@ -52,7 +52,7 @@ # HINTERR: error: Triple hint does not match the actual [[MSG]] # RUN: yaml2obj --docnum=1 %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe --hint-ifs-target="aarch64-linux-gnu" %t 2>&1 | FileCheck %s -DMSG=architecture --check-prefix=HINTERR +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe --hint-ifs-target="aarch64-linux-gnu" %t 2>&1 | FileCheck %s -DMSG=architecture --check-prefix=HINTERR --- !ELF FileHeader: @@ -96,7 +96,7 @@ LastSec: .dynamic # RUN: yaml2obj --docnum=2 %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe --hint-ifs-target="x86_64-unknown-linux-gnu" %t 2>&1 | FileCheck %s -DMSG="endianness" --check-prefix=HINTERR +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe --hint-ifs-target="x86_64-unknown-linux-gnu" %t 2>&1 | FileCheck %s -DMSG="endianness" --check-prefix=HINTERR --- !ELF FileHeader: @@ -140,4 +140,4 @@ LastSec: .dynamic # RUN: yaml2obj --docnum=3 %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe --hint-ifs-target="x86_64-unknown-linux-gnu" %t 2>&1 | FileCheck %s -DMSG="bit width" --check-prefix=HINTERR +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe --hint-ifs-target="x86_64-unknown-linux-gnu" %t 2>&1 | FileCheck %s -DMSG="bit width" --check-prefix=HINTERR diff --git a/llvm/test/tools/llvm-ifs/binary-read-bad-soname.test b/llvm/test/tools/llvm-ifs/binary-read-bad-soname.test --- a/llvm/test/tools/llvm-ifs/binary-read-bad-soname.test +++ b/llvm/test/tools/llvm-ifs/binary-read-bad-soname.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe %t 2>&1 | FileCheck %s +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe %t 2>&1 | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-bad-vaddr.test b/llvm/test/tools/llvm-ifs/binary-read-bad-vaddr.test --- a/llvm/test/tools/llvm-ifs/binary-read-bad-vaddr.test +++ b/llvm/test/tools/llvm-ifs/binary-read-bad-vaddr.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe %t 2>&1 | FileCheck %s +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe %t 2>&1 | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-neededlibs-bad-offset.test b/llvm/test/tools/llvm-ifs/binary-read-neededlibs-bad-offset.test --- a/llvm/test/tools/llvm-ifs/binary-read-neededlibs-bad-offset.test +++ b/llvm/test/tools/llvm-ifs/binary-read-neededlibs-bad-offset.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe %t 2>&1 | FileCheck %s +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe %t 2>&1 | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-neededlibs.test b/llvm/test/tools/llvm-ifs/binary-read-neededlibs.test --- a/llvm/test/tools/llvm-ifs/binary-read-neededlibs.test +++ b/llvm/test/tools/llvm-ifs/binary-read-neededlibs.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- %t | FileCheck %s +# RUN: llvm-ifs --input-format=ELF --output-ifs=- %t | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-no-dt-strsz.test b/llvm/test/tools/llvm-ifs/binary-read-no-dt-strsz.test --- a/llvm/test/tools/llvm-ifs/binary-read-no-dt-strsz.test +++ b/llvm/test/tools/llvm-ifs/binary-read-no-dt-strsz.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe %t 2>&1 | FileCheck %s +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe %t 2>&1 | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-no-dt-strtab.test b/llvm/test/tools/llvm-ifs/binary-read-no-dt-strtab.test --- a/llvm/test/tools/llvm-ifs/binary-read-no-dt-strtab.test +++ b/llvm/test/tools/llvm-ifs/binary-read-no-dt-strtab.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe %t 2>&1 | FileCheck %s +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe %t 2>&1 | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-no-dynamic.test b/llvm/test/tools/llvm-ifs/binary-read-no-dynamic.test --- a/llvm/test/tools/llvm-ifs/binary-read-no-dynamic.test +++ b/llvm/test/tools/llvm-ifs/binary-read-no-dynamic.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe %t 2>&1 | FileCheck %s +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe %t 2>&1 | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-replace-soname.test b/llvm/test/tools/llvm-ifs/binary-read-replace-soname.test --- a/llvm/test/tools/llvm-ifs/binary-read-replace-soname.test +++ b/llvm/test/tools/llvm-ifs/binary-read-replace-soname.test @@ -1,6 +1,6 @@ # RUN: yaml2obj %s -o %t -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- %t | FileCheck %s --check-prefix=ORIGINAL -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --soname=libbest.so --output=- %t | FileCheck %s --check-prefix=REPLACED +# RUN: llvm-ifs --input-format=ELF --output-ifs=- %t | FileCheck %s --check-prefix=ORIGINAL +# RUN: llvm-ifs --input-format=ELF --output-ifs=- --soname=libbest.so %t | FileCheck %s --check-prefix=REPLACED !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-soname-no-null.test b/llvm/test/tools/llvm-ifs/binary-read-soname-no-null.test --- a/llvm/test/tools/llvm-ifs/binary-read-soname-no-null.test +++ b/llvm/test/tools/llvm-ifs/binary-read-soname-no-null.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t.tbe %t 2>&1 | FileCheck %s +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t.tbe %t 2>&1 | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-soname.test b/llvm/test/tools/llvm-ifs/binary-read-soname.test --- a/llvm/test/tools/llvm-ifs/binary-read-soname.test +++ b/llvm/test/tools/llvm-ifs/binary-read-soname.test @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- %t | FileCheck %s +# RUN: llvm-ifs --input-format=ELF --output-ifs=- %t | FileCheck %s !ELF FileHeader: diff --git a/llvm/test/tools/llvm-ifs/binary-read-syms-gnu-hash.test b/llvm/test/tools/llvm-ifs/binary-read-syms-gnu-hash.test --- a/llvm/test/tools/llvm-ifs/binary-read-syms-gnu-hash.test +++ b/llvm/test/tools/llvm-ifs/binary-read-syms-gnu-hash.test @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- %p/Inputs/gnu_hash.so | FileCheck %s +# RUN: llvm-ifs --input-format=ELF --output-ifs=- %p/Inputs/gnu_hash.so | FileCheck %s # CHECK: --- !ifs-v1 # CHECK-NEXT: IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/binary-read-syms-sysv-hash.test b/llvm/test/tools/llvm-ifs/binary-read-syms-sysv-hash.test --- a/llvm/test/tools/llvm-ifs/binary-read-syms-sysv-hash.test +++ b/llvm/test/tools/llvm-ifs/binary-read-syms-sysv-hash.test @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- %p/Inputs/sysv_hash.so | FileCheck %s +# RUN: llvm-ifs --input-format=ELF --output-ifs=- %p/Inputs/sysv_hash.so | FileCheck %s # CHECK: --- !ifs-v1 # CHECK-NEXT: IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/conflict-header-triple.ifs b/llvm/test/tools/llvm-ifs/conflict-header-triple.ifs --- a/llvm/test/tools/llvm-ifs/conflict-header-triple.ifs +++ b/llvm/test/tools/llvm-ifs/conflict-header-triple.ifs @@ -1,4 +1,4 @@ -# RUN: not llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/object.ifs 2>&1 | \ +# RUN: not llvm-ifs --input-format=IFS --output-ifs - %s %S/object.ifs 2>&1 | \ # RUN: FileCheck %s --check-prefixes=CHECK-IFS # CHECK-IFS: error: Interface Stub: Target Mismatch. diff --git a/llvm/test/tools/llvm-ifs/conflict-header-version.ifs b/llvm/test/tools/llvm-ifs/conflict-header-version.ifs --- a/llvm/test/tools/llvm-ifs/conflict-header-version.ifs +++ b/llvm/test/tools/llvm-ifs/conflict-header-version.ifs @@ -1,7 +1,7 @@ -# RUN: not llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/object.ifs 2>&1 | \ +# RUN: not llvm-ifs --input-format=IFS --output-ifs - %s %S/object.ifs 2>&1 | \ # RUN: FileCheck %s --check-prefixes=CHECK-IFS -# RUN: not llvm-ifs --input-format=IFS --output-format=IFS -o - %s 2>&1 | \ +# RUN: not llvm-ifs --input-format=IFS --output-ifs - %s 2>&1 | \ # RUN: FileCheck %s --check-prefixes=CHECK-IFS2 # CHECK-IFS: error: Interface Stub: IfsVersion Mismatch. diff --git a/llvm/test/tools/llvm-ifs/conflict-size.ifs b/llvm/test/tools/llvm-ifs/conflict-size.ifs --- a/llvm/test/tools/llvm-ifs/conflict-size.ifs +++ b/llvm/test/tools/llvm-ifs/conflict-size.ifs @@ -1,4 +1,4 @@ -# RUN: not llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/object.ifs 2>&1 | \ +# RUN: not llvm-ifs --input-format=IFS --output-ifs - %s %S/object.ifs 2>&1 | \ # RUN: FileCheck %s --check-prefixes=CHECK-IFS # Here we are testing to see if two symbols with identical names will fail to diff --git a/llvm/test/tools/llvm-ifs/conflict-type.ifs b/llvm/test/tools/llvm-ifs/conflict-type.ifs --- a/llvm/test/tools/llvm-ifs/conflict-type.ifs +++ b/llvm/test/tools/llvm-ifs/conflict-type.ifs @@ -1,4 +1,4 @@ -# RUN: not llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/func.ifs 2>&1 | \ +# RUN: not llvm-ifs --input-format=IFS --output-ifs - %s %S/func.ifs 2>&1 | \ # RUN: FileCheck %s --check-prefixes=CHECK-IFS # Here we are testing to see if two symbols with identical names will fail to diff --git a/llvm/test/tools/llvm-ifs/conflict-weak.ifs b/llvm/test/tools/llvm-ifs/conflict-weak.ifs --- a/llvm/test/tools/llvm-ifs/conflict-weak.ifs +++ b/llvm/test/tools/llvm-ifs/conflict-weak.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/func.ifs 2>&1 | \ +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s %S/func.ifs 2>&1 | \ # RUN: FileCheck %s --check-prefixes=CHECK-IFS # CHECK-IFS: Symbols: diff --git a/llvm/test/tools/llvm-ifs/default-empty.ifs b/llvm/test/tools/llvm-ifs/default-empty.ifs --- a/llvm/test/tools/llvm-ifs/default-empty.ifs +++ b/llvm/test/tools/llvm-ifs/default-empty.ifs @@ -1,5 +1,5 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s | FileCheck --check-prefixes=CHECK-DEFAULT %s -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %S/weak.ifs %s | FileCheck --check-prefixes=CHECK-MERGE %s +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s | FileCheck --check-prefixes=CHECK-DEFAULT %s +# RUN: llvm-ifs --input-format=IFS --output-ifs - %S/weak.ifs %s | FileCheck --check-prefixes=CHECK-MERGE %s # CHECK-DEFAULT: --- !ifs-v1 # CHECK-DEFAULT-NEXT: IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/empty1.ifs b/llvm/test/tools/llvm-ifs/empty1.ifs --- a/llvm/test/tools/llvm-ifs/empty1.ifs +++ b/llvm/test/tools/llvm-ifs/empty1.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s | FileCheck %s +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s | FileCheck %s # CHECK: --- !ifs-v1 # CHECK-NEXT: IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/empty2.ifs b/llvm/test/tools/llvm-ifs/empty2.ifs --- a/llvm/test/tools/llvm-ifs/empty2.ifs +++ b/llvm/test/tools/llvm-ifs/empty2.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s | FileCheck %s +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s | FileCheck %s # CHECK: --- !ifs-v1 # CHECK-NEXT: IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/fail-file-open.test b/llvm/test/tools/llvm-ifs/fail-file-open.test --- a/llvm/test/tools/llvm-ifs/fail-file-open.test +++ b/llvm/test/tools/llvm-ifs/fail-file-open.test @@ -1,4 +1,4 @@ -# RUN: not llvm-ifs --output-format=IFS --output=%t.tbe %s.NotAFileInTestingDir 2>&1 | FileCheck %s +# RUN: not llvm-ifs --output-ifs=%t.tbe %s.NotAFileInTestingDir 2>&1 | FileCheck %s This file will not be read. An invalid file path is fed to llvm-ifs. diff --git a/llvm/test/tools/llvm-ifs/fail-file-write-windows.test b/llvm/test/tools/llvm-ifs/fail-file-write-windows.test --- a/llvm/test/tools/llvm-ifs/fail-file-write-windows.test +++ b/llvm/test/tools/llvm-ifs/fail-file-write-windows.test @@ -3,7 +3,7 @@ # REQUIRES: system-windows # RUN: touch %t.TestFile # RUN: chmod 400 %t.TestFile -# RUN: not llvm-ifs --output-format=ELF --output=%t.TestFile %s 2>&1 | FileCheck -DMSG=%errc_EACCES %s --check-prefix=ERR +# RUN: not llvm-ifs --output-elf=%t.TestFile %s 2>&1 | FileCheck -DMSG=%errc_EACCES %s --check-prefix=ERR # RUN: chmod 777 %t.TestFile # RUN: rm -rf %t.TestFile diff --git a/llvm/test/tools/llvm-ifs/fail-file-write.test b/llvm/test/tools/llvm-ifs/fail-file-write.test --- a/llvm/test/tools/llvm-ifs/fail-file-write.test +++ b/llvm/test/tools/llvm-ifs/fail-file-write.test @@ -5,7 +5,7 @@ # RUN: mkdir %t.TestDir # RUN: touch %t.TestDir/Output.TestFile # RUN: chmod 400 %t.TestDir -# RUN: not llvm-ifs --output-format=ELF --output=%t.TestDir/Output.TestFile %s 2>&1 | FileCheck -DMSG=%errc_EACCES %s --check-prefix=ERR +# RUN: not llvm-ifs --output-elf=%t.TestDir/Output.TestFile %s 2>&1 | FileCheck -DMSG=%errc_EACCES %s --check-prefix=ERR # RUN: chmod 777 %t.TestDir # RUN: rm -rf %t.TestDir diff --git a/llvm/test/tools/llvm-ifs/func.ifs b/llvm/test/tools/llvm-ifs/func.ifs --- a/llvm/test/tools/llvm-ifs/func.ifs +++ b/llvm/test/tools/llvm-ifs/func.ifs @@ -1,14 +1,14 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/object.ifs | \ +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s %S/object.ifs | \ # RUN: FileCheck %s --check-prefixes=CHECK-IFS -# RUN: llvm-ifs --input-format=IFS --output-format=ELF -o - %s %S/object.ifs | \ +# RUN: llvm-ifs --input-format=IFS --output-elf - %s %S/object.ifs | \ # RUN: llvm-readelf --all - | FileCheck %s --check-prefixes=CHECK-ELF -# RUN: llvm-ifs --input-format=IFS --output-format=IFS --strip-ifs-target -o %t.tbd %s %S/object.ifs -# RUN: llvm-ifs --input-format=IFS --output-format=TBD --target=x86_64-apple-darwin -o - %t.tbd | \ +# RUN: llvm-ifs --input-format=IFS --strip-ifs-target --output-ifs %t.tbd %s %S/object.ifs +# RUN: llvm-ifs --input-format=IFS --target=x86_64-apple-darwin --output-tbd - %t.tbd | \ # RUN: FileCheck %s --check-prefixes=CHECK-DARWIN-TBD3 -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s %s | \ +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s %s | \ # RUN: FileCheck %s --check-prefixes=CHECK-MERGE-IFS # CHECK-IFS: --- !ifs-v1 diff --git a/llvm/test/tools/llvm-ifs/ifs-emits-current-version.test b/llvm/test/tools/llvm-ifs/ifs-emits-current-version.test --- a/llvm/test/tools/llvm-ifs/ifs-emits-current-version.test +++ b/llvm/test/tools/llvm-ifs/ifs-emits-current-version.test @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --output-format=IFS --output=- %s | FileCheck %s +# RUN: llvm-ifs --output-ifs=- %s | FileCheck %s --- !ifs-v1 IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/ifs-read-basic.test b/llvm/test/tools/llvm-ifs/ifs-read-basic.test --- a/llvm/test/tools/llvm-ifs/ifs-read-basic.test +++ b/llvm/test/tools/llvm-ifs/ifs-read-basic.test @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --output-format=IFS --output=- %s | FileCheck %s +# RUN: llvm-ifs --output-ifs=- %s | FileCheck %s --- !ifs-v1 SoName: somelib.so diff --git a/llvm/test/tools/llvm-ifs/ios-tbd.ifs b/llvm/test/tools/llvm-ifs/ios-tbd.ifs --- a/llvm/test/tools/llvm-ifs/ios-tbd.ifs +++ b/llvm/test/tools/llvm-ifs/ios-tbd.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=TBD -o - %s | FileCheck %s +# RUN: llvm-ifs --input-format=IFS --output-tbd - %s | FileCheck %s # CHECK: --- !tapi-tbd-v3 # CHECK-NEXT: archs: [ arm64 ] diff --git a/llvm/test/tools/llvm-ifs/macos-tbd.ifs b/llvm/test/tools/llvm-ifs/macos-tbd.ifs --- a/llvm/test/tools/llvm-ifs/macos-tbd.ifs +++ b/llvm/test/tools/llvm-ifs/macos-tbd.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=TBD -o - %s | FileCheck %s +# RUN: llvm-ifs --input-format=IFS --output-tbd - %s | FileCheck %s # CHECK: --- !tapi-tbd-v3 # CHECK-NEXT: archs: [ arm64 ] diff --git a/llvm/test/tools/llvm-ifs/object-function-size-weak-combo.ifs b/llvm/test/tools/llvm-ifs/object-function-size-weak-combo.ifs --- a/llvm/test/tools/llvm-ifs/object-function-size-weak-combo.ifs +++ b/llvm/test/tools/llvm-ifs/object-function-size-weak-combo.ifs @@ -1,7 +1,7 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/func.ifs %S/object.ifs %S/weak.ifs | \ +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s %S/func.ifs %S/object.ifs %S/weak.ifs | \ # RUN: FileCheck %s --check-prefixes=CHECK-IFS -# RUN: llvm-ifs --input-format=IFS --output-format=ELF -o - %s %S/func.ifs %S/object.ifs %S/weak.ifs | \ +# RUN: llvm-ifs --input-format=IFS --output-elf - %s %S/func.ifs %S/object.ifs %S/weak.ifs | \ # RUN: llvm-readelf --all - | FileCheck %s --check-prefixes=CHECK-ELF # CHECK-IFS: --- !ifs-v1 diff --git a/llvm/test/tools/llvm-ifs/object.ifs b/llvm/test/tools/llvm-ifs/object.ifs --- a/llvm/test/tools/llvm-ifs/object.ifs +++ b/llvm/test/tools/llvm-ifs/object.ifs @@ -1,7 +1,7 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s | \ +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s | \ # RUN: FileCheck %s --check-prefixes=CHECK-IFS -# RUN: llvm-ifs --input-format=IFS --output-format=ELF -o - %s | \ +# RUN: llvm-ifs --input-format=IFS --output-elf - %s | \ # RUN: llvm-readelf --all - | FileCheck %s --check-prefixes=CHECK-ELF # CHECK-IFS: --- !ifs-v1 diff --git a/llvm/test/tools/llvm-ifs/output-format-deprecation.test b/llvm/test/tools/llvm-ifs/output-format-deprecation.test new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-ifs/output-format-deprecation.test @@ -0,0 +1,14 @@ +## Test running llvm-ifs with --output-format option to generate deprecation warnings + +# RUN: llvm-ifs --output-format=IFS --output=%t %s 2>&1 | FileCheck %s --check-prefix=WARNING +# RUN: not llvm-ifs --output-format=IFS --output=%t --output-ifs=%t %s 2>&1 | FileCheck %s --check-prefix=ERROR + +--- !ifs-v1 +SoName: somelib.so +IfsVersion: 3.0 +Target: { ObjectFormat: ELF, Arch: x86_64, Endianness: little, BitWidth: 64 } +Symbols: [] +... + +# WARNING: warning: --output-format option is deprecated, please use --output-{FILE_FORMAT} options instead +# ERROR: error: '--output-format' cannot be used with '--output-{FILE_FORMAT}' options at the same time \ No newline at end of file diff --git a/llvm/test/tools/llvm-ifs/output-target-error.test b/llvm/test/tools/llvm-ifs/output-target-error.test --- a/llvm/test/tools/llvm-ifs/output-target-error.test +++ b/llvm/test/tools/llvm-ifs/output-target-error.test @@ -10,6 +10,6 @@ Symbols: [] ... -# MISSING: {{llvm-ifs(\.exe)?}}: for the --output-format option: must be specified at least once! +# MISSING: error: at least one output should be specified. # INVALID: {{llvm-ifs(\.exe)?}}: for the --output-format option: Cannot find option named 'nope'! diff --git a/llvm/test/tools/llvm-ifs/preserve-dates-ifs.test b/llvm/test/tools/llvm-ifs/preserve-dates-ifs.test --- a/llvm/test/tools/llvm-ifs/preserve-dates-ifs.test +++ b/llvm/test/tools/llvm-ifs/preserve-dates-ifs.test @@ -1,8 +1,8 @@ ## Test writing unchanged content to TBE file with --write-if-changed flag. -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=%t %p/Inputs/gnu_hash.so +# RUN: llvm-ifs --input-format=ELF --output-ifs=%t %p/Inputs/gnu_hash.so # RUN: env TZ=GMT touch -m -t 197001010000 %t -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=%t --write-if-changed %p/Inputs/gnu_hash.so +# RUN: llvm-ifs --input-format=ELF --output-ifs=%t --write-if-changed %p/Inputs/gnu_hash.so # RUN: env TZ=GMT ls -l %t | FileCheck %s # CHECK: {{[[:space:]]1970}} diff --git a/llvm/test/tools/llvm-ifs/preserve-dates-stub.test b/llvm/test/tools/llvm-ifs/preserve-dates-stub.test --- a/llvm/test/tools/llvm-ifs/preserve-dates-stub.test +++ b/llvm/test/tools/llvm-ifs/preserve-dates-stub.test @@ -1,8 +1,8 @@ ## Test writing unchanged content to ELF Stub file with --write-if-changed flag. -# RUN: llvm-ifs --output-format=ELF --output=%t %s +# RUN: llvm-ifs --output-elf=%t %s # RUN: env TZ=GMT touch -m -t 197001010000 %t -# RUN: llvm-ifs --output-format=ELF --output=%t --write-if-changed %s +# RUN: llvm-ifs --output-elf=%t --write-if-changed %s # RUN: env TZ=GMT ls -l %t | FileCheck %s --- !ifs-v1 diff --git a/llvm/test/tools/llvm-ifs/read-elf-dynsym.test b/llvm/test/tools/llvm-ifs/read-elf-dynsym.test --- a/llvm/test/tools/llvm-ifs/read-elf-dynsym.test +++ b/llvm/test/tools/llvm-ifs/read-elf-dynsym.test @@ -5,19 +5,19 @@ ## Test if llvm-ifs reads DT_SYMTAB size through section headers by puting the wrong terminator in DT_GNU_HASH. # RUN: yaml2obj %s -o %tfull -DGNUHASHVALUE="[0x9]" -DTAG1="DT_GNU_HASH" -DVAL1="0xC00" -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- %tfull | FileCheck %s +# RUN: llvm-ifs --input-format=ELF --output-ifs=- %tfull | FileCheck %s ## Test if llvm-ifs fails to read DT_SYMTAB size through section headers when the value of sh_entsize is invalid. # RUN: yaml2obj %s -o %tfull -DGNUHASHVALUE="[0x9]" -DTAG1="DT_GNU_HASH" -DVAL1="0xC00" -DENTSIZE="0x19" -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=- %tfull 2>&1 | FileCheck %s --check-prefix=BADENTSIZE +# RUN: not llvm-ifs --input-format=ELF --output-ifs=- %tfull 2>&1 | FileCheck %s --check-prefix=BADENTSIZE ## Test if llvm-ifs reads DT_SYMTAB size through DT_GNU_HASH. # RUN: yaml2obj %s -o %tw.gnu.hash -DGNUHASHVALUE="[0x8, 0x9]" -DTAG1="DT_GNU_HASH" -DVAL1="0xC00" -DNOHEADER="true" -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --output=- %tw.gnu.hash | FileCheck %s +# RUN: llvm-ifs --input-format=ELF --output-ifs=- %tw.gnu.hash | FileCheck %s ## Test if llvm-ifs fails to read DT_SYMTAB size through DT_GNU_HASH when there is no terminator. # RUN: yaml2obj %s -o %tw.gnu.hash -DGNUHASHVALUE="[0x8, 0xA]" -DTAG1="DT_GNU_HASH" -DVAL1="0xC00" -DNOHEADER="true" -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=- %tw.gnu.hash 2>&1 | FileCheck %s --check-prefix=NOTERMINATOR +# RUN: not llvm-ifs --input-format=ELF --output-ifs=- %tw.gnu.hash 2>&1 | FileCheck %s --check-prefix=NOTERMINATOR # CHECK: --- !ifs-v1 # CHECK-NEXT: IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/read-ifs-as-elf.test b/llvm/test/tools/llvm-ifs/read-ifs-as-elf.test --- a/llvm/test/tools/llvm-ifs/read-ifs-as-elf.test +++ b/llvm/test/tools/llvm-ifs/read-ifs-as-elf.test @@ -1,4 +1,4 @@ -# RUN: not llvm-ifs --input-format=ELF --output-format=IFS --output=%t %s 2>&1 | FileCheck %s +# RUN: not llvm-ifs --input-format=ELF --output-ifs=%t %s 2>&1 | FileCheck %s --- !ifs-v1 SoName: somelib.so diff --git a/llvm/test/tools/llvm-ifs/read-ifs-as-ifs.test b/llvm/test/tools/llvm-ifs/read-ifs-as-ifs.test --- a/llvm/test/tools/llvm-ifs/read-ifs-as-ifs.test +++ b/llvm/test/tools/llvm-ifs/read-ifs-as-ifs.test @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS --output=- %s | FileCheck %s +# RUN: llvm-ifs --input-format=IFS --output-ifs=- %s | FileCheck %s --- !ifs-v1 IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/read-ifs-with-bad-bitwidth.test b/llvm/test/tools/llvm-ifs/read-ifs-with-bad-bitwidth.test --- a/llvm/test/tools/llvm-ifs/read-ifs-with-bad-bitwidth.test +++ b/llvm/test/tools/llvm-ifs/read-ifs-with-bad-bitwidth.test @@ -1,6 +1,6 @@ ## Test reading TBE file with bad bit width. -# RUN: not llvm-ifs --output-format=IFS --output=- %s 2>&1 | FileCheck %s +# RUN: not llvm-ifs --output-ifs=- %s 2>&1 | FileCheck %s --- !ifs-v1 SoName: somelib.so diff --git a/llvm/test/tools/llvm-ifs/read-ifs-with-bad-endianness.test b/llvm/test/tools/llvm-ifs/read-ifs-with-bad-endianness.test --- a/llvm/test/tools/llvm-ifs/read-ifs-with-bad-endianness.test +++ b/llvm/test/tools/llvm-ifs/read-ifs-with-bad-endianness.test @@ -1,6 +1,6 @@ ## Test reading TBE file with bad endianness. -# RUN: not llvm-ifs --output-format=IFS --output=- %s 2>&1 | FileCheck %s +# RUN: not llvm-ifs --output-ifs=- %s 2>&1 | FileCheck %s --- !ifs-v1 SoName: somelib.so diff --git a/llvm/test/tools/llvm-ifs/read-unsupported-file.test b/llvm/test/tools/llvm-ifs/read-unsupported-file.test --- a/llvm/test/tools/llvm-ifs/read-unsupported-file.test +++ b/llvm/test/tools/llvm-ifs/read-unsupported-file.test @@ -1,4 +1,4 @@ -# RUN: not llvm-ifs --output-format=IFS --output=- %s 2>&1| FileCheck %s +# RUN: not llvm-ifs --output-ifs=- %s 2>&1| FileCheck %s This is just some text that cannot be read by llvm-ifs. diff --git a/llvm/test/tools/llvm-ifs/strip-target.test b/llvm/test/tools/llvm-ifs/strip-target.test --- a/llvm/test/tools/llvm-ifs/strip-target.test +++ b/llvm/test/tools/llvm-ifs/strip-target.test @@ -1,10 +1,10 @@ ## Test writing tbe with stripped target information. -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --strip-ifs-target --output=- %p/Inputs/sysv_hash.so | FileCheck %s --check-prefix=NOTARGET -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --strip-ifs-arch --strip-ifs-endianness --strip-ifs-bitwidth --output=- %p/Inputs/sysv_hash.so | FileCheck %s --check-prefix=NOTARGET -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --strip-ifs-arch --output=- %p/Inputs/sysv_hash.so | FileCheck %s -DELFTARGET="ObjectFormat: ELF, Endianness: little, BitWidth: 64" --check-prefix=CHECK -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --strip-ifs-endianness --output=- %p/Inputs/sysv_hash.so | FileCheck %s -DELFTARGET="ObjectFormat: ELF, Arch: x86_64, BitWidth: 64" --check-prefix=CHECK -# RUN: llvm-ifs --input-format=ELF --output-format=IFS --strip-ifs-bitwidth --output=- %p/Inputs/sysv_hash.so | FileCheck %s -DELFTARGET="ObjectFormat: ELF, Arch: x86_64, Endianness: little" --check-prefix=CHECK +# RUN: llvm-ifs --input-format=ELF --strip-ifs-target --output-ifs=- %p/Inputs/sysv_hash.so | FileCheck %s --check-prefix=NOTARGET +# RUN: llvm-ifs --input-format=ELF --strip-ifs-arch --strip-ifs-endianness --strip-ifs-bitwidth --output-ifs=- %p/Inputs/sysv_hash.so | FileCheck %s --check-prefix=NOTARGET +# RUN: llvm-ifs --input-format=ELF --strip-ifs-arch --output-ifs=- %p/Inputs/sysv_hash.so | FileCheck %s -DELFTARGET="ObjectFormat: ELF, Endianness: little, BitWidth: 64" --check-prefix=CHECK +# RUN: llvm-ifs --input-format=ELF --strip-ifs-endianness --output-ifs=- %p/Inputs/sysv_hash.so | FileCheck %s -DELFTARGET="ObjectFormat: ELF, Arch: x86_64, BitWidth: 64" --check-prefix=CHECK +# RUN: llvm-ifs --input-format=ELF --strip-ifs-bitwidth --output-ifs=- %p/Inputs/sysv_hash.so | FileCheck %s -DELFTARGET="ObjectFormat: ELF, Arch: x86_64, Endianness: little" --check-prefix=CHECK # CHECK: --- !ifs-v1 diff --git a/llvm/test/tools/llvm-ifs/strip-undefined-symbols.test b/llvm/test/tools/llvm-ifs/strip-undefined-symbols.test --- a/llvm/test/tools/llvm-ifs/strip-undefined-symbols.test +++ b/llvm/test/tools/llvm-ifs/strip-undefined-symbols.test @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=ELF --strip-undefined --output-format=IFS --output=- %p/Inputs/gnu_hash.so | FileCheck %s +# RUN: llvm-ifs --input-format=ELF --strip-undefined --output-ifs=- %p/Inputs/gnu_hash.so | FileCheck %s # CHECK: --- !ifs-v1 # CHECK-NEXT: IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/strong.ifs b/llvm/test/tools/llvm-ifs/strong.ifs --- a/llvm/test/tools/llvm-ifs/strong.ifs +++ b/llvm/test/tools/llvm-ifs/strong.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/strong.ifs | FileCheck %s --check-prefixes=CHECK-IFS +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s %S/strong.ifs | FileCheck %s --check-prefixes=CHECK-IFS # CHECK-IFS: --- !ifs-v1 # CHECK-IFS-NEXT: IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/tvos-tbd.ifs b/llvm/test/tools/llvm-ifs/tvos-tbd.ifs --- a/llvm/test/tools/llvm-ifs/tvos-tbd.ifs +++ b/llvm/test/tools/llvm-ifs/tvos-tbd.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=TBD -o - %s | FileCheck %s +# RUN: llvm-ifs --input-format=IFS --output-tbd - %s | FileCheck %s # CHECK: --- !tapi-tbd-v3 # CHECK-NEXT: archs: [ arm64 ] diff --git a/llvm/test/tools/llvm-ifs/version-ok.ifs b/llvm/test/tools/llvm-ifs/version-ok.ifs --- a/llvm/test/tools/llvm-ifs/version-ok.ifs +++ b/llvm/test/tools/llvm-ifs/version-ok.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/object.ifs +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s %S/object.ifs --- !ifs-v1 IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/watchos-tbd.ifs b/llvm/test/tools/llvm-ifs/watchos-tbd.ifs --- a/llvm/test/tools/llvm-ifs/watchos-tbd.ifs +++ b/llvm/test/tools/llvm-ifs/watchos-tbd.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=TBD -o - %s | FileCheck %s +# RUN: llvm-ifs --input-format=IFS --output-tbd - %s | FileCheck %s # CHECK: --- !tapi-tbd-v3 # CHECK-NEXT: archs: [ arm64 ] diff --git a/llvm/test/tools/llvm-ifs/weak-mismatch.ifs b/llvm/test/tools/llvm-ifs/weak-mismatch.ifs --- a/llvm/test/tools/llvm-ifs/weak-mismatch.ifs +++ b/llvm/test/tools/llvm-ifs/weak-mismatch.ifs @@ -1,5 +1,5 @@ -# RUN: not llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/Inputs/strong-mismatch-size.ifs 2>&1 | FileCheck %s --check-prefixes=CHECK-SIZE -# RUN: not llvm-ifs --input-format=IFS --output-format=IFS -o - %s %S/Inputs/strong-mismatch-type.ifs 2>&1 | FileCheck %s --check-prefixes=CHECK-TYPE +# RUN: not llvm-ifs --input-format=IFS --output-ifs - %s %S/Inputs/strong-mismatch-size.ifs 2>&1 | FileCheck %s --check-prefixes=CHECK-SIZE +# RUN: not llvm-ifs --input-format=IFS --output-ifs - %s %S/Inputs/strong-mismatch-type.ifs 2>&1 | FileCheck %s --check-prefixes=CHECK-TYPE # CHECK-SIZE: error: Interface Stub: Size Mismatch for foobar. # CHECK-SIZE-NEXT: Filename: diff --git a/llvm/test/tools/llvm-ifs/weak.ifs b/llvm/test/tools/llvm-ifs/weak.ifs --- a/llvm/test/tools/llvm-ifs/weak.ifs +++ b/llvm/test/tools/llvm-ifs/weak.ifs @@ -1,4 +1,4 @@ -# RUN: llvm-ifs --input-format=IFS --output-format=IFS -o - %s | FileCheck %s --check-prefixes=CHECK-IFS +# RUN: llvm-ifs --input-format=IFS --output-ifs - %s | FileCheck %s --check-prefixes=CHECK-IFS # CHECK-IFS: --- !ifs-v1 # CHECK-IFS-NEXT: IfsVersion: 3.0 diff --git a/llvm/test/tools/llvm-ifs/write-stub-no-nonlocal-symbol.test b/llvm/test/tools/llvm-ifs/write-stub-no-nonlocal-symbol.test --- a/llvm/test/tools/llvm-ifs/write-stub-no-nonlocal-symbol.test +++ b/llvm/test/tools/llvm-ifs/write-stub-no-nonlocal-symbol.test @@ -1,6 +1,6 @@ ## Test writing stub elf when symbol table contains no non-local symbol. -# RUN: llvm-ifs --output-format=ELF --output=%t %s +# RUN: llvm-ifs --output-elf=%t %s # RUN: llvm-readobj -S %t | FileCheck %s -DCLASS="64-bit (0x2)" -DDE="LittleEndian (0x1)" -DHS=64 -DPHES=56 -DSHES=64 -DDYNSYMAL=8 -DDYNSYMES=24 -DDYNAMICAL=8 -DDYNAMICES=16 -DDYNTABZ=000000000 --- !ifs-v1 diff --git a/llvm/test/tools/llvm-ifs/write-stub.test b/llvm/test/tools/llvm-ifs/write-stub.test --- a/llvm/test/tools/llvm-ifs/write-stub.test +++ b/llvm/test/tools/llvm-ifs/write-stub.test @@ -1,35 +1,40 @@ ## Test writing stub elf with minimal sections. -# RUN: llvm-ifs --output-format=ELF --output=%t.elf32l --arch=x86_64 --bitwidth=32 --endianness=little %s +# RUN: llvm-ifs --output-elf=%t.elf32l --arch=x86_64 --bitwidth=32 --endianness=little %s # RUN: llvm-readobj -h -S --string-dump .dynstr --string-dump .shstrtab --dyn-symbols --dynamic-table %t.elf32l | FileCheck %s -DCLASS="32-bit (0x1)" -DDE="LittleEndian (0x1)" -DHS=52 -DPHES=32 -DSHES=40 -DDYNSYMAL=4 -DDYNSYMES=16 -DDYNAMICAL=4 -DDYNAMICES=8 -DDYNTABZ=0 -# RUN: llvm-ifs --output-format=ELF --output=%t.elf32b --arch=x86_64 --bitwidth=32 --endianness=big %s +# RUN: llvm-ifs --output-elf=%t.elf32b --arch=x86_64 --bitwidth=32 --endianness=big %s # RUN: llvm-readobj -h -S --string-dump .dynstr --string-dump .shstrtab --dyn-symbols --dynamic-table %t.elf32b | FileCheck %s -DCLASS="32-bit (0x1)" -DDE="BigEndian (0x2)" -DHS=52 -DPHES=32 -DSHES=40 -DDYNSYMAL=4 -DDYNSYMES=16 -DDYNAMICAL=4 -DDYNAMICES=8 -DDYNTABZ=0 -# RUN: llvm-ifs --output-format=ELF --output=%t.elf64l --arch=x86_64 --bitwidth=64 --endianness=little %s +# RUN: llvm-ifs --output-elf=%t.elf64l --arch=x86_64 --bitwidth=64 --endianness=little %s # RUN: llvm-readobj -h -S --string-dump .dynstr --string-dump .shstrtab --dyn-symbols --dynamic-table %t.elf64l | FileCheck %s -DCLASS="64-bit (0x2)" -DDE="LittleEndian (0x1)" -DHS=64 -DPHES=56 -DSHES=64 -DDYNSYMAL=8 -DDYNSYMES=24 -DDYNAMICAL=8 -DDYNAMICES=16 -DDYNTABZ=000000000 -# RUN: llvm-ifs --output-format=ELF --output=%t.elf64l --target=x86_64-linux-gnu %s +# RUN: llvm-ifs --output-elf=%t.elf64l --target=x86_64-linux-gnu %s # RUN: llvm-readobj -h -S --string-dump .dynstr --string-dump .shstrtab --dyn-symbols --dynamic-table %t.elf64l | FileCheck %s -DCLASS="64-bit (0x2)" -DDE="LittleEndian (0x1)" -DHS=64 -DPHES=56 -DSHES=64 -DDYNSYMAL=8 -DDYNSYMES=24 -DDYNAMICAL=8 -DDYNAMICES=16 -DDYNTABZ=000000000 -# RUN: llvm-ifs --output-format=ELF --output=%t.elf64b --arch=x86_64 --bitwidth=64 --endianness=big %s +# RUN: llvm-ifs --output-elf=%t.elf64b --arch=x86_64 --bitwidth=64 --endianness=big %s # RUN: llvm-readobj -h -S --string-dump .dynstr --string-dump .shstrtab --dyn-symbols --dynamic-table %t.elf64b | FileCheck %s -DCLASS="64-bit (0x2)" -DDE="BigEndian (0x2)" -DHS=64 -DPHES=56 -DSHES=64 -DDYNSYMAL=8 -DDYNSYMES=24 -DDYNAMICAL=8 -DDYNAMICES=16 -DDYNTABZ=000000000 -# RUN: not llvm-ifs --output-format=ELF --output=%t --arch=x86_64 --bitwidth=64 --endianness=big --target=x86_64-linux-gnu %s 2>&1 | FileCheck %s --check-prefix=TRIPLEERR +# RUN: not llvm-ifs --output-elf=%t --arch=x86_64 --bitwidth=64 --endianness=big --target=x86_64-linux-gnu %s 2>&1 | FileCheck %s --check-prefix=TRIPLEERR -# RUN: not llvm-ifs --output-format=ELF --output=%t --bitwidth=64 --endianness=big %s 2>&1 | FileCheck %s -DMSG="Arch" --check-prefix=TARGETERR +# RUN: not llvm-ifs --output-elf=%t --bitwidth=64 --endianness=big %s 2>&1 | FileCheck %s -DMSG="Arch" --check-prefix=TARGETERR -# RUN: not llvm-ifs --output-format=ELF --output=%t --arch=x86_64 --endianness=big %s 2>&1 | FileCheck %s -DMSG="BitWidth" --check-prefix=TARGETERR +# RUN: not llvm-ifs --output-elf=%t --arch=x86_64 --endianness=big %s 2>&1 | FileCheck %s -DMSG="BitWidth" --check-prefix=TARGETERR -# RUN: not llvm-ifs --output-format=ELF --output=%t --arch=x86_64 --bitwidth=64 %s 2>&1 | FileCheck %s -DMSG="Endianness" --check-prefix=TARGETERR +# RUN: not llvm-ifs --output-elf=%t --arch=x86_64 --bitwidth=64 %s 2>&1 | FileCheck %s -DMSG="Endianness" --check-prefix=TARGETERR -# RUN: llvm-ifs --output-format=IFS --output=%t.target --target=x86_64-linux-gnu %s -# RUN: not llvm-ifs --output-format=ELF --output=%t --target=aarch64-linux-gnu %t.target 2>&1 | FileCheck %s -DMSG="Triple" --check-prefix=CONFLICTERR +# RUN: llvm-ifs --output-ifs=%t.target --target=x86_64-linux-gnu %s +# RUN: not llvm-ifs --output-elf=%t --target=aarch64-linux-gnu %t.target 2>&1 | FileCheck %s -DMSG="Triple" --check-prefix=CONFLICTERR -# RUN: llvm-ifs --output-format=IFS --output=%t.target --arch=x86_64 --endianness=little --bitwidth=64 %s -# RUN: not llvm-ifs --output-format=ELF --output=%t --arch=AArch64 %t.target 2>&1 | FileCheck %s -DMSG=Arch --check-prefix=CONFLICTERR -# RUN: not llvm-ifs --output-format=ELF --output=%t --endianness=big %t.target 2>&1 | FileCheck %s -DMSG=Endianness --check-prefix=CONFLICTERR -# RUN: not llvm-ifs --output-format=ELF --output=%t --bitwidth=32 %t.target 2>&1 | FileCheck %s -DMSG=BitWidth --check-prefix=CONFLICTERR +# RUN: llvm-ifs --output-ifs=%t.target --arch=x86_64 --endianness=little --bitwidth=64 %s +# RUN: not llvm-ifs --output-elf=%t --arch=AArch64 %t.target 2>&1 | FileCheck %s -DMSG=Arch --check-prefix=CONFLICTERR +# RUN: not llvm-ifs --output-elf=%t --endianness=big %t.target 2>&1 | FileCheck %s -DMSG=Endianness --check-prefix=CONFLICTERR +# RUN: not llvm-ifs --output-elf=%t --bitwidth=32 %t.target 2>&1 | FileCheck %s -DMSG=BitWidth --check-prefix=CONFLICTERR + +# RUN: llvm-ifs --output-ifs=%t.ifs --output-elf=%t.elf --target=x86_64-linux-gnu %s +# RUN: llvm-ifs --output-elf=%t.elf2 --target=x86_64-linux-gnu %t.ifs +# RUN: llvm-readobj -h -S --string-dump .dynstr --string-dump .shstrtab --dyn-symbols --dynamic-table %t.elf | FileCheck %s -DCLASS="64-bit (0x2)" -DDE="LittleEndian (0x1)" -DHS=64 -DPHES=56 -DSHES=64 -DDYNSYMAL=8 -DDYNSYMES=24 -DDYNAMICAL=8 -DDYNAMICES=16 -DDYNTABZ=000000000 +# RUN: llvm-readobj -h -S --string-dump .dynstr --string-dump .shstrtab --dyn-symbols --dynamic-table %t.elf2 | FileCheck %s -DCLASS="64-bit (0x2)" -DDE="LittleEndian (0x1)" -DHS=64 -DPHES=56 -DSHES=64 -DDYNSYMAL=8 -DDYNSYMES=24 -DDYNAMICAL=8 -DDYNAMICES=16 -DDYNTABZ=000000000 --- !ifs-v1 IfsVersion: 3.0 diff --git a/llvm/tools/llvm-ifs/llvm-ifs.cpp b/llvm/tools/llvm-ifs/llvm-ifs.cpp --- a/llvm/tools/llvm-ifs/llvm-ifs.cpp +++ b/llvm/tools/llvm-ifs/llvm-ifs.cpp @@ -57,11 +57,11 @@ clEnumValN(FileFormat::ELF, "ELF", "ELF object file")), cl::cat(IfsCategory)); cl::opt OutputFormat( - "output-format", cl::desc("Specify the output file format"), + "output-format", cl::desc("Specify the output file format **DEPRECATED**"), cl::values(clEnumValN(FileFormat::IFS, "IFS", "Text based ELF stub file"), clEnumValN(FileFormat::ELF, "ELF", "ELF stub file"), clEnumValN(FileFormat::TBD, "TBD", "Apple TBD text stub file")), - cl::Required, cl::cat(IfsCategory)); + cl::cat(IfsCategory)); cl::opt OptArch("arch", cl::desc("Specify the architecture, e.g. x86_64"), cl::cat(IfsCategory)); @@ -108,10 +108,21 @@ SoName("soname", cl::desc("Manually set the DT_SONAME entry of any emitted files"), cl::value_desc("name"), cl::cat(IfsCategory)); -cl::opt OutputFilePath("output", cl::desc("Output file"), +cl::opt OutputFilePath("output", + cl::desc("Output file **DEPRECATED**"), cl::cat(IfsCategory)); cl::alias OutputFilePathA("o", cl::desc("Alias for --output"), cl::aliasopt(OutputFilePath), cl::cat(IfsCategory)); +cl::opt OutputELFFilePath("output-elf", + cl::desc("Output path for ELF file"), + cl::cat(IfsCategory)); +cl::opt OutputIFSFilePath("output-ifs", + cl::desc("Output path for IFS file"), + cl::cat(IfsCategory)); +cl::opt OutputTBDFilePath("output-tbd", + cl::desc("Output path for TBD file"), + cl::cat(IfsCategory)); + cl::opt WriteIfChanged( "write-if-changed", cl::desc("Write the output file only if it is new or has changed."), @@ -320,8 +331,6 @@ WithColor::error() << "Interface Stub: Target Mismatch." << "\nFilenames: " << PreviousInputFilePath << " " << InputFilePath; - // << "\nTriple Values: " << Stub.Triple << " " - // << TargetStub->Triple << "\n"; return -1; } if (Stub.SoName != TargetStub->SoName) { @@ -408,63 +417,136 @@ if (OverrideError) fatalError(std::move(OverrideError)); - switch (OutputFormat.getValue()) { - case FileFormat::TBD: { - std::error_code SysErr; - raw_fd_ostream Out(OutputFilePath, SysErr); - if (SysErr) { - WithColor::error() << "Couldn't open " << OutputFilePath - << " for writing.\n"; - return -1; - } - if (!Stub.Target.Triple) { - WithColor::error() - << "Triple should be defined when output format is TBD"; + if (OutputELFFilePath.getNumOccurrences() == 0 && + OutputIFSFilePath.getNumOccurrences() == 0 && + OutputTBDFilePath.getNumOccurrences() == 0) { + if (OutputFormat.getNumOccurrences() == 0) { + WithColor::error() << "at least one output should be specified."; return -1; } - return writeTbdStub(llvm::Triple(Stub.Target.Triple.getValue()), - Stub.Symbols, "TBD", Out); + } else if (OutputFormat.getNumOccurrences() == 1) { + WithColor::error() << "'--output-format' cannot be used with " + "'--output-{FILE_FORMAT}' options at the same time"; + return -1; } - case FileFormat::IFS: { - Stub.IfsVersion = IfsVersionCurrent; - if (InputFormat.getValue() == FileFormat::ELF && - OptTargetTripleHint.getNumOccurrences() == 1) { - std::error_code HintEC(1, std::generic_category()); - IFSTarget HintTarget = parseTriple(OptTargetTripleHint); - if (Stub.Target.Arch.getValue() != HintTarget.Arch.getValue()) - fatalError(make_error( - "Triple hint does not match the actual architecture", HintEC)); - if (Stub.Target.Endianness.getValue() != - HintTarget.Endianness.getValue()) - fatalError(make_error( - "Triple hint does not match the actual endianness", HintEC)); - if (Stub.Target.BitWidth.getValue() != HintTarget.BitWidth.getValue()) - fatalError(make_error( - "Triple hint does not match the actual bit width", HintEC)); - - stripIFSTarget(Stub, true, false, false, false); - Stub.Target.Triple = OptTargetTripleHint.getValue(); - } else { - stripIFSTarget(Stub, StripIFSTarget, StripIFSArch, - StripIFSEndiannessWidth, StripIFSBitWidth); + if (OutputFormat.getNumOccurrences() == 1) { + // TODO: Remove OutputFormat flag in the next revision. + WithColor::warning() << "--output-format option is deprecated, please use " + "--output-{FILE_FORMAT} options instead\n"; + switch (OutputFormat.getValue()) { + case FileFormat::TBD: { + std::error_code SysErr; + raw_fd_ostream Out(OutputFilePath, SysErr); + if (SysErr) { + WithColor::error() << "Couldn't open " << OutputFilePath + << " for writing.\n"; + return -1; + } + if (!Stub.Target.Triple) { + WithColor::error() + << "Triple should be defined when output format is TBD"; + return -1; + } + return writeTbdStub(llvm::Triple(Stub.Target.Triple.getValue()), + Stub.Symbols, "TBD", Out); + } + case FileFormat::IFS: { + Stub.IfsVersion = IfsVersionCurrent; + if (InputFormat.getValue() == FileFormat::ELF && + OptTargetTripleHint.getNumOccurrences() == 1) { + std::error_code HintEC(1, std::generic_category()); + IFSTarget HintTarget = parseTriple(OptTargetTripleHint); + if (Stub.Target.Arch.getValue() != HintTarget.Arch.getValue()) + fatalError(make_error( + "Triple hint does not match the actual architecture", HintEC)); + if (Stub.Target.Endianness.getValue() != + HintTarget.Endianness.getValue()) + fatalError(make_error( + "Triple hint does not match the actual endianness", HintEC)); + if (Stub.Target.BitWidth.getValue() != HintTarget.BitWidth.getValue()) + fatalError(make_error( + "Triple hint does not match the actual bit width", HintEC)); + + stripIFSTarget(Stub, true, false, false, false); + Stub.Target.Triple = OptTargetTripleHint.getValue(); + } else { + stripIFSTarget(Stub, StripIFSTarget, StripIFSArch, + StripIFSEndiannessWidth, StripIFSBitWidth); + } + if (StripUndefined) + stripIFSUndefinedSymbols(Stub); + Error IFSWriteError = writeIFS(OutputFilePath.getValue(), Stub); + if (IFSWriteError) + fatalError(std::move(IFSWriteError)); + break; + } + case FileFormat::ELF: { + Error TargetError = validateIFSTarget(Stub, true); + if (TargetError) + fatalError(std::move(TargetError)); + Error BinaryWriteError = + writeBinaryStub(OutputFilePath, Stub, WriteIfChanged); + if (BinaryWriteError) + fatalError(std::move(BinaryWriteError)); + break; + } + } + } else { + // Check if output path for individual format. + if (OutputELFFilePath.getNumOccurrences() == 1) { + Error TargetError = validateIFSTarget(Stub, true); + if (TargetError) + fatalError(std::move(TargetError)); + Error BinaryWriteError = + writeBinaryStub(OutputELFFilePath, Stub, WriteIfChanged); + if (BinaryWriteError) + fatalError(std::move(BinaryWriteError)); + } + if (OutputIFSFilePath.getNumOccurrences() == 1) { + Stub.IfsVersion = IfsVersionCurrent; + if (InputFormat.getValue() == FileFormat::ELF && + OptTargetTripleHint.getNumOccurrences() == 1) { + std::error_code HintEC(1, std::generic_category()); + IFSTarget HintTarget = parseTriple(OptTargetTripleHint); + if (Stub.Target.Arch.getValue() != HintTarget.Arch.getValue()) + fatalError(make_error( + "Triple hint does not match the actual architecture", HintEC)); + if (Stub.Target.Endianness.getValue() != + HintTarget.Endianness.getValue()) + fatalError(make_error( + "Triple hint does not match the actual endianness", HintEC)); + if (Stub.Target.BitWidth.getValue() != HintTarget.BitWidth.getValue()) + fatalError(make_error( + "Triple hint does not match the actual bit width", HintEC)); + + stripIFSTarget(Stub, true, false, false, false); + Stub.Target.Triple = OptTargetTripleHint.getValue(); + } else { + stripIFSTarget(Stub, StripIFSTarget, StripIFSArch, + StripIFSEndiannessWidth, StripIFSBitWidth); + } + if (StripUndefined) + stripIFSUndefinedSymbols(Stub); + Error IFSWriteError = writeIFS(OutputIFSFilePath.getValue(), Stub); + if (IFSWriteError) + fatalError(std::move(IFSWriteError)); + } + if (OutputTBDFilePath.getNumOccurrences() == 1) { + std::error_code SysErr; + raw_fd_ostream Out(OutputTBDFilePath, SysErr); + if (SysErr) { + WithColor::error() << "Couldn't open " << OutputTBDFilePath + << " for writing.\n"; + return -1; + } + if (!Stub.Target.Triple) { + WithColor::error() + << "Triple should be defined when output format is TBD"; + return -1; + } + return writeTbdStub(llvm::Triple(Stub.Target.Triple.getValue()), + Stub.Symbols, "TBD", Out); } - if (StripUndefined) - stripIFSUndefinedSymbols(Stub); - Error IFSWriteError = writeIFS(OutputFilePath.getValue(), Stub); - if (IFSWriteError) - fatalError(std::move(IFSWriteError)); - break; - } - case FileFormat::ELF: { - Error TargetError = validateIFSTarget(Stub, true); - if (TargetError) - fatalError(std::move(TargetError)); - Error BinaryWriteError = - writeBinaryStub(OutputFilePath, Stub, WriteIfChanged); - if (BinaryWriteError) - fatalError(std::move(BinaryWriteError)); - break; - } } return 0; }