File: inline-asm-register-names.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: 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 (59 lines) | stat: -rw-r--r-- 1,964 bytes parent folder | download | duplicates (24)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
; RUN: llc < %s | FileCheck %s
target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
target triple = "msp430-generic-generic"

; Test that correct register names are accepted *inside* inline asm listings.
; Tested with PUSH instruction since it does not support memory operands.

define void @accepted_rN() nounwind {
; CHECK-LABEL: accepted_rN
  call void asm sideeffect "push r0", ""() nounwind
; CHECK: push r0
  call void asm sideeffect "push r1", ""() nounwind
; CHECK: push r1
  call void asm sideeffect "push r2", ""() nounwind
; CHECK: push r2
  call void asm sideeffect "push r3", ""() nounwind
; CHECK: push r3
  call void asm sideeffect "push r4", ""() nounwind
; CHECK: push r4
  call void asm sideeffect "push r5", ""() nounwind
; CHECK: push r5
  call void asm sideeffect "push r6", ""() nounwind
; CHECK: push r6
  call void asm sideeffect "push r7", ""() nounwind
; CHECK: push r7
  call void asm sideeffect "push r8", ""() nounwind
; CHECK: push r8
  call void asm sideeffect "push r9", ""() nounwind
; CHECK: push r9
  call void asm sideeffect "push r10", ""() nounwind
; CHECK: push r10
  call void asm sideeffect "push r11", ""() nounwind
; CHECK: push r11
  call void asm sideeffect "push r12", ""() nounwind
; CHECK: push r12
  call void asm sideeffect "push r13", ""() nounwind
; CHECK: push r13
  call void asm sideeffect "push r14", ""() nounwind
; CHECK: push r14
  call void asm sideeffect "push r15", ""() nounwind
; CHECK: push r15
  ret void
}

define void @accepted_reg_aliases() nounwind {
; CHECK-LABEL: accepted_reg_aliases
; Ensure register aliases are renamed as expected
call void asm sideeffect "push pc", ""() nounwind
; CHECK: push r0
call void asm sideeffect "push sp", ""() nounwind
; CHECK: push r1
call void asm sideeffect "push sr", ""() nounwind
; CHECK: push r2
call void asm sideeffect "push cg", ""() nounwind
; CHECK: push r3
call void asm sideeffect "push fp", ""() nounwind
; CHECK: push r4
        ret void
}