• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o - | llvm-readobj -r - | FileCheck %s
2
3// these should produce R_X86_64_REX_GOTPCRELX
4
5        movq mov@GOTPCREL(%rip), %rax
6        test %rax, test@GOTPCREL(%rip)
7        adc adc@GOTPCREL(%rip), %rax
8        add add@GOTPCREL(%rip), %rax
9        and and@GOTPCREL(%rip), %rax
10        cmp cmp@GOTPCREL(%rip), %rax
11        or  or@GOTPCREL(%rip), %rax
12        sbb sbb@GOTPCREL(%rip), %rax
13        sub sub@GOTPCREL(%rip), %rax
14        xor xor@GOTPCREL(%rip), %rax
15
16.section .norelax,"ax"
17## This expression loads the GOT entry with an offset.
18## Don't emit R_X86_64_REX_GOTPCRELX.
19        movq mov@GOTPCREL+1(%rip), %rax
20
21// CHECK:      Relocations [
22// CHECK-NEXT:   Section ({{.*}}) .rela.text {
23// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX mov
24// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX test
25// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX adc
26// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX add
27// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX and
28// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX cmp
29// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX or
30// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX sbb
31// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX sub
32// CHECK-NEXT:     R_X86_64_REX_GOTPCRELX xor
33// CHECK-NEXT:   }
34// CHECK-NEXT:   Section ({{.*}}) .rela.norelax {
35// CHECK-NEXT:     R_X86_64_GOTPCREL mov
36// CHECK-NEXT:   }
37