• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1! RUN: llvm-mc %s -arch=sparcv9 --relocation-model=pic -filetype=obj | llvm-readobj -r | FileCheck %s
2
3
4! CHECK:      Relocations [
5! CHECK-NOT:    0x{{[0-9,A-F]+}} R_SPARC_WPLT30 .text 0xC
6! CHECK:        0x{{[0-9,A-F]+}} R_SPARC_PC22 _GLOBAL_OFFSET_TABLE_ 0x4
7! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_PC10 _GLOBAL_OFFSET_TABLE_ 0x8
8! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_GOT22 AGlobalVar 0x0
9! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_GOT10 AGlobalVar 0x0
10! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_WPLT30 bar 0x0
11! CHECK:      ]
12
13        .text
14        .globl  foo
15        .align  4
16        .type   foo,@function
17foo:
18        .cfi_startproc
19        save %sp, -176, %sp
20        .cfi_def_cfa_register %fp
21        .cfi_window_save
22        .cfi_register 15, 31
23.Ltmp4:
24        call .Ltmp5
25.Ltmp6:
26        sethi %hi(_GLOBAL_OFFSET_TABLE_+(.Ltmp6-.Ltmp4)), %i1
27.Ltmp5:
28        or %i1, %lo(_GLOBAL_OFFSET_TABLE_+(.Ltmp5-.Ltmp4)), %i1
29        add %i1, %o7, %i1
30        sethi %hi(AGlobalVar), %i2
31        add %i2, %lo(AGlobalVar), %i2
32        ldx [%i1+%i2], %i1
33        ldx [%i1], %i1
34        call bar
35        add %i0, %i1, %o0
36        ret
37        restore %g0, %o0, %o0
38.Ltmp7:
39        .size   foo, .Ltmp7-foo
40        .cfi_endproc
41
42        .type   AGlobalVar,@object      ! @AGlobalVar
43        .section        .bss,#alloc,#write
44        .globl  AGlobalVar
45        .align  8
46AGlobalVar:
47        .xword  0                       ! 0x0
48        .size   AGlobalVar, 8
49
50