File: mips-64-gprel-so.s

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (23 lines) | stat: -rw-r--r-- 722 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Check setup of GP relative offsets in a function's prologue.

# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -shared -o %t.so
# RUN: llvm-objdump -d -t %t.so | FileCheck %s

# REQUIRES: mips

# CHECK:      Disassembly of section .text:
# CHECK-NEXT: foo:
# CHECK-NEXT:    10000:    3c 1c 00 01    lui     $gp, 1
# CHECK-NEXT:    10004:    03 99 e0 2d    daddu   $gp, $gp, $25
# CHECK-NEXT:    10008:    67 9c 7f f0    daddiu  $gp, $gp, 32752

# CHECK: 0000000000027ff0   .got    00000000 .hidden _gp
# CHECK: 0000000000010000   .text   00000000 foo

  .text
  .global foo
foo:
  lui     $gp,%hi(%neg(%gp_rel(foo)))
  daddu   $gp,$gp,$t9
  daddiu  $gp,$gp,%lo(%neg(%gp_rel(foo)))