xref: /llvm-project/llvm/test/tools/llvm-size/darwin-m.test (revision a8eef4e5f50009f9b4387c8e617f34493549a781)
1## Show that -m/--format=darwin produces darwin-style output.
2
3# RUN: yaml2obj %s --docnum=1 -o %t
4# RUN: yaml2obj %s --docnum=2 -o %t2
5# RUN: llvm-size -m %t \
6# RUN:   | FileCheck --check-prefix=DARWIN %s --implicit-check-not={{.}} \
7# RUN:               --strict-whitespace --match-full-lines
8# RUN: llvm-size -m %t %t2 \
9# RUN:   | FileCheck --check-prefixes=DARWIN,DARWIN2 %s --implicit-check-not={{.}} \
10# RUN:               -DFILE1=%t -DFILE2=%t2 --strict-whitespace --match-full-lines
11# RUN: llvm-size --format=darwin %t \
12# RUN:   | FileCheck --check-prefix=DARWIN %s --implicit-check-not={{.}} \
13# RUN:               --strict-whitespace --match-full-lines
14# RUN: llvm-size --format=darwin %t %t2 \
15# RUN:   | FileCheck --check-prefixes=DARWIN,DARWIN2 %s --implicit-check-not={{.}} \
16# RUN:               -DFILE1=%t -DFILE2=%t2 --strict-whitespace --match-full-lines
17
18#      DARWIN2:[[FILE1]]:
19#       DARWIN:Segment : 12
20#  DARWIN-NEXT:	Section (__TEXT, __text): 4
21#  DARWIN-NEXT:	Section (__DATA, __data): 8
22#  DARWIN-NEXT:	total 12
23#  DARWIN-NEXT:total 12
24#      DARWIN2:[[FILE2]]:
25# DARWIN2-NEXT:Segment : 48
26# DARWIN2-NEXT:	Section (__TEXT, __text): 16
27# DARWIN2-NEXT:	Section (__DATA, __data): 32
28# DARWIN2-NEXT:	total 48
29# DARWIN2-NEXT:total 48
30
31--- !mach-o
32FileHeader:
33  magic:      0xFEEDFACE
34  cputype:    0x0000000C
35  cpusubtype: 0x00000009
36  filetype:   0x00000001
37  ncmds:      1
38  sizeofcmds: 192
39  flags:      0x00000000
40LoadCommands:
41  - cmd:      LC_SEGMENT
42    cmdsize:  192
43    segname:  ''
44    vmaddr:   0
45    vmsize:   12
46    fileoff:  220
47    filesize: 12
48    maxprot:  7
49    initprot: 7
50    nsects:   2
51    flags:    0
52    Sections:
53      - sectname:  __text
54        segname:   __TEXT
55        addr:      0x0000000000000000
56        size:      4
57        offset:    0x000000DC
58        align:     0
59        reloff:    0x00000000
60        nreloc:    0
61        flags:     0x80000000
62        reserved1: 0x00000000
63        reserved2: 0x00000000
64        reserved3: 0x00000000
65      - sectname:  __data
66        segname:   __DATA
67        addr:      0x0000000000000004
68        size:      8
69        offset:    0x000000E0
70        align:     0
71        reloff:    0x00000000
72        nreloc:    0
73        flags:     0x00000000
74        reserved1: 0x00000000
75        reserved2: 0x00000000
76        reserved3: 0x00000000
77
78--- !mach-o
79FileHeader:
80  magic:      0xFEEDFACE
81  cputype:    0x0000000C
82  cpusubtype: 0x00000009
83  filetype:   0x00000001
84  ncmds:      1
85  sizeofcmds: 192
86  flags:      0x00000000
87LoadCommands:
88  - cmd:      LC_SEGMENT
89    cmdsize:  192
90    segname:  ''
91    vmaddr:   0
92    vmsize:   48
93    fileoff:  220
94    filesize: 48
95    maxprot:  7
96    initprot: 7
97    nsects:   2
98    flags:    0
99    Sections:
100      - sectname:  __text
101        segname:   __TEXT
102        addr:      0x0000000000000000
103        size:      16
104        offset:    0x000000DC
105        align:     0
106        reloff:    0x00000000
107        nreloc:    0
108        flags:     0x80000000
109        reserved1: 0x00000000
110        reserved2: 0x00000000
111        reserved3: 0x00000000
112      - sectname:  __data
113        segname:   __DATA
114        addr:      0x0000000000000010
115        size:      32
116        offset:    0x000000EC
117        align:     0
118        reloff:    0x00000000
119        nreloc:    0
120        flags:     0x00000000
121        reserved1: 0x00000000
122        reserved2: 0x00000000
123        reserved3: 0x00000000
124