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 ## Sysv output prints a single blank line in this case.
12 # RUN: llvm-size -A %t1.a | FileCheck %s --implicit-check-not={{.}}
14 ## Case 2: Single member.
16 # RUN: llvm-ar rc %t2.a %t1
18 # RUN: llvm-size -B %t2.a | FileCheck %s -DARCHIVE=%t2.a --check-prefix=BERKELEY-1
19 # RUN: llvm-size -A %t2.a | FileCheck %s -DARCHIVE=%t2.a --check-prefix=SYSV-1
21 ## Case 3: Multiple members.
23 # RUN: llvm-ar rc %t3.a %t1 %t2
25 # RUN: llvm-size -B %t3.a | FileCheck %s -DARCHIVE=%t3.a --check-prefixes=BERKELEY-1,BERKELEY-2
26 # RUN: llvm-size -A %t3.a | FileCheck %s -DARCHIVE=%t3.a --check-prefixes=SYSV-1,SYSV-2
28 ## Case 4: Mixing archives and non-archives produces sensible output:
29 # RUN: llvm-size -B %t1 %t2.a %t2 %t3.a \
30 # RUN: | FileCheck %s -DARCHIVE=%t3.a -DARCHIVE2=%t2.a -DFILE1=%t1 -DFILE2=%t2 \
31 # RUN: --check-prefixes=BERKELEY-1,BERKELEY-2,BERKELEY-3
32 # RUN: llvm-size -A %t1 %t2.a %t2 %t3.a \
33 # RUN: | FileCheck %s -DARCHIVE=%t3.a -DARCHIVE2=%t2.a -DFILE1=%t1 -DFILE2=%t2 \
34 # RUN: --check-prefixes=SYSV-1,SYSV-2,SYSV-3
36 # BERKELEY-1: text data bss dec hex filename
37 # BERKELEY-3-NEXT: 1 2 4 7 7 [[FILE1]]
38 # BERKELEY-3-NEXT: 1 2 4 7 7 archive.test.tmp1 (ex [[ARCHIVE2]])
39 # BERKELEY-3-NEXT: 8 16 32 56 38 [[FILE2]]
40 # BERKELEY-1-NEXT: 1 2 4 7 7 archive.test.tmp1 (ex [[ARCHIVE]])
41 # BERKELEY-2-NEXT: 8 16 32 56 38 archive.test.tmp2 (ex [[ARCHIVE]])
42 # BERKELEY-1-NOT:{{.}}
45 # SYSV-3-NEXT: section size addr
46 # SYSV-3-NEXT: .text 1 4
47 # SYSV-3-NEXT: .data 2 2
48 # SYSV-3-NEXT: .bss 4 1
49 # 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
58 # SYSV-3-NEXT: [[FILE2]] :
59 # SYSV-3-NEXT: section size addr
60 # SYSV-3-NEXT: .text 8 32
61 # SYSV-3-NEXT: .data 16 16
62 # SYSV-3-NEXT: .bss 32 8
63 # SYSV-3-NEXT: Total 56
66 # SYSV-1: archive.test.tmp1 (ex [[ARCHIVE]]):
67 # SYSV-1-NEXT: section size addr
68 # SYSV-1-NEXT: .text 1 4
69 # SYSV-1-NEXT: .data 2 2
70 # SYSV-1-NEXT: .bss 4 1
71 # SYSV-1-NEXT: Total 7
73 # SYSV-2-NEXT: archive.test.tmp2 (ex [[ARCHIVE]]):
74 # SYSV-2-NEXT: section size addr
75 # SYSV-2-NEXT: .text 8 32
76 # SYSV-2-NEXT: .data 16 16
77 # SYSV-2-NEXT: .bss 32 8
78 # SYSV-2-NEXT: Total 56
90 Flags: [SHF_ALLOC, SHF_EXECINSTR]
95 Flags: [SHF_ALLOC, SHF_WRITE]
100 Flags: [SHF_ALLOC, SHF_WRITE]
113 Flags: [SHF_ALLOC, SHF_EXECINSTR]
118 Flags: [SHF_ALLOC, SHF_WRITE]
123 Flags: [SHF_ALLOC, SHF_WRITE]