// RUN: llvm-mc -filetype=obj -relax-relocations -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -r -t | FileCheck %s

// Test that this produces the correct relaxed relocations.

        movl	foo@GOT, %eax
        movl	foo@GOTPCREL(%rip), %eax
        movq  foo@GOTPCREL(%rip), %rax

// CHECK:      Relocations [
// CHECK:        Section ({{[^ ]+}}) .rela.text {
// CHECK-NEXT:       0x{{[^ ]+}} R_X86_64_GOT32 foo 0x{{[^ ]+}}
// CHECK-NEXT:       0x{{[^ ]+}} R_X86_64_GOTPCRELX foo 0x{{[^ ]+}}
// CHECK-NEXT:       0x{{[^ ]+}} R_X86_64_REX_GOTPCRELX foo 0x{{[^ ]+}}
// CHECK-NEXT:   }
// CHECK-NEXT: ]

// CHECK:        Symbols [
// CHECK-NOT:          _GLOBAL_OFFSET_TABLE_

// RUN: llvm-mc -filetype=obj -relax-relocations -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -r -t | FileCheck %s

// Test that this produces the correct relaxed relocations.

        movl	foo@GOT, %eax
        movl	foo@GOTPCREL(%rip), %eax
        movq  foo@GOTPCREL(%rip), %rax
        .long zed@GOTPCREL

// CHECK:      Relocations [
// CHECK:        Section ({{[^ ]+}}) .rela.text {
// CHECK-NEXT:       0x{{[^ ]+}} R_X86_64_GOT32 foo 0x{{[^ ]+}}
// CHECK-NEXT:       0x{{[^ ]+}} R_X86_64_GOTPCRELX foo 0x{{[^ ]+}}
// CHECK-NEXT:       0x{{[^ ]+}} R_X86_64_REX_GOTPCRELX foo 0x{{[^ ]+}}
// CHECK-NEXT:       0x{{[^ ]+}} R_X86_64_GOTPCREL zed 0x{{[^ ]+}}
// CHECK-NEXT:   }
// CHECK-NEXT: ]

// CHECK:        Symbols [
// CHECK-NOT:          _GLOBAL_OFFSET_TABLE_

Make the relaxation test more interesting.
[MC/ELF] Make the relaxation test more interesting.

Add a case where we can't relax.


git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@267308 91177308-0d34-0410-b5e6-96231b3b80d8
