1 ## Show how llvm-size behaves when passed in an archive.
3 # RUN: yaml2obj %s --docnum=1 -o %t1
4 # RUN: yaml2obj %s --docnum=2 -o %t2
6 ## Case 1: Empty archive. No output expected.
8 # RUN: llvm-ar rc %t1.a
10 # RUN: llvm-size -B %t1.a | count 0
11 # RUN: llvm-size -A %t1.a | count 0
13 ## Case 2: Single member.
15 # RUN: llvm-ar rc %t2.a %t1
17 # RUN: llvm-size -B %t2.a | FileCheck %s -DARCHIVE=%t2.a --check-prefix=BERKELEY-1
18 # RUN: llvm-size -A %t2.a | FileCheck %s -DARCHIVE=%t2.a --check-prefix=SYSV-1
20 ## Case 3: Multiple members.
22 # RUN: llvm-ar rc %t3.a %t1 %t2
24 # RUN: llvm-size -B %t3.a | FileCheck %s -DARCHIVE=%t3.a --check-prefixes=BERKELEY-1,BERKELEY-2
25 # RUN: llvm-size -A %t3.a | FileCheck %s -DARCHIVE=%t3.a --check-prefixes=SYSV-1,SYSV-2
27 ## Case 4: Mixing archives and non-archives produces sensible output:
28 # RUN: llvm-size -B %t1 %t2.a %t2 %t3.a \
29 # RUN: | FileCheck %s -DARCHIVE=%t3.a -DARCHIVE2=%t2.a -DFILE1=%t1 -DFILE2=%t2 \
30 # RUN: --check-prefixes=BERKELEY-1,BERKELEY-2,BERKELEY-3
31 # RUN: llvm-size -A %t1 %t2.a %t2 %t3.a \
32 # RUN: | FileCheck %s -DARCHIVE=%t3.a -DARCHIVE2=%t2.a -DFILE1=%t1 -DFILE2=%t2 \
33 # RUN: --check-prefixes=SYSV-1,SYSV-2,SYSV-3
35 # BERKELEY-1: text data bss dec hex filename
36 # BERKELEY-3-NEXT: 1 2 4 7 7 [[FILE1]]
37 # BERKELEY-3-NEXT: 1 2 4 7 7 archive.test.tmp1 (ex [[ARCHIVE2]])
38 # BERKELEY-3-NEXT: 8 16 32 56 38 [[FILE2]]
39 # BERKELEY-1-NEXT: 1 2 4 7 7 archive.test.tmp1 (ex [[ARCHIVE]])
40 # BERKELEY-2-NEXT: 8 16 32 56 38 archive.test.tmp2 (ex [[ARCHIVE]])
41 # BERKELEY-1-NOT:{{.}}
44 # SYSV-3-NEXT: section size addr
45 # SYSV-3-NEXT: .text 1 4
46 # SYSV-3-NEXT: .data 2 2
47 # SYSV-3-NEXT: .bss 4 1
48 # SYSV-3-NEXT: Total 7
51 # SYSV-3-NEXT: archive.test.tmp1 (ex [[ARCHIVE2]]):
52 # SYSV-3-NEXT: section size addr
53 # SYSV-3-NEXT: .text 1 4
54 # SYSV-3-NEXT: .data 2 2
55 # SYSV-3-NEXT: .bss 4 1
56 # SYSV-3-NEXT: Total 7
59 # SYSV-3-NEXT: [[FILE2]] :
60 # SYSV-3-NEXT: section size addr
61 # SYSV-3-NEXT: .text 8 32
62 # SYSV-3-NEXT: .data 16 16
63 # SYSV-3-NEXT: .bss 32 8
64 # SYSV-3-NEXT: Total 56
67 # SYSV-1: archive.test.tmp1 (ex [[ARCHIVE]]):
68 # SYSV-1-NEXT: section size addr
69 # SYSV-1-NEXT: .text 1 4
70 # SYSV-1-NEXT: .data 2 2
71 # SYSV-1-NEXT: .bss 4 1
72 # SYSV-1-NEXT: Total 7
76 # SYSV-2-NEXT: archive.test.tmp2 (ex [[ARCHIVE]]):
77 # SYSV-2-NEXT: section size addr
78 # SYSV-2-NEXT: .text 8 32
79 # SYSV-2-NEXT: .data 16 16
80 # SYSV-2-NEXT: .bss 32 8
81 # SYSV-2-NEXT: Total 56
93 Flags: [SHF_ALLOC, SHF_EXECINSTR]
98 Flags: [SHF_ALLOC, SHF_WRITE]
103 Flags: [SHF_ALLOC, SHF_WRITE]
116 Flags: [SHF_ALLOC, SHF_EXECINSTR]
121 Flags: [SHF_ALLOC, SHF_WRITE]
126 Flags: [SHF_ALLOC, SHF_WRITE]