1 ## In this test we check the --needed-libs option.
3 # RUN: yaml2obj %s --docnum=1 -o %t1
4 # RUN: llvm-readobj --needed-libs %t1 2>&1 \
5 # RUN: | FileCheck %s -DFILE=%t1 --implicit-check-not=warning: --strict-whitespace --check-prefix=NEEDED-LIBS
6 # RUN: llvm-readelf --needed-libs %t1 2>&1 \
7 # RUN: | FileCheck %s -DFILE=%t1 --implicit-check-not=warning: --strict-whitespace --check-prefix=NEEDED-LIBS
9 ## Check that library names are sorted when printed.
10 ## Document that we also sort error entries.
12 # NEEDED-LIBS:{{^}}NeededLibraries [{{$}}
13 # NEEDED-LIBS-NEXT: warning: '[[FILE]]': string table at offset 0x78: unable to read the string at 0x9999a11: it goes past the end of the table (0x85){{$}}
14 # NEEDED-LIBS-NEXT: warning: '[[FILE]]': string table at offset 0x78: unable to read the string at 0x1111189: it goes past the end of the table (0x85){{$}}
15 # NEEDED-LIBS-NEXT:{{^}} <?>{{$}}
16 # NEEDED-LIBS-NEXT:{{^}} <?>{{$}}
17 # NEEDED-LIBS-NEXT:{{^}} aaa{{$}}
18 # NEEDED-LIBS-NEXT:{{^}} bbb{{$}}
19 # NEEDED-LIBS-NEXT:{{^}} ccc{{$}}
20 # NEEDED-LIBS-NEXT:{{^}}]{{$}}
31 Content: '00616161006262620063636300' ## 0,a,a,a,0,b,b,b,0,c,c,c,0
36 Value: 0x0000000000000000
57 ## Check what we print when the dynamic string table is empty.
58 # RUN: yaml2obj %s --docnum=2 -o %t2
59 # RUN: llvm-readobj --needed-libs %t2 2>&1 | \
60 # RUN: FileCheck %s -DFILE=%t2 --implicit-check-not=warning: --check-prefix=EMPTY-DYNSTR
61 # RUN: llvm-readelf --needed-libs %t2 2>&1 | \
62 # RUN: FileCheck %s -DFILE=%t2 --implicit-check-not=warning: --check-prefix=EMPTY-DYNSTR
64 # EMPTY-DYNSTR: NeededLibraries [
65 # EMPTY-DYNSTR-NEXT: warning: '[[FILE]]': string table at offset 0x78: unable to read the string at 0x79: it goes past the end of the table (0x78)
66 # EMPTY-DYNSTR-NEXT: warning: '[[FILE]]': string table at offset 0x78: unable to read the string at 0x7a: it goes past the end of the table (0x78)
67 # EMPTY-DYNSTR-NEXT: <?>
68 # EMPTY-DYNSTR-NEXT: <?>
69 # EMPTY-DYNSTR-NEXT: ]
86 Value: 0x0000000000000000