File: ppc64-saveres.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 (31 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download | duplicates (23)
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
# REQUIRES: ppc
## Test that some save and restore functions can be synthesized.
## The code sequences are tested by ppc64-restgpr*.s and ppc64-savegpr*.s

# RUN: llvm-mc -filetype=obj -triple=ppc64le %s -o %t.o
# RUN: ld.lld -shared %t.o -o %t.so
# RUN: llvm-readelf -s %t.so | FileCheck --check-prefix=NM %s
# RUN: llvm-objdump -d %t.so | FileCheck %s

## The synthesized symbols are not exported.
# NM:      FUNC LOCAL HIDDEN {{.*}} _restgpr0_30
# NM-NEXT: FUNC LOCAL HIDDEN {{.*}} _restgpr1_30
# NM-NEXT: FUNC LOCAL HIDDEN {{.*}} _savegpr0_30
# NM-NEXT: FUNC LOCAL HIDDEN {{.*}} _savegpr1_30

# CHECK: 00000000000[[#%x,RESTGPR0:]] <_restgpr0_30>:
# CHECK: 00000000000[[#%x,RESTGPR1:]] <_restgpr1_30>:
# CHECK: 00000000000[[#%x,SAVEGPR0:]] <_savegpr0_30>:
# CHECK: 00000000000[[#%x,SAVEGPR1:]] <_savegpr1_30>:
# CHECK-LABEL: <_start>:
# CHECK-NEXT:    bl 0x[[#RESTGPR0]]
# CHECK-NEXT:    bl 0x[[#RESTGPR1]]
# CHECK-NEXT:    bl 0x[[#SAVEGPR0]]
# CHECK-NEXT:    bl 0x[[#SAVEGPR1]]

.globl _start
_start:
  bl _restgpr0_30
  bl _restgpr1_30
  bl _savegpr0_30
  bl _savegpr1_30