• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -r -expand-relocs | FileCheck %s
2
3        .data
4        .long undef
5        .long (undef + 4)
6
7        .globl local_a_ext
8local_a_ext:
9        .long local_a_ext
10
11local_a:
12        .long 0
13local_a_elt:
14        .long 0
15local_b:
16        .long local_b - local_c + 245
17        .long 0
18local_c:
19        .long 0
20
21
22        .long local_a_elt + 1
23        .long local_a_elt + 10
24        .short local_a_elt + 20
25        .byte local_a_elt + 89
26
27        .const
28
29        .long
30bar:
31        .long local_a_elt - bar + 33
32
33L0:
34        .long L0
35        .long L1
36
37        .text
38_f0:
39L1:
40        jmp	0xbabecafe
41        jmp L0
42        jmp L1
43        ret
44
45        .objc_class_name_A=0
46	.globl .objc_class_name_A
47
48        .text
49        .globl _f1
50        .weak_definition _f1
51_f1:
52        .data
53        .long _f1
54        .long _f1 + 4
55
56// CHECK:     Relocations [
57// CHECK-NEXT:  Section __text {
58// CHECK-NEXT:    Relocation {
59// CHECK-NEXT:      Offset: 0x6
60// CHECK-NEXT:      PCRel: 1
61// CHECK-NEXT:      Length: 2
62// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
63// CHECK-NEXT:      Section: __const
64// CHECK-NEXT:    }
65// CHECK-NEXT:    Relocation {
66// CHECK-NEXT:      Offset: 0x1
67// CHECK-NEXT:      PCRel: 1
68// CHECK-NEXT:      Length: 2
69// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
70// CHECK-NEXT:      Section: - (0)
71// CHECK-NEXT:    }
72// CHECK-NEXT:  }
73// CHECK-NEXT:  Section __data {
74// CHECK-NEXT:    Relocation {
75// CHECK-NEXT:      Offset: 0x2F
76// CHECK-NEXT:      PCRel: 0
77// CHECK-NEXT:      Length: 2
78// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
79// CHECK-NEXT:      Symbol: _f1
80// CHECK-NEXT:    }
81// CHECK-NEXT:    Relocation {
82// CHECK-NEXT:      Offset: 0x2B
83// CHECK-NEXT:      PCRel: 0
84// CHECK-NEXT:      Length: 2
85// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
86// CHECK-NEXT:      Symbol: _f1
87// CHECK-NEXT:    }
88// CHECK-NEXT:    Relocation {
89// CHECK-NEXT:      Offset: 0x2A
90// CHECK-NEXT:      PCRel: 0
91// CHECK-NEXT:      Length: 0
92// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
93// CHECK-NEXT:      Value: 0x1D
94// CHECK-NEXT:    }
95// CHECK-NEXT:    Relocation {
96// CHECK-NEXT:      Offset: 0x28
97// CHECK-NEXT:      PCRel: 0
98// CHECK-NEXT:      Length: 1
99// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
100// CHECK-NEXT:      Value: 0x1D
101// CHECK-NEXT:    }
102// CHECK-NEXT:    Relocation {
103// CHECK-NEXT:      Offset: 0x24
104// CHECK-NEXT:      PCRel: 0
105// CHECK-NEXT:      Length: 2
106// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
107// CHECK-NEXT:      Value: 0x1D
108// CHECK-NEXT:    }
109// CHECK-NEXT:    Relocation {
110// CHECK-NEXT:      Offset: 0x20
111// CHECK-NEXT:      PCRel: 0
112// CHECK-NEXT:      Length: 2
113// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
114// CHECK-NEXT:      Value: 0x1D
115// CHECK-NEXT:    }
116// CHECK-NEXT:    Relocation {
117// CHECK-NEXT:      Offset: 0x14
118// CHECK-NEXT:      PCRel: 0
119// CHECK-NEXT:      Length: 2
120// CHECK-NEXT:      Type: GENERIC_RELOC_LOCAL_SECTDIFF (4)
121// CHECK-NEXT:      Value: 0x21
122// CHECK-NEXT:    }
123// CHECK-NEXT:    Relocation {
124// CHECK-NEXT:      Offset: 0x0
125// CHECK-NEXT:      PCRel: 0
126// CHECK-NEXT:      Length: 2
127// CHECK-NEXT:      Type: GENERIC_RELOC_PAIR (1)
128// CHECK-NEXT:      Value: 0x29
129// CHECK-NEXT:    }
130// CHECK-NEXT:    Relocation {
131// CHECK-NEXT:      Offset: 0x8
132// CHECK-NEXT:      PCRel: 0
133// CHECK-NEXT:      Length: 2
134// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
135// CHECK-NEXT:      Section: __data
136// CHECK-NEXT:    }
137// CHECK-NEXT:    Relocation {
138// CHECK-NEXT:      Offset: 0x4
139// CHECK-NEXT:      PCRel: 0
140// CHECK-NEXT:      Length: 2
141// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
142// CHECK-NEXT:      Symbol: undef
143// CHECK-NEXT:    }
144// CHECK-NEXT:    Relocation {
145// CHECK-NEXT:      Offset: 0x0
146// CHECK-NEXT:      PCRel: 0
147// CHECK-NEXT:      Length: 2
148// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
149// CHECK-NEXT:      Symbol: undef
150// CHECK-NEXT:    }
151// CHECK-NEXT:  }
152// CHECK-NEXT:  Section __const {
153// CHECK-NEXT:    Relocation {
154// CHECK-NEXT:      Offset: 0x8
155// CHECK-NEXT:      PCRel: 0
156// CHECK-NEXT:      Length: 2
157// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
158// CHECK-NEXT:      Section: __text
159// CHECK-NEXT:    }
160// CHECK-NEXT:    Relocation {
161// CHECK-NEXT:      Offset: 0x4
162// CHECK-NEXT:      PCRel: 0
163// CHECK-NEXT:      Length: 2
164// CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
165// CHECK-NEXT:      Section: __const
166// CHECK-NEXT:    }
167// CHECK-NEXT:    Relocation {
168// CHECK-NEXT:      Offset: 0x0
169// CHECK-NEXT:      PCRel: 0
170// CHECK-NEXT:      Length: 2
171// CHECK-NEXT:      Type: GENERIC_RELOC_LOCAL_SECTDIFF (4)
172// CHECK-NEXT:      Value: 0x1D
173// CHECK-NEXT:    }
174// CHECK-NEXT:    Relocation {
175// CHECK-NEXT:      Offset: 0x0
176// CHECK-NEXT:      PCRel: 0
177// CHECK-NEXT:      Length: 2
178// CHECK-NEXT:      Type: GENERIC_RELOC_PAIR (1)
179// CHECK-NEXT:      Value: 0x40
180// CHECK-NEXT:    }
181// CHECK-NEXT:  }
182// CHECK-NEXT:]
183