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