• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: ld64.lld -arch x86_64 -r -print_atoms %s -o %t  | FileCheck %s
2#
3# Test parsing of tentative definitions, including size, scope, and alignment.
4#
5#
6# int tent4;
7# long tent8;
8# __attribute__((visibility("hidden"))) int tentHidden;
9# __attribute__((aligned(16))) int tent4_16;
10# __attribute__((aligned(32))) long tent64_32[8];
11#
12
13--- !mach-o
14arch:            x86_64
15file-type:       MH_OBJECT
16flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
17has-UUID:        false
18OS:              unknown
19sections:
20  - segment:         __TEXT
21    section:         __tex
22    type:            S_REGULAR
23    attributes:      [ S_ATTR_PURE_INSTRUCTIONS ]
24    address:         0x0000000000000000
25undefined-symbols:
26  - name:            _tent4
27    type:            N_UNDF
28    scope:           [ N_EXT ]
29    desc:            0x0200
30    value:           0x0000000000000004
31  - name:            _tent4_16
32    type:            N_UNDF
33    scope:           [ N_EXT ]
34    desc:            0x0400
35    value:           0x0000000000000004
36  - name:            _tent64_32
37    type:            N_UNDF
38    scope:           [ N_EXT ]
39    desc:            0x0500
40    value:           0x0000000000000040
41  - name:            _tent8
42    type:            N_UNDF
43    scope:           [ N_EXT ]
44    desc:            0x0300
45    value:           0x0000000000000008
46  - name:            _tentHidden
47    type:            N_UNDF
48    scope:           [ N_EXT, N_PEXT ]
49    desc:            0x0200
50    value:           0x0000000000000004
51...
52
53
54# CHECK:    defined-atoms:
55# CHECK:       name:             _tent4
56# CHECK:        scope:           global
57# CHECK:        type:            zero-fill
58# CHECK:        size:            4
59# CHECK:        merge:           as-tentative
60# CHECK:        alignment:       4
61
62# CHECK:       name:             _tent4_16
63# CHECK:        scope:           global
64# CHECK:        type:            zero-fill
65# CHECK:        size:            4
66# CHECK:        merge:           as-tentative
67# CHECK:        alignment:       16
68
69# CHECK:       name:             _tent64_32
70# CHECK:        scope:           global
71# CHECK:        type:            zero-fill
72# CHECK:        size:            64
73# CHECK:        merge:           as-tentative
74# CHECK:        alignment:       32
75
76# CHECK:       name:             _tent8
77# CHECK:        scope:           global
78# CHECK:        type:            zero-fill
79# CHECK:        size:            8
80# CHECK:        merge:           as-tentative
81# CHECK:        alignment:       8
82
83# CHECK:       name:             _tentHidden
84# CHECK:        scope:           hidden
85# CHECK:        type:            zero-fill
86# CHECK:        size:            4
87# CHECK:        merge:           as-tentative
88# CHECK:        alignment:       4
89