1; RUN: llc < %s -march=arm -mattr=+v4t | FileCheck %s
2
3;; Integer absolute value, should produce something as good as: ARM:
4;;   movs r0, r0
5;;   rsbmi r0, r0, #0
6;;   bx lr
7
8define i32 @test(i32 %a) {
9        %tmp1neg = sub i32 0, %a
10        %b = icmp sgt i32 %a, -1
11        %abs = select i1 %b, i32 %a, i32 %tmp1neg
12        ret i32 %abs
13; CHECK:  movs r0, r0
14; CHECK:  rsbmi r0, r0, #0
15; CHECK:  bx lr
16}
17