File: inline-asm-register-names.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (59 lines) | stat: -rw-r--r-- 1,964 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
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
}