[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / MC / AVR / relocations.s
blobab08d248721d114768e39e7e1c3318b5f18fa259
1 ; RUN: llvm-mc -filetype=obj -triple=avr %s -mattr=avr6 | llvm-objdump -r - | FileCheck %s
3 ; CHECK: RELOCATION RECORDS FOR
5 .global bar
6 bar:
7 jmp bar
9 ; CHECK: R_AVR_LDI SYMBOL+3
10 ldi r21, SYMBOL+3
12 ; CHECK-NEXT: R_AVR_6_ADIW FOO
13 adiw r24, FOO
15 ; CHECK-NEXT: R_AVR_16 BAR+2
16 lds r8, BAR+2
18 ; CHECK-NEXT: R_AVR_PORT5 foo
19 sbic foo, 1
21 ; CHECK-NEXT: R_AVR_PORT6 Bar+2
22 in r30, Bar+2
24 ; CHECK-NEXT: R_AVR_CALL foo+3
25 call foo+3
27 ; CHECK-NEXT: R_AVR_13_PCREL foo-10
28 rjmp foo-10
30 ; CHECK-NEXT: R_AVR_7_PCREL foo+2
31 brcs foo+2
33 ; CHECK-NEXT: R_AVR_LO8_LDI bar+3
34 ; CHECK-NEXT: R_AVR_LO8_LDI abc
35 ; CHECK-NEXT: R_AVR_LO8_LDI abc
36 ldi r24, lo8(bar+3)
37 ldi r16, +lo8(abc)
38 ldi r16, lo8(+(abc))
40 ; CHECK-NEXT: R_AVR_HI8_LDI abc
41 ; CHECK-NEXT: R_AVR_HI8_LDI abc
42 ; CHECK-NEXT: R_AVR_HI8_LDI abc
43 ldi r30, hi8(abc)
44 ldi r16, +hi8(abc)
45 ldi r16, hi8(+(abc))
47 ; CHECK-NEXT: R_AVR_LO8_LDI_NEG abc
48 ; CHECK-NEXT: R_AVR_LO8_LDI_NEG abc
49 ldi r16, -lo8(abc)
50 ldi r16, lo8(-(abc))
52 ; CHECK-NEXT: R_AVR_HI8_LDI_NEG abc
53 ; CHECK-NEXT: R_AVR_HI8_LDI_NEG abc
54 ldi r16, -hi8(abc)
55 ldi r16, hi8(-(abc))
57 ; CHECK-NEXT: R_AVR_HH8_LDI foo
58 ; CHECK-NEXT: R_AVR_HH8_LDI foo
59 ; CHECK-NEXT: R_AVR_HH8_LDI foo
60 ldi r16, hh8(foo)
61 ldi r16, +hh8(foo)
62 ldi r16, hh8(+(foo))
64 ; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
65 ; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
66 ldi r16, -hh8(foo)
67 ldi r16, hh8(-(foo))
69 ; CHECK-NEXT: R_AVR_HH8_LDI foo
70 ; CHECK-NEXT: R_AVR_HH8_LDI foo
71 ; CHECK-NEXT: R_AVR_HH8_LDI foo
72 ldi r24, hlo8(foo)
73 ldi r24, +hlo8(foo)
74 ldi r24, hlo8(+(foo))
76 ; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
77 ; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
78 ldi r24, -hlo8(foo)
79 ldi r24, hlo8(-(foo))
81 ; CHECK-NEXT: R_AVR_MS8_LDI bar
82 ; CHECK-NEXT: R_AVR_MS8_LDI bar
83 ; CHECK-NEXT: R_AVR_MS8_LDI bar
84 ldi r24, hhi8(bar)
85 ldi r24, +hhi8(bar)
86 ldi r24, hhi8(+(bar))
88 ; CHECK-NEXT: R_AVR_MS8_LDI_NEG bar
89 ; CHECK-NEXT: R_AVR_MS8_LDI_NEG bar
90 ldi r24, -hhi8(bar)
91 ldi r24, hhi8(-(bar))
93 ; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
94 ; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
95 ; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
96 ldi r17, pm_lo8(foo)
97 ldi r25, +pm_lo8(foo)
98 ldi r25, pm_lo8(+(foo))
100 ; CHECK-NEXT: R_AVR_HI8_LDI_PM bar
101 ; CHECK-NEXT: R_AVR_HI8_LDI_PM foo
102 ; CHECK-NEXT: R_AVR_HI8_LDI_PM foo
103 ldi r22, pm_hi8(bar)
104 ldi r25, +pm_hi8(foo)
105 ldi r25, pm_hi8(+(foo))
107 ; CHECK-NEXT: R_AVR_HH8_LDI_PM baz
108 ; CHECK-NEXT: R_AVR_HH8_LDI_PM foo
109 ; CHECK-NEXT: R_AVR_HH8_LDI_PM foo
110 ldi r25, pm_hh8(baz)
111 ldi r25, +pm_hh8(foo)
112 ldi r25, pm_hh8(+(foo))
114 ; CHECK-NEXT: R_AVR_LO8_LDI_PM_NEG foo
115 ; CHECK-NEXT: R_AVR_LO8_LDI_PM_NEG foo
116 ldi r25, -pm_lo8(foo)
117 ldi r25, pm_lo8(-(foo))
119 ; CHECK-NEXT: R_AVR_HI8_LDI_PM_NEG foo
120 ; CHECK-NEXT: R_AVR_HI8_LDI_PM_NEG foo
121 ldi r25, -pm_hi8(foo)
122 ldi r25, pm_hi8(-(foo))
124 ; CHECK-NEXT: R_AVR_HH8_LDI_PM_NEG foo
125 ; CHECK-NEXT: R_AVR_HH8_LDI_PM_NEG foo
126 ldi r25, -pm_hh8(foo)
127 ldi r25, pm_hh8(-(foo))
129 ; CHECK-NEXT: R_AVR_LO8_LDI_GS foo
130 ldi r17, lo8(gs(foo))
132 ; CHECK-NEXT: R_AVR_HI8_LDI_GS foo
133 ldi r18, hi8(gs(foo))
135 ; CHECK-NEXT: R_AVR_16
136 .short foo
138 ; CHECK-NEXT: R_AVR_16_PM
139 .short gs(foo)
141 ; CHECK-NEXT: R_AVR_8
142 .byte foo
144 ; CHECK-NEXT: R_AVR_8_LO8
145 .byte lo8(foo)
147 ; CHECK-NEXT: R_AVR_8_HI8
148 .byte hi8(foo)
150 ; CHECK-NEXT: R_AVR_8_HLO8
151 .byte hlo8(foo)
153 ; CHECK: R_AVR_DIFF8
154 .byte foo - bar
156 ; CHECK: R_AVR_DIFF16
157 .short foo - bar
159 ; CHECK: R_AVR_DIFF32
160 .long foo - bar