1; RUN: llc -mtriple=arm-eabi        %s -o - | FileCheck %s
2; RUN: llc -mtriple=thumbv7-windows %s -o - | FileCheck %s -check-prefix=CHECK-WIN
3
4; The Windows runtime doesn't have these.
5; CHECK-WIN-NOT: __ashldi3
6; CHECK-WIN-NOT: __ashrdi3
7; CHECK-WIN-NOT: __lshrdi3
8
9define i64 @f0(i64 %val, i64 %amt) minsize optsize {
10; CHECK-LABEL:   f0:
11; CHECK:         bl  __aeabi_llsl
12  %res = shl i64 %val, %amt
13  ret i64 %res
14}
15
16define i32 @f1(i64 %x, i64 %y) minsize optsize {
17; CHECK-LABEL:   f1:
18; CHECK:         bl  __aeabi_llsl
19	%a = shl i64 %x, %y
20	%b = trunc i64 %a to i32
21	ret i32 %b
22}
23
24define i32 @f2(i64 %x, i64 %y) minsize optsize {
25; CHECK-LABEL:   f2:
26; CHECK:         bl  __aeabi_lasr
27	%a = ashr i64 %x, %y
28	%b = trunc i64 %a to i32
29	ret i32 %b
30}
31
32define i32 @f3(i64 %x, i64 %y) minsize optsize {
33; CHECK-LABEL:   f3:
34; CHECK:         bl  __aeabi_llsr
35	%a = lshr i64 %x, %y
36	%b = trunc i64 %a to i32
37	ret i32 %b
38}
39