call.ll
2.54 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
; RUN: llc < %s -march=avr | FileCheck %s
declare void @ret_void_args_i8(i8 %a)
declare void @ret_void_args_i8_i32(i8 %a, i32 %b)
declare void @ret_void_args_i8_i8_i8_i8(i8 %a, i8 %b, i8 %c, i8 %d)
declare void @ret_void_args_i32_i16_i8(i32 %a, i16 %b, i8 %c)
declare void @ret_void_args_i64(i64 %a)
declare void @ret_void_args_i64_i64(i64 %a, i64 %b)
declare void @ret_void_args_i64_i64_i16(i64 %a, i64 %b, i16 %c)
; CHECK-LABEL: call_void_args_i8
define void @call_void_args_i8() {
; CHECK: ldi r24, 64
call void @ret_void_args_i8 (i8 64)
ret void
}
; CHECK-LABEL: call_void_args_i8_i32
define void @call_void_args_i8_i32() {
; CHECK: ldi r20, 4
; CHECK-NEXT: ldi r21, 3
; CHECK-NEXT: ldi r22, 2
; CHECK-NEXT: ldi r23, 1
; CHECK-NEXT: ldi r24, 64
call void @ret_void_args_i8_i32 (i8 64, i32 16909060)
ret void
}
; CHECK-LABEL: call_void_args_i8_i8_i8_i8
define void @call_void_args_i8_i8_i8_i8() {
; CHECK: ldi r24, 1
; CHECK-NEXT: ldi r22, 2
; CHECK-NEXT: ldi r20, 3
; CHECK-NEXT: ldi r18, 4
call void @ret_void_args_i8_i8_i8_i8(i8 1, i8 2, i8 3, i8 4)
ret void
}
; CHECK-LABEL: call_void_args_i32_i16_i8
define void @call_void_args_i32_i16_i8() {
; CHECK: ldi r22, 4
; CHECK-NEXT: ldi r23, 3
; CHECK-NEXT: ldi r24, 2
; CHECK-NEXT: ldi r25, 1
; CHECK-NEXT: ldi r20, 1
; CHECK-NEXT: ldi r21, 4
; CHECK-NEXT: ldi r18, 64
call void @ret_void_args_i32_i16_i8(i32 16909060, i16 1025, i8 64)
ret void
}
; CHECK-LABEL: call_void_args_i64
define void @call_void_args_i64() {
; CHECK: ldi r18, 8
; CHECK-NEXT: ldi r19, 7
; CHECK-NEXT: ldi r20, 6
; CHECK-NEXT: ldi r21, 5
; CHECK-NEXT: ldi r22, 4
; CHECK-NEXT: ldi r23, 3
; CHECK-NEXT: ldi r24, 2
; CHECK-NEXT: ldi r25, 1
call void @ret_void_args_i64(i64 72623859790382856)
ret void
}
; CHECK-LABEL: call_void_args_i64_i64
define void @call_void_args_i64_i64() {
; CHECK: ldi r18, 8
; CHECK-NEXT: ldi r19, 7
; CHECK-NEXT: ldi r20, 6
; CHECK-NEXT: ldi r21, 5
; CHECK-NEXT: ldi r22, 4
; CHECK-NEXT: ldi r23, 3
; CHECK-NEXT: ldi r24, 2
; CHECK-NEXT: ldi r25, 1
; the second arg is in r10:r17, but unordered
; CHECK: r17,
; CHECK: r10,
call void @ret_void_args_i64_i64(i64 72623859790382856, i64 651345242494996224)
ret void
}
; CHECK-LABEL: call_void_args_i64_i64_i16
define void @call_void_args_i64_i64_i16() {
; CHECK: r8,
; CHECK: r9,
call void @ret_void_args_i64_i64_i16(i64 72623859790382856, i64 651345242494996224, i16 5655)
ret void
}