File: loongarch-add-sub.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (36 lines) | stat: -rw-r--r-- 855 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# REQUIRES: loongarch

# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-elf %s -o %t.la64.o

# RUN: ld.lld --section-start=.text=0x1234567890 --section-start=.rodata=0x9876543210 %t.la64.o -o %t.la64
# RUN: llvm-readelf -x .rodata %t.la64 | FileCheck --check-prefix=CHECK %s
# CHECK:      section '.rodata':
# CHECK-NEXT: 0x9876543210 10325476 98badcfe 804602be 79ffffff
# CHECK-NEXT: 0x9876543220 804602be 804680

.text
.global _start
_start:
1:
    break 0

.rodata
2:
    .dword 0xfedcba9876543210

foo:
    .dword 0
    .reloc foo, R_LARCH_ADD64, 1b
    .reloc foo, R_LARCH_SUB64, 2b
bar:
    .word 0
    .reloc bar, R_LARCH_ADD32, 1b
    .reloc bar, R_LARCH_SUB32, 2b
baz:
    .short 0
    .reloc baz, R_LARCH_ADD16, 1b
    .reloc baz, R_LARCH_SUB16, 2b
quux:
    .byte 0
    .reloc quux, R_LARCH_ADD8, 1b
    .reloc quux, R_LARCH_SUB8, 2b