43 lines · plain
1# This file tests error messages produced on invalid command line arguments.2# It also checks that help messages are generated as expected.3 4# Verify that an error message is provided if an input file is missing or incorrect5 6RUN: not llvm-bolt-binary-analysis 2>&1 | FileCheck -check-prefix=NOFILEARG %s7NOFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: Not enough positional command line arguments specified!8NOFILEARG-NEXT: Must specify at least 1 positional argument: See: {{.*}}llvm-bolt-binary-analysis{{(\.exe)?}} --help9 10RUN: not llvm-bolt-binary-analysis non-existing-file 2>&1 | FileCheck -check-prefix=NONEXISTINGFILEARG %s11# Don't check the OS-dependent message "No such file or directory".12NONEXISTINGFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: 'non-existing-file': {{.*}}13 14RUN: not llvm-bolt-binary-analysis %p/Inputs/dummy.txt 2>&1 | FileCheck -check-prefix=NOELFFILEARG %s15NOELFFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: '{{.*}}/Inputs/dummy.txt': The file was not recognized as a valid object file.16 17RUN: %clang %cflags -Wl,--emit-relocs %p/../../Inputs/asm_foo.s %p/../../Inputs/asm_main.c -o %t.exe18RUN: llvm-bolt-binary-analysis %t.exe 2>&1 | FileCheck -check-prefix=VALIDELFFILEARG --allow-empty %s19# Check that there are no BOLT-WARNING or BOLT-ERROR output lines20VALIDELFFILEARG: BOLT-INFO:21VALIDELFFILEARG-NOT: BOLT-WARNING:22VALIDELFFILEARG-NOT: BOLT-ERROR:23 24# Check --help output25 26RUN: llvm-bolt-binary-analysis --help 2>&1 | FileCheck -check-prefix=HELP %s27 28HELP: OVERVIEW: BinaryAnalysis29HELP-EMPTY:30HELP-NEXT: USAGE: llvm-bolt-binary-analysis{{(\.exe)?}} [options] <executable>31HELP-EMPTY:32HELP-NEXT: OPTIONS:33HELP-EMPTY:34HELP-NEXT: BinaryAnalysis options:35HELP-EMPTY:36HELP-NEXT: --auth-traps-on-failure - Assume authentication instructions always trap on failure37HELP-NEXT: --scanners=<value> - which gadget scanners to run38HELP-NEXT: =pacret - pac-ret: return address protection (subset of "pauth")39HELP-NEXT: =pauth - All Pointer Authentication scanners40HELP-NEXT: =all - All implemented scanners41HELP-EMPTY:42HELP-NEXT: Generic Options:43