66 lines · plain
1## Test case where input file does not exit.2RUN: not llvm-readobj %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readobj -DMSG=%errc_ENOENT %s3RUN: not llvm-readelf %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readelf -DMSG=%errc_ENOENT %s4 5ENOENT: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}.blah': [[MSG]]6 7# Test case with no input file.8RUN: not llvm-readobj 2>&1 | FileCheck %s --check-prefix=NO-FILE9RUN: not llvm-readelf 2>&1 | FileCheck %s --check-prefix=NO-FILE10NO-FILE: error: no input files specified11 12# Test case where input file is too small to be a recognised object file.13RUN: touch %t.empty14RUN: not llvm-readobj %t.empty 2>&1 | FileCheck --check-prefix=EMPTY %s15EMPTY: '{{.*}}.empty': The file was not recognized as a valid object file16 17# Test that unrecognised files in archives are ignored.18RUN: rm -f %t.a19RUN: llvm-ar rc %t.a %t.empty20RUN: llvm-readobj --all %t.a 2>&1 | FileCheck --check-prefix=NO-OUTPUT --allow-empty %s21NO-OUTPUT-NOT: {{.}}22 23## Test we report a meaningful warning for bitcode files.24## Check we try to continue dumping other files.25 26## Note: 'echo -e -n "\x42\x43\xc0\xde" > %t.bc.1' simply doesn't work properly on windows.27## It has an issue with writing of the 2 last bytes and emits different data instead.28## echo.exe from GnuWin32 works properly though, but using of python is a more stable way.29RUN: %python -c "import os; open(r'%t.bc.1', 'wb').write(b'\x42\x43\xC0\xDE')"30RUN: %python -c "import os; open(r'%t.bc.2', 'wb').write(b'\xDE\xC0\x17\x0B')"31RUN: llvm-readelf %t.bc.1 %t.bc.2 2>&1 | \32RUN: FileCheck --check-prefix=BITCODE -DFILE1=%t.bc.1 -DFILE2=%t.bc.2 %s33RUN: llvm-readobj %t.bc.1 %t.bc.2 2>&1 | \34RUN: FileCheck --check-prefix=BITCODE -DFILE1=%t.bc.1 -DFILE2=%t.bc.2 %s35 36# BITCODE: warning: '[[FILE1]]': bitcode files are not supported{{$}}37# BITCODE: warning: '[[FILE2]]': bitcode files are not supported{{$}}38 39# Test case where switch it not recognised.40RUN: not llvm-readobj --unknown-switch 2>&1 | FileCheck --check-prefix=UNKNOWN %s41UNKNOWN: error: unknown argument '--unknown-switch'42 43# Test version switch.44RUN: llvm-readobj --version | FileCheck %s --check-prefix=VERSION45RUN: llvm-readelf --version | FileCheck %s --check-prefix=VERSION46# In default configuration we could match "LLVM version", but the "LLVM" part47# can be changed with PACKAGE_NAME in CMake, so we match only version.48VERSION: version49 50# Test help switch.51RUN: llvm-readobj --help | FileCheck %s --check-prefixes=HELP,OBJ52RUN: llvm-readelf --help | FileCheck %s --check-prefixes=HELP,ELF53HELP: OVERVIEW: LLVM Object Reader54OBJ: llvm-readobj{{.*}} [options] <input object files>55ELF: llvm-readelf{{.*}} [options] <input object files>56HELP: OPTIONS:57HELP: -s Alias for --symbols58HELP: -t Alias for --section-details59HELP: OPTIONS (ELF specific):60HELP: --dynamic-table61HELP: OPTIONS (Mach-O specific):62HELP: --macho-data-in-code63HELP: OPTIONS (PE/COFF specific):64HELP: --codeview-ghash65HELP: @FILE66