actually, move the elf tests into the existing elf dir.
[oota-llvm.git] / test / MC / ELF / relax.s
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump  --dump-section-data | FileCheck  %s
2
3 // Test that we do a relaxation for foo but not for bar. Relaxing foo is
4 // probably not necessary, but matches what gnu as does.
5
6 // Also test that the relaxation done for foo uses the symbol, not section and
7 // offset.
8
9 bar:
10 .globl foo
11 foo:
12         jmp bar
13         jmp foo
14
15 // CHECK: ('sh_name', 1) # '.text'
16 // CHECK-NEXT: ('sh_type', 1)
17 // CHECK-NEXT: ('sh_flags', 6)
18 // CHECK-NEXT: ('sh_addr', 0)
19 // CHECK-NEXT: ('sh_offset', 64)
20 // CHECK-NEXT: ('sh_size', 7)
21 // CHECK-NEXT: ('sh_link', 0)
22 // CHECK-NEXT: ('sh_info', 0)
23 // CHECK-NEXT: ('sh_addralign', 4)
24 // CHECK-NEXT: ('sh_entsize', 0)
25 // CHECK-NEXT: ('_section_data', 'ebfee900 000000')
26
27 // CHECK:       # Symbol 5
28 // CHECK-NEXT: (('st_name', 5) # 'foo'
29
30 // CHECK: .rela.text
31 // CHECK: ('_relocations', [
32 // CHECK-NEXT: Relocation 0
33 // CHECK-NEXT:  (('r_offset', 3)
34 // CHECK-NEXT:   ('r_sym', 5)
35 // CHECK-NEXT:   ('r_type', 2)
36 // CHECK-NEXT:   ('r_addend', -4)
37 // CHECK-NEXT:  ),
38 // CHECK-NEXT: ])