Tests that now pass.
[oota-llvm.git] / test / MC / ELF / merge.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 PIC relocations with local symbols in a mergeable section are done
4 // with a reference to the symbol. Not sure if this is a linker limitation,
5 // but this matches the behavior of gas.
6
7 // Non-PIC relocations with 0 offset don't use the symbol.
8
9
10         movsd   .Lfoo(%rip), %xmm1
11         movl    $.Lfoo, %edi
12         movl    $.Lfoo+2, %edi
13
14         .section        .sec1,"aM",@progbits,16
15 .Lfoo:
16
17 // Section 4 is "sec1"
18 // CHECK: # Section 4
19 // CHECK-NEXT:  (('sh_name', 18) # '.sec1'
20
21 // Symbol number 1 is .Lfoo
22 // CHECK:      # Symbol 1
23 // CHECK-NEXT: (('st_name', 1) # '.Lfoo'
24
25 // Symbol number 5 is section 4
26 // CHECK:        # Symbol 5
27 // CHECK-NEXT:    (('st_name', 0) # ''
28 // CHECK-NEXT:     ('st_bind', 0)
29 // CHECK-NEXT:     ('st_type', 3)
30 // CHECK-NEXT:     ('st_other', 0)
31 // CHECK-NEXT:     ('st_shndx', 4)
32
33 // Relocation 0 refers to symbol 1
34 // CHECK:       ('_relocations', [
35 // CHECK-NEXT:   # Relocation 0
36 // CHECK-NEXT:   (('r_offset',
37 // CHECK-NEXT:    ('r_sym', 1)
38 // CHECK-NEXT:    ('r_type', 2
39 // CHECK-NEXT:    ('r_addend',
40 // CHECK-NEXT:   ),
41
42 // Relocation 1 refers to symbol 5
43 // CHECK-NEXT:  # Relocation 1
44 // CHECK-NEXT: (('r_offset',
45 // CHECK-NEXT:  ('r_sym', 5)
46 // CHECK-NEXT:  ('r_type', 10)
47 // CHECK-NEXT:  ('r_addend',
48 // CHECK-NEXT: ),
49
50 // Relocation 2 refers to symbol 1
51 // CHECK-NEXT:   # Relocation 2
52 // CHECK-NEXT:   (('r_offset',
53 // CHECK-NEXT:    ('r_sym', 1)
54 // CHECK-NEXT:    ('r_type', 10
55 // CHECK-NEXT:    ('r_addend',
56 // CHECK-NEXT:   ),
57 // CHECK-NEXT:  ])