Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / AVR / relocations.s
blobffc7ba8b8ff7e6b5605cd13dbb5c49ae77eeee2a
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+0x3
10 ldi r21, SYMBOL+3
12 ; CHECK: R_AVR_6 SYMBOL+0x4
13 ldd r8, Y+SYMBOL+4
15 ; CHECK-NEXT: R_AVR_6_ADIW FOO
16 adiw r24, FOO
18 ; CHECK-NEXT: R_AVR_16 BAR+0x2
19 lds r8, BAR+2
21 ; CHECK-NEXT: R_AVR_PORT5 foo
22 sbic foo, 1
24 ; CHECK-NEXT: R_AVR_PORT6 Bar+0x2
25 in r30, Bar+2
27 ; CHECK-NEXT: R_AVR_CALL foo+0x3
28 call foo+3
30 ; CHECK-NEXT: R_AVR_13_PCREL foo-0xa
31 rjmp foo-10
33 ; CHECK-NEXT: R_AVR_7_PCREL foo+0x2
34 brcs foo+2
36 ; CHECK-NEXT: R_AVR_LO8_LDI bar+0x3
37 ; CHECK-NEXT: R_AVR_LO8_LDI abc
38 ldi r24, lo8(bar+3)
39 ldi r16, lo8(+(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))
46 ; CHECK-NEXT: R_AVR_LO8_LDI_NEG abc
47 ldi r16, lo8(-(abc))
49 ; CHECK-NEXT: R_AVR_HI8_LDI_NEG abc
50 ldi r16, hi8(-(abc))
52 ; CHECK-NEXT: R_AVR_HH8_LDI foo
53 ; CHECK-NEXT: R_AVR_HH8_LDI foo
54 ldi r16, hh8(foo)
55 ldi r16, hh8(+(foo))
57 ; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
58 ldi r16, hh8(-(foo))
60 ; CHECK-NEXT: R_AVR_HH8_LDI foo
61 ; CHECK-NEXT: R_AVR_HH8_LDI foo
62 ldi r24, hlo8(foo)
63 ldi r24, hlo8(+(foo))
65 ; CHECK-NEXT: R_AVR_HH8_LDI_NEG foo
66 ldi r24, hlo8(-(foo))
68 ; CHECK-NEXT: R_AVR_MS8_LDI bar
69 ; CHECK-NEXT: R_AVR_MS8_LDI bar
70 ldi r24, hhi8(bar)
71 ldi r24, hhi8(+(bar))
73 ; CHECK-NEXT: R_AVR_MS8_LDI_NEG bar
74 ldi r24, hhi8(-(bar))
76 ; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
77 ; CHECK-NEXT: R_AVR_LO8_LDI_PM foo
78 ldi r17, pm_lo8(foo)
79 ldi r25, pm_lo8(+(foo))
81 ; CHECK-NEXT: R_AVR_HI8_LDI_PM bar
82 ; CHECK-NEXT: R_AVR_HI8_LDI_PM foo
83 ldi r22, pm_hi8(bar)
84 ldi r25, pm_hi8(+(foo))
86 ; CHECK-NEXT: R_AVR_HH8_LDI_PM baz
87 ; CHECK-NEXT: R_AVR_HH8_LDI_PM foo
88 ldi r25, pm_hh8(baz)
89 ldi r25, pm_hh8(+(foo))
91 ; CHECK-NEXT: R_AVR_LO8_LDI_PM_NEG foo
92 ldi r25, pm_lo8(-(foo))
94 ; CHECK-NEXT: R_AVR_HI8_LDI_PM_NEG foo
95 ldi r25, pm_hi8(-(foo))
97 ; CHECK-NEXT: R_AVR_HH8_LDI_PM_NEG foo
98 ldi r25, pm_hh8(-(foo))
100 ; CHECK-NEXT: R_AVR_LO8_LDI_GS foo
101 ldi r17, lo8(gs(foo))
103 ; CHECK-NEXT: R_AVR_HI8_LDI_GS foo
104 ldi r18, hi8(gs(foo))
106 ; CHECK-NEXT: R_AVR_16 foo
107 .short foo
109 ; CHECK-NEXT: R_AVR_16_PM foo
110 .short gs(foo)
112 ; CHECK-NEXT: R_AVR_16_PM foo
113 .short pm(foo)
115 ; CHECK-NEXT: R_AVR_8
116 .byte foo
118 ; CHECK-NEXT: R_AVR_8_LO8
119 .byte lo8(foo)
121 ; CHECK-NEXT: R_AVR_8_HI8
122 .byte hi8(foo)
124 ; CHECK-NEXT: R_AVR_8_HLO8
125 .byte hlo8(foo)
127 ; CHECK: R_AVR_DIFF8
128 .byte foo - bar
130 ; CHECK: R_AVR_DIFF16
131 .short foo - bar
133 ; CHECK: R_AVR_DIFF32
134 .long foo - bar