• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=arm | FileCheck %s
2
3define i64 @f1() {
4; CHECK: f1:
5entry:
6        ret i64 0
7}
8
9define i64 @f2() {
10; CHECK: f2:
11entry:
12        ret i64 1
13}
14
15define i64 @f3() {
16; CHECK: f3:
17; CHECK: mvn r0, #-2147483648
18entry:
19        ret i64 2147483647
20}
21
22define i64 @f4() {
23; CHECK: f4:
24; CHECK: mov r0, #-2147483648
25entry:
26        ret i64 2147483648
27}
28
29define i64 @f5() {
30; CHECK: f5:
31; CHECK: mvn r0, #0
32; CHECK: mvn r1, #-2147483648
33entry:
34        ret i64 9223372036854775807
35}
36
37define i64 @f6(i64 %x, i64 %y) {
38; CHECK: f6:
39; CHECK: adds
40; CHECK: adc
41entry:
42        %tmp1 = add i64 %y, 1           ; <i64> [#uses=1]
43        ret i64 %tmp1
44}
45
46define void @f7() {
47; CHECK: f7:
48entry:
49        %tmp = call i64 @f8( )          ; <i64> [#uses=0]
50        ret void
51}
52
53declare i64 @f8()
54
55define i64 @f9(i64 %a, i64 %b) {
56; CHECK: f9:
57; CHECK: subs r
58; CHECK: sbc
59entry:
60        %tmp = sub i64 %a, %b           ; <i64> [#uses=1]
61        ret i64 %tmp
62}
63
64define i64 @f(i32 %a, i32 %b) {
65; CHECK: f:
66; CHECK: smull
67entry:
68        %tmp = sext i32 %a to i64               ; <i64> [#uses=1]
69        %tmp1 = sext i32 %b to i64              ; <i64> [#uses=1]
70        %tmp2 = mul i64 %tmp1, %tmp             ; <i64> [#uses=1]
71        ret i64 %tmp2
72}
73
74define i64 @g(i32 %a, i32 %b) {
75; CHECK: g:
76; CHECK: umull
77entry:
78        %tmp = zext i32 %a to i64               ; <i64> [#uses=1]
79        %tmp1 = zext i32 %b to i64              ; <i64> [#uses=1]
80        %tmp2 = mul i64 %tmp1, %tmp             ; <i64> [#uses=1]
81        ret i64 %tmp2
82}
83
84define i64 @f10() {
85; CHECK: f10:
86entry:
87        %a = alloca i64, align 8                ; <i64*> [#uses=1]
88        %retval = load i64* %a          ; <i64> [#uses=1]
89        ret i64 %retval
90}
91