Add "-format darwin" to llvm-size to be like darwin's size(1) -m output, and
[oota-llvm.git] / test / Object / size-trivial-macho.test
1 RUN: llvm-size -A %p/Inputs/macho-text-data-bss.macho-x86_64 \
2 RUN:         | FileCheck %s -check-prefix A
3 RUN: llvm-size -B %p/Inputs/macho-text-data-bss.macho-x86_64 \
4 RUN:         | FileCheck %s -check-prefix B
5 RUN: llvm-size -format darwin %p/Inputs/macho-text-data-bss.macho-x86_64 \
6 RUN:         | FileCheck %s -check-prefix m
7 RUN: llvm-size %p/Inputs/macho-archive-x86_64.a \
8 RUN:         | FileCheck %s -check-prefix AR
9 RUN: llvm-size -format darwin %p/Inputs/macho-archive-x86_64.a \
10 RUN:         | FileCheck %s -check-prefix mAR
11 RUN: llvm-size -format darwin -x -l %p/Inputs/hello-world.macho-x86_64 \
12 RUN:         | FileCheck %s -check-prefix mxl
13
14 A: section              size   addr
15 A: __text                 12      0
16 A: __data                  4     12
17 A: __bss                   4    112
18 A: __compact_unwind       32     16
19 A: __eh_frame             64     48
20 A: Total                 116
21
22 B:      __TEXT  __DATA  __OBJC  others  dec     hex
23 B:      76      8       0       32      116     74      
24
25 m: Segment : 116
26 m:      Section (__TEXT, __text): 12
27 m:      Section (__DATA, __data): 4
28 m:      Section (__DATA, __bss): 4
29 m:      Section (__LD, __compact_unwind): 32
30 m:      Section (__TEXT, __eh_frame): 64
31 m:      total 116
32 m: total 116
33
34 AR: __TEXT      __DATA  __OBJC  others  dec     hex
35 AR: 70  0       0       32      102     66      {{.*}}/macho-archive-x86_64.a(foo.o)
36 AR: 0   4       0       0       4       4       {{.*}}/macho-archive-x86_64.a(bar.o)
37
38 mAR: {{.*}}/macho-archive-x86_64.a(foo.o):
39 mAR: Segment : 104
40 mAR:    Section (__TEXT, __text): 6
41 mAR:    Section (__LD, __compact_unwind): 32
42 mAR:    Section (__TEXT, __eh_frame): 64
43 mAR:    total 102
44 mAR: total 104
45 mAR: {{.*}}/macho-archive-x86_64.a(bar.o):
46 mAR: Segment : 4
47 mAR:    Section (__TEXT, __text): 0
48 mAR:    Section (__DATA, __data): 4
49 mAR:    total 4
50 mAR: total 4
51
52
53 mxl: Segment __PAGEZERO: 0x100000000 (vmaddr 0x0 fileoff 0)
54 mxl: Segment __TEXT: 0x1000 (vmaddr 0x100000000 fileoff 0)
55 mxl:    Section __text: 0x3b (addr 0x100000f30 offset 3888)
56 mxl:    Section __stubs: 0x6 (addr 0x100000f6c offset 3948)
57 mxl:    Section __stub_helper: 0x1a (addr 0x100000f74 offset 3956)
58 mxl:    Section __cstring: 0xd (addr 0x100000f8e offset 3982)
59 mxl:    Section __unwind_info: 0x48 (addr 0x100000f9b offset 3995)
60 mxl:    Section __eh_frame: 0x18 (addr 0x100000fe8 offset 4072)
61 mxl:    total 0xc8
62 mxl: Segment __DATA: 0x1000 (vmaddr 0x100001000 fileoff 4096)
63 mxl:    Section __nl_symbol_ptr: 0x10 (addr 0x100001000 offset 4096)
64 mxl:    Section __la_symbol_ptr: 0x8 (addr 0x100001010 offset 4112)
65 mxl:    total 0x18
66 mxl: Segment __LINKEDIT: 0x1000 (vmaddr 0x100002000 fileoff 8192)
67 mxl: total 0x100003000