Silence -Wunused-variable in release builds.
[llvm/stm8.git] / test / MC / ELF / relocation.s
blob7db2248adfbd959e30d6b1cd152acf870608ee6e
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck %s
3 // Test that we produce the correct relocation.
5 bar:
6 movl $bar, %edx # R_X86_64_32
7 movq $bar, %rdx # R_X86_64_32S
8 movq $bar, bar(%rip) # R_X86_64_32S
9 movl bar, %edx # R_X86_64_32S
10 movq bar, %rdx # R_X86_64_32S
11 .long bar # R_X86_64_32
12 leaq foo@GOTTPOFF(%rip), %rax # R_X86_64_GOTTPOFF
13 leaq foo@TLSGD(%rip), %rax # R_X86_64_TLSGD
14 leaq foo@TPOFF(%rax), %rax # R_X86_64_TPOFF32
15 leaq foo@TLSLD(%rip), %rdi # R_X86_64_TLSLD
16 leaq foo@dtpoff(%rax), %rcx # R_X86_64_DTPOFF32
17 pushq $bar
18 movq foo(%rip), %rdx
19 leaq foo-bar(%r14),%r14
20 addq $bar,%rax # R_X86_64_32S
23 // CHECK: # Section 0x00000001
24 // CHECK: (('sh_name', 0x00000006) # '.text'
26 // CHECK: # Relocation 0x00000000
27 // CHECK-NEXT: (('r_offset', 0x00000001)
28 // CHECK-NEXT: ('r_sym', 0x00000002)
29 // CHECK-NEXT: ('r_type', 0x0000000a)
30 // CHECK-NEXT: ('r_addend',
32 // CHECK: # Relocation 0x00000001
33 // CHECK-NEXT: (('r_offset', 0x00000008)
34 // CHECK-NEXT: ('r_sym', 0x00000002)
35 // CHECK-NEXT: ('r_type', 0x0000000b)
36 // CHECK-NEXT: ('r_addend',
38 // CHECK: # Relocation 0x00000002
39 // CHECK-NEXT: (('r_offset', 0x00000013)
40 // CHECK-NEXT: ('r_sym', 0x00000002)
41 // CHECK-NEXT: ('r_type', 0x0000000b)
42 // CHECK-NEXT: ('r_addend',
44 // CHECK: # Relocation 0x00000003
45 // CHECK-NEXT: (('r_offset', 0x0000001a)
46 // CHECK-NEXT: ('r_sym', 0x00000002)
47 // CHECK-NEXT: ('r_type', 0x0000000b)
48 // CHECK-NEXT: ('r_addend',
50 // CHECK: # Relocation 0x00000004
51 // CHECK-NEXT: (('r_offset', 0x00000022)
52 // CHECK-NEXT: ('r_sym', 0x00000002)
53 // CHECK-NEXT: ('r_type', 0x0000000b)
54 // CHECK-NEXT: ('r_addend',
56 // CHECK: # Relocation 0x00000005
57 // CHECK-NEXT: (('r_offset', 0x00000026)
58 // CHECK-NEXT: ('r_sym', 0x00000002)
59 // CHECK-NEXT: ('r_type', 0x0000000a)
60 // CHECK-NEXT: ('r_addend',
62 // CHECK: # Relocation 0x00000006
63 // CHECK-NEXT: (('r_offset', 0x0000002d)
64 // CHECK-NEXT: ('r_sym', 0x00000006)
65 // CHECK-NEXT: ('r_type', 0x00000016)
66 // CHECK-NEXT: ('r_addend', 0xfffffffc)
68 // CHECK: # Relocation 0x00000007
69 // CHECK-NEXT: (('r_offset', 0x00000034)
70 // CHECK-NEXT: ('r_sym', 0x00000006)
71 // CHECK-NEXT: ('r_type', 0x00000013)
72 // CHECK-NEXT: ('r_addend', 0xfffffffc)
74 // CHECK: # Relocation 0x00000008
75 // CHECK-NEXT: (('r_offset', 0x0000003b)
76 // CHECK-NEXT: ('r_sym', 0x00000006)
77 // CHECK-NEXT: ('r_type', 0x00000017)
78 // CHECK-NEXT: ('r_addend', 0x00000000)
80 // CHECK: # Relocation 0x00000009
81 // CHECK-NEXT: (('r_offset', 0x00000042)
82 // CHECK-NEXT: ('r_sym', 0x00000006)
83 // CHECK-NEXT: ('r_type', 0x00000014)
84 // CHECK-NEXT: ('r_addend', 0xfffffffc)
86 // CHECK: # Relocation 0x0000000a
87 // CHECK-NEXT: (('r_offset', 0x00000049)
88 // CHECK-NEXT: ('r_sym', 0x00000006)
89 // CHECK-NEXT: ('r_type', 0x00000015)
90 // CHECK-NEXT: ('r_addend', 0x00000000)
92 // CHECK: # Relocation 0x0000000b
93 // CHECK-NEXT: (('r_offset', 0x0000004e)
94 // CHECK-NEXT: ('r_sym', 0x00000002)
95 // CHECK-NEXT: ('r_type', 0x0000000e)
96 // CHECK-NEXT: ('r_addend', 0x00000000)
98 // CHECK: # Relocation 0x0000000c
99 // CHECK-NEXT: (('r_offset', 0x00000052)
100 // CHECK-NEXT: ('r_sym', 0x00000006)
101 // CHECK-NEXT: ('r_type', 0x00000002)
102 // CHECK-NEXT: ('r_addend', 0xfffffffc)
104 // CHECK: # Relocation 0x0000000d
105 // CHECK-NEXT: (('r_offset', 0x00000059)
106 // CHECK-NEXT: ('r_sym', 0x00000006)
107 // CHECK-NEXT: ('r_type', 0x00000002)
108 // CHECK-NEXT: ('r_addend', 0x00000059)
110 // CHECK: # Relocation 0x0000000e
111 // CHECK-NEXT: (('r_offset', 0x00000060)
112 // CHECK-NEXT: ('r_sym', 0x00000002)
113 // CHECK-NEXT: ('r_type', 0x0000000b)
114 // CHECK-NEXT: ('r_addend', 0x00000000)
116 // CHECK: # Symbol 0x00000002
117 // CHECK: (('st_name', 0x00000000) # ''
118 // CHECK: ('st_bind', 0x00000000)
119 // CHECK: ('st_type', 0x00000003)
120 // CHECK: ('st_other', 0x00000000)
121 // CHECK: ('st_shndx', 0x00000001)