xref: /minix3/external/bsd/llvm/dist/llvm/test/CodeGen/MSP430/cc_args.ll (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc; RUN: llc < %s | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuctarget datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16-a0:16:16"
4*f4a2713aSLionel Sambuctarget triple = "msp430---elf"
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambucdefine void @test() #0 {
7*f4a2713aSLionel Sambucentry:
8*f4a2713aSLionel Sambuc; CHECK: test:
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc; CHECK: mov.w #1, r15
11*f4a2713aSLionel Sambuc; CHECK: call #f_i16
12*f4a2713aSLionel Sambuc  call void @f_i16(i16 1)
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc; CHECK: mov.w #772, r14
15*f4a2713aSLionel Sambuc; CHECK: mov.w #258, r15
16*f4a2713aSLionel Sambuc; CHECK: call #f_i32
17*f4a2713aSLionel Sambuc  call void @f_i32(i32 16909060)
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuc; CHECK: mov.w #1800, r12
20*f4a2713aSLionel Sambuc; CHECK: mov.w #1286, r13
21*f4a2713aSLionel Sambuc; CHECK: mov.w #772, r14
22*f4a2713aSLionel Sambuc; CHECK: mov.w #258, r15
23*f4a2713aSLionel Sambuc; CHECK: call #f_i64
24*f4a2713aSLionel Sambuc  call void @f_i64(i64 72623859790382856)
25*f4a2713aSLionel Sambuc
26*f4a2713aSLionel Sambuc; CHECK: mov.w #772, r14
27*f4a2713aSLionel Sambuc; CHECK: mov.w #258, r15
28*f4a2713aSLionel Sambuc; CHECK: mov.w #1800, r12
29*f4a2713aSLionel Sambuc; CHECK: mov.w #1286, r13
30*f4a2713aSLionel Sambuc; CHECK: call #f_i32_i32
31*f4a2713aSLionel Sambuc  call void @f_i32_i32(i32 16909060, i32 84281096)
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambuc; CHECK: mov.w #1, r15
34*f4a2713aSLionel Sambuc; CHECK: mov.w #772, r13
35*f4a2713aSLionel Sambuc; CHECK: mov.w #258, r14
36*f4a2713aSLionel Sambuc; CHECK: mov.w #2, r12
37*f4a2713aSLionel Sambuc; CHECK: call #f_i16_i32_i16
38*f4a2713aSLionel Sambuc  call void @f_i16_i32_i16(i16 1, i32 16909060, i16 2)
39*f4a2713aSLionel Sambuc
40*f4a2713aSLionel Sambuc; CHECK: mov.w #2, 8(r1)
41*f4a2713aSLionel Sambuc; CHECK: mov.w #258, 6(r1)
42*f4a2713aSLionel Sambuc; CHECK: mov.w #772, 4(r1)
43*f4a2713aSLionel Sambuc; CHECK: mov.w #1286, 2(r1)
44*f4a2713aSLionel Sambuc; CHECK: mov.w #1800, 0(r1)
45*f4a2713aSLionel Sambuc; CHECK: mov.w #1, r15
46*f4a2713aSLionel Sambuc; CHECK: call #f_i16_i64_i16
47*f4a2713aSLionel Sambuc  call void @f_i16_i64_i16(i16 1, i64 72623859790382856, i16 2)
48*f4a2713aSLionel Sambuc
49*f4a2713aSLionel Sambuc  ret void
50*f4a2713aSLionel Sambuc}
51*f4a2713aSLionel Sambuc
52*f4a2713aSLionel Sambuc@g_i16 = common global i16 0, align 2
53*f4a2713aSLionel Sambuc@g_i32 = common global i32 0, align 2
54*f4a2713aSLionel Sambuc@g_i64 = common global i64 0, align 2
55*f4a2713aSLionel Sambuc
56*f4a2713aSLionel Sambucdefine void @f_i16(i16 %a) #0 {
57*f4a2713aSLionel Sambuc; CHECK: f_i16:
58*f4a2713aSLionel Sambuc; CHECK: mov.w r15, &g_i16
59*f4a2713aSLionel Sambuc  store volatile i16 %a, i16* @g_i16, align 2
60*f4a2713aSLionel Sambuc  ret void
61*f4a2713aSLionel Sambuc}
62*f4a2713aSLionel Sambuc
63*f4a2713aSLionel Sambucdefine void @f_i32(i32 %a) #0 {
64*f4a2713aSLionel Sambuc; CHECK: f_i32:
65*f4a2713aSLionel Sambuc; CHECK: mov.w r15, &g_i32+2
66*f4a2713aSLionel Sambuc; CHECK: mov.w r14, &g_i32
67*f4a2713aSLionel Sambuc  store volatile i32 %a, i32* @g_i32, align 2
68*f4a2713aSLionel Sambuc  ret void
69*f4a2713aSLionel Sambuc}
70*f4a2713aSLionel Sambuc
71*f4a2713aSLionel Sambucdefine void @f_i64(i64 %a) #0 {
72*f4a2713aSLionel Sambuc; CHECK: f_i64:
73*f4a2713aSLionel Sambuc; CHECK: mov.w r15, &g_i64+6
74*f4a2713aSLionel Sambuc; CHECK: mov.w r14, &g_i64+4
75*f4a2713aSLionel Sambuc; CHECK: mov.w r13, &g_i64+2
76*f4a2713aSLionel Sambuc; CHECK: mov.w r12, &g_i64
77*f4a2713aSLionel Sambuc  store volatile i64 %a, i64* @g_i64, align 2
78*f4a2713aSLionel Sambuc  ret void
79*f4a2713aSLionel Sambuc}
80*f4a2713aSLionel Sambuc
81*f4a2713aSLionel Sambucdefine void @f_i32_i32(i32 %a, i32 %b) #0 {
82*f4a2713aSLionel Sambuc; CHECK: f_i32_i32:
83*f4a2713aSLionel Sambuc; CHECK: mov.w r15, &g_i32+2
84*f4a2713aSLionel Sambuc; CHECK: mov.w r14, &g_i32
85*f4a2713aSLionel Sambuc  store volatile i32 %a, i32* @g_i32, align 2
86*f4a2713aSLionel Sambuc; CHECK: mov.w r13, &g_i32+2
87*f4a2713aSLionel Sambuc; CHECK: mov.w r12, &g_i32
88*f4a2713aSLionel Sambuc  store volatile i32 %b, i32* @g_i32, align 2
89*f4a2713aSLionel Sambuc  ret void
90*f4a2713aSLionel Sambuc}
91*f4a2713aSLionel Sambuc
92*f4a2713aSLionel Sambucdefine void @f_i16_i32_i16(i16 %a, i32 %b, i16 %c) #0 {
93*f4a2713aSLionel Sambuc; CHECK: f_i16_i32_i16:
94*f4a2713aSLionel Sambuc; CHECK: mov.w r15, &g_i16
95*f4a2713aSLionel Sambuc  store volatile i16 %a, i16* @g_i16, align 2
96*f4a2713aSLionel Sambuc; CHECK: mov.w r14, &g_i32+2
97*f4a2713aSLionel Sambuc; CHECK: mov.w r13, &g_i32
98*f4a2713aSLionel Sambuc  store volatile i32 %b, i32* @g_i32, align 2
99*f4a2713aSLionel Sambuc; CHECK: mov.w r12, &g_i16
100*f4a2713aSLionel Sambuc  store volatile i16 %c, i16* @g_i16, align 2
101*f4a2713aSLionel Sambuc  ret void
102*f4a2713aSLionel Sambuc}
103*f4a2713aSLionel Sambuc
104*f4a2713aSLionel Sambucdefine void @f_i16_i64_i16(i16 %a, i64 %b, i16 %c) #0 {
105*f4a2713aSLionel Sambuc; CHECK: f_i16_i64_i16:
106*f4a2713aSLionel Sambuc; CHECK: mov.w r15, &g_i16
107*f4a2713aSLionel Sambuc  store volatile i16 %a, i16* @g_i16, align 2
108*f4a2713aSLionel Sambuc;CHECK: mov.w 10(r4), &g_i64+6
109*f4a2713aSLionel Sambuc;CHECK: mov.w 8(r4), &g_i64+4
110*f4a2713aSLionel Sambuc;CHECK: mov.w 6(r4), &g_i64+2
111*f4a2713aSLionel Sambuc;CHECK: mov.w 4(r4), &g_i64
112*f4a2713aSLionel Sambuc  store volatile i64 %b, i64* @g_i64, align 2
113*f4a2713aSLionel Sambuc;CHECK: mov.w 12(r4), &g_i16
114*f4a2713aSLionel Sambuc  store volatile i16 %c, i16* @g_i16, align 2
115*f4a2713aSLionel Sambuc  ret void
116*f4a2713aSLionel Sambuc}
117*f4a2713aSLionel Sambuc
118*f4a2713aSLionel Sambucattributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
119