1 # Check the dumping of a section as strings.
2 # RUN: yaml2obj %s -o %t
4 # RUN: llvm-readobj --string-dump=.strings \
5 # RUN: --string-dump=.not_null_terminated %t > %t.readobj.out
6 # RUN: FileCheck %s --input-file=%t.readobj.out --check-prefixes=HEADER,CHECK
8 # Also test the different ways --string-dump can be specified, i.e. as a short
9 # flag (-p), with different prefix modes (-p .foo, -p=.foo, -p.foo), and with
10 # the value being a index section number instead of a section name.
11 # RUN: llvm-readobj -p.strings -p.strings -p.not_null_terminated %t | cmp %t.readobj.out -
12 # RUN: llvm-readobj --string-dump=1 --string-dump=2 %t | cmp %t.readobj.out -
13 # RUN: llvm-readobj -p1 -p1 -p2 %t | cmp %t.readobj.out -
15 # Run readelf flag tests with an additional flag, --file-header, so we can test
16 # -p grouped with something.
17 # RUN: llvm-readelf --file-header --string-dump=.strings \
18 # RUN: --string-dump=.not_null_terminated %t > %t.readelf.out
19 # RUN: FileCheck %s --input-file=%t.readelf.out
21 # RUN: llvm-readelf -h -p .strings -p .not_null_terminated %t | cmp %t.readelf.out -
22 # RUN: llvm-readelf -p.strings -hp.not_null_terminated %t | cmp %t.readelf.out -
23 # RUN: llvm-readelf -hp1 -p2 %t | cmp %t.readelf.out -
24 # RUN: llvm-readelf -hp 1 -p.not_null_terminated %t | cmp %t.readelf.out -
28 # CHECK-NEXT: String dump of section '.strings':
29 # CHECK-NEXT: [ 0] here
30 # CHECK-NEXT: [ 5] are
31 # CHECK-NEXT: [ 9] some
32 # CHECK-NEXT: [ e] strings
34 # CHECK-NEXT: String dump of section '.not_null_terminated':
36 # CHECK-NEXT: [ 3] null{{$}}
39 # RUN: llvm-readobj --string-dump=does_not_exist %t 2>&1 | FileCheck -DFILE=%t %s --check-prefix=WARN1
40 # RUN: llvm-readobj --string-dump=42 %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=WARN2
42 # RUN: llvm-readelf --string-dump=does_not_exist %t 2>&1 | FileCheck -DFILE=%t %s --check-prefix=WARN1
43 # RUN: llvm-readelf --string-dump=42 %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=WARN2
45 # WARN1: warning: '[[FILE]]': could not find section 'does_not_exist'
46 # WARN2: warning: '[[FILE]]': could not find section 42
56 Content: 686572650061726500736f6d6500737472696e677300
57 - Name: .not_null_terminated
59 Content: 6e6f006e756c6c