• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llvm-mc -filetype=obj -triple=avr %s -mattr=avr6 | llvm-objdump -r - | FileCheck %s
2
3; CHECK: RELOCATION RECORDS FOR
4
5.global bar
6bar:
7  jmp bar
8
9; CHECK: R_AVR_LDI SYMBOL+0x3
10ldi r21, SYMBOL+3
11
12; CHECK: R_AVR_6 SYMBOL+0x4
13ldd r8, Y+SYMBOL+4
14
15; CHECK-NEXT: R_AVR_6_ADIW FOO
16adiw r24, FOO
17
18; CHECK-NEXT: R_AVR_16 BAR+0x2
19lds r8, BAR+2
20
21; CHECK-NEXT: R_AVR_PORT5 foo
22sbic foo, 1
23
24; CHECK-NEXT: R_AVR_PORT6 Bar+0x2
25in r30, Bar+2
26
27; CHECK-NEXT: R_AVR_CALL foo+0x3
28call foo+3
29
30; CHECK-NEXT: R_AVR_13_PCREL foo-0xa
31rjmp foo-10
32
33; CHECK-NEXT: R_AVR_7_PCREL foo+0x2
34brcs foo+2
35
36; CHECK-NEXT: R_AVR_LO8_LDI bar+0x3
37; CHECK-NEXT: R_AVR_LO8_LDI abc
38; CHECK-NEXT: R_AVR_LO8_LDI abc
39ldi r24, lo8(bar+3)
40ldi r16, +lo8(abc)
41ldi r16, lo8(+(abc))
42
43; CHECK-NEXT: R_AVR_HI8_LDI abc
44; CHECK-NEXT: R_AVR_HI8_LDI abc
45; CHECK-NEXT: R_AVR_HI8_LDI abc
46ldi r30, hi8(abc)
47ldi r16, +hi8(abc)
48ldi r16, hi8(+(abc))
49
50; CHECK-NEXT: R_AVR_LO8_LDI_NEG abc
51; CHECK-NEXT: R_AVR_LO8_LDI_NEG abc
52ldi r16, -lo8(abc)
53ldi r16, lo8(-(abc))
54
55; CHECK-NEXT: R_AVR_HI8_LDI_NEG abc
56; CHECK-NEXT: R_AVR_HI8_LDI_NEG abc
57ldi r16, -hi8(abc)
58ldi r16, hi8(-(abc))
59
60; CHECK-NEXT: R_AVR_HH8_LDI foo
61; CHECK-NEXT: R_AVR_HH8_LDI foo
62; CHECK-NEXT: R_AVR_HH8_LDI foo
63ldi r16, hh8(foo)
64ldi r16, +hh8(foo)
65ldi r16, hh8(+(foo))
66
67; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
68; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
69ldi r16, -hh8(foo)
70ldi r16, hh8(-(foo))
71
72; CHECK-NEXT: R_AVR_HH8_LDI foo
73; CHECK-NEXT: R_AVR_HH8_LDI foo
74; CHECK-NEXT: R_AVR_HH8_LDI foo
75ldi r24, hlo8(foo)
76ldi r24, +hlo8(foo)
77ldi r24, hlo8(+(foo))
78
79; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
80; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
81ldi r24, -hlo8(foo)
82ldi r24, hlo8(-(foo))
83
84; CHECK-NEXT: R_AVR_MS8_LDI bar
85; CHECK-NEXT: R_AVR_MS8_LDI bar
86; CHECK-NEXT: R_AVR_MS8_LDI bar
87ldi r24, hhi8(bar)
88ldi r24, +hhi8(bar)
89ldi r24, hhi8(+(bar))
90
91; CHECK-NEXT: R_AVR_MS8_LDI_NEG bar
92; CHECK-NEXT: R_AVR_MS8_LDI_NEG bar
93ldi r24, -hhi8(bar)
94ldi r24, hhi8(-(bar))
95
96; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
97; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
98; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
99ldi r17, pm_lo8(foo)
100ldi r25, +pm_lo8(foo)
101ldi r25, pm_lo8(+(foo))
102
103; CHECK-NEXT: R_AVR_HI8_LDI_PM bar
104; CHECK-NEXT: R_AVR_HI8_LDI_PM foo
105; CHECK-NEXT: R_AVR_HI8_LDI_PM foo
106ldi r22, pm_hi8(bar)
107ldi r25, +pm_hi8(foo)
108ldi r25, pm_hi8(+(foo))
109
110; CHECK-NEXT: R_AVR_HH8_LDI_PM baz
111; CHECK-NEXT: R_AVR_HH8_LDI_PM foo
112; CHECK-NEXT: R_AVR_HH8_LDI_PM foo
113ldi r25, pm_hh8(baz)
114ldi r25, +pm_hh8(foo)
115ldi r25, pm_hh8(+(foo))
116
117; CHECK-NEXT: R_AVR_LO8_LDI_PM_NEG foo
118; CHECK-NEXT: R_AVR_LO8_LDI_PM_NEG foo
119ldi r25, -pm_lo8(foo)
120ldi r25, pm_lo8(-(foo))
121
122; CHECK-NEXT: R_AVR_HI8_LDI_PM_NEG foo
123; CHECK-NEXT: R_AVR_HI8_LDI_PM_NEG foo
124ldi r25, -pm_hi8(foo)
125ldi r25, pm_hi8(-(foo))
126
127; CHECK-NEXT: R_AVR_HH8_LDI_PM_NEG foo
128; CHECK-NEXT: R_AVR_HH8_LDI_PM_NEG foo
129ldi r25, -pm_hh8(foo)
130ldi r25, pm_hh8(-(foo))
131
132; CHECK-NEXT: R_AVR_LO8_LDI_GS foo
133ldi r17, lo8(gs(foo))
134
135; CHECK-NEXT: R_AVR_HI8_LDI_GS foo
136ldi r18, hi8(gs(foo))
137
138; CHECK-NEXT: R_AVR_16
139.short foo
140
141; CHECK-NEXT: R_AVR_16_PM
142.short gs(foo)
143
144; CHECK-NEXT: R_AVR_8
145.byte foo
146
147; CHECK-NEXT: R_AVR_8_LO8
148.byte lo8(foo)
149
150; CHECK-NEXT: R_AVR_8_HI8
151.byte hi8(foo)
152
153; CHECK-NEXT: R_AVR_8_HLO8
154.byte hlo8(foo)
155
156; CHECK: R_AVR_DIFF8
157.byte foo - bar
158
159; CHECK: R_AVR_DIFF16
160.short foo - bar
161
162; CHECK: R_AVR_DIFF32
163.long foo - bar
164