blob: aaefc0a1486392582652b1c410a1a4fe8dbf063f [file] [log] [blame]
James Molloy6967e5e2015-08-03 09:24:48 +00001; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s
2; RUN: llc -mtriple=thumbv8 %s -o - | FileCheck %s
Bill Wendling9449b8b2011-10-11 00:26:57 +00003; PR11107
4
Bill Wendling288ff0e2011-10-11 04:43:15 +00005define i32 @test(i32 %a, i32 %b) {
Bill Wendling9449b8b2011-10-11 00:26:57 +00006entry:
Bill Wendling288ff0e2011-10-11 04:43:15 +00007 %cmp1 = icmp slt i32 %a, 0
8 %sub1 = sub nsw i32 0, %a
9 %abs1 = select i1 %cmp1, i32 %sub1, i32 %a
10 %cmp2 = icmp slt i32 %b, 0
11 %sub2 = sub nsw i32 0, %b
12 %abs2 = select i1 %cmp2, i32 %sub2, i32 %b
13 %add = add nsw i32 %abs1, %abs2
14 ret i32 %add
Bill Wendling9449b8b2011-10-11 00:26:57 +000015}
Saleem Abdulrasool27c78bf2014-08-11 20:13:25 +000016
James Molloy6967e5e2015-08-03 09:24:48 +000017; CHECK: cmp
18; CHECK-NEXT: it mi
19; We shouldn't need to check for the extra 's' here; tRSB should be printed as
20; "rsb" inside an IT block, not "rsbs".
21; CHECK-NEXT: rsb{{s?}}mi
22; CHECK-NEXT: cmp
23; CHECK-NEXT: it mi
24; CHECK-NEXT: rsb{{s?}}mi
Saleem Abdulrasool27c78bf2014-08-11 20:13:25 +000025
Saleem Abdulrasool27c78bf2014-08-11 20:13:25 +000026