• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## In this test we check that short command line options can be merged.
2
3## Check merged args produce identical output to when not merged.
4# RUN: yaml2obj %s -o %t.o
5# RUN: llvm-readelf -aeWhSrnudlVgIs %t.o > %t.merged
6# RUN: llvm-readelf -a -e -W -h -S -r -n -u -d -l -V -g -I -s %t.o > %t.not-merged
7# RUN: cmp %t.merged %t.not-merged
8# RUN: FileCheck %s --input-file %t.merged
9
10## Check that the output without -a (--all) option is the same. We do it
11## to verify that each of the options is handled, and not just the first
12## one nor just -a, which triggers all other options.
13# RUN: llvm-readelf -eWhSrnudlVgIs %t.o > %t.merged.no.a
14# RUN: cmp %t.merged %t.merged.no.a
15
16## -e (--headers) is equivalent to setting --file-headers (-h),
17## --program-headers (-l) and --section-headers (-S).
18## Check that the output without -e is equal to the output with it.
19## We do not use -a in this test either.
20# RUN: llvm-readelf -WhSrnudlVgIs %t.o > %t.merged.no.ae
21# RUN: cmp %t.merged %t.merged.no.ae
22
23## An arbitrary YAML description that triggers an output for each of
24## the short option from the test sequence.
25
26--- !ELF
27FileHeader:
28  Class:   ELFCLASS64
29  Data:    ELFDATA2LSB
30  Type:    ET_EXEC
31  Machine: EM_X86_64
32Sections:
33  - Name:    .note.ABI-tag
34    Type:    SHT_NOTE
35## An arbitrary valid note content.
36    Content: 040000001000000001000000474E550000000000020000000600000020000000
37  - Name: .eh_frame
38    Type: SHT_PROGBITS
39  - Name:    .dynamic
40    Type:    SHT_DYNAMIC
41    Entries:
42      - Tag:   DT_NULL
43        Value: 0
44  - Name:    .gnu.version
45    Type:    SHT_GNU_versym
46    Flags:   [ SHF_ALLOC ]
47    Link:    .dynsym
48    Entries: [ 0, 1 ]
49DynamicSymbols:
50  - Name:    foo
51    Binding: STB_GLOBAL
52
53## llvm-readobj does not support merged args, because it also supports some old
54## flags (-st, -sd, etc.), and it would be confusing if only some merged args
55## were supported.
56# RUN: not llvm-readobj -aeWhSrnudlVgIs %t.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN
57
58# CHECK-NOT: Unknown command line argument
59# UNKNOWN:   for the --section-headers option: may only occur zero or one times!
60