• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Ensure that the MBlaze save_volatiles calling convention (cc74) is handled
2; correctly correctly by the MBlaze backend.
3;
4; RUN: llc < %s -march=mblaze | FileCheck %s
5
6@.str = private constant [28 x i8] c"The interrupt has gone off\0A\00"
7
8define cc74 void @mysvol() nounwind noinline {
9  ; CHECK:        mysvol:
10  ; CHECK:        swi   r3, r1
11  ; CHECK:        swi   r4, r1
12  ; CHECK:        swi   r5, r1
13  ; CHECK:        swi   r6, r1
14  ; CHECK:        swi   r7, r1
15  ; CHECK:        swi   r8, r1
16  ; CHECK:        swi   r9, r1
17  ; CHECK:        swi   r10, r1
18  ; CHECK:        swi   r11, r1
19  ; CHECK:        swi   r12, r1
20  ; CHECK:        swi   r17, r1
21  ; CHECK:        swi   r18, r1
22  ; CHECK-NOT:    mfs   r11, rmsr
23  entry:
24    %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([28 x i8]* @.str, i32 0, i32 0))
25      ret void
26
27  ; CHECK-NOT:    mts   rmsr, r11
28  ; CHECK:        lwi   r18, r1
29  ; CHECK:        lwi   r17, r1
30  ; CHECK:        lwi   r12, r1
31  ; CHECK:        lwi   r11, r1
32  ; CHECK:        lwi   r10, r1
33  ; CHECK:        lwi   r9, r1
34  ; CHECK:        lwi   r8, r1
35  ; CHECK:        lwi   r7, r1
36  ; CHECK:        lwi   r6, r1
37  ; CHECK:        lwi   r5, r1
38  ; CHECK:        lwi   r4, r1
39  ; CHECK:        lwi   r3, r1
40  ; CHECK:        rtsd  r15, 8
41}
42
43define cc74 void @mysvol2() nounwind noinline {
44  ; CHECK:        mysvol2:
45  ; CHECK-NOT:    swi   r3, r1
46  ; CHECK-NOT:    swi   r4, r1
47  ; CHECK-NOT:    swi   r5, r1
48  ; CHECK-NOT:    swi   r6, r1
49  ; CHECK-NOT:    swi   r7, r1
50  ; CHECK-NOT:    swi   r8, r1
51  ; CHECK-NOT:    swi   r9, r1
52  ; CHECK-NOT:    swi   r10, r1
53  ; CHECK-NOT:    swi   r11, r1
54  ; CHECK-NOT:    swi   r12, r1
55  ; CHECK:        swi   r17, r1
56  ; CHECK:        swi   r18, r1
57  ; CHECK-NOT:    mfs   r11, rmsr
58entry:
59
60  ; CHECK-NOT:    mts   rmsr, r11
61  ; CHECK:        lwi   r18, r1
62  ; CHECK:        lwi   r17, r1
63  ; CHECK-NOT:    lwi   r12, r1
64  ; CHECK-NOT:    lwi   r11, r1
65  ; CHECK-NOT:    lwi   r10, r1
66  ; CHECK-NOT:    lwi   r9, r1
67  ; CHECK-NOT:    lwi   r8, r1
68  ; CHECK-NOT:    lwi   r7, r1
69  ; CHECK-NOT:    lwi   r6, r1
70  ; CHECK-NOT:    lwi   r5, r1
71  ; CHECK-NOT:    lwi   r4, r1
72  ; CHECK-NOT:    lwi   r3, r1
73  ; CHECK:        rtsd  r15, 8
74  ret void
75}
76
77  ; CHECK-NOT:    .globl  _interrupt_handler
78  ; CHECK-NOT:    _interrupt_handler = mysvol
79  ; CHECK-NOT:    _interrupt_handler = mysvol2
80declare i32 @printf(i8*, ...)
81