1 ; RUN: llc -O2 -mtriple armv7a < %s | FileCheck --check-prefix=ARM %s
3 ; RUN: llc -O2 -mtriple thumbv6m < %s | FileCheck --check-prefix=THUMB1 %s
4 ; RUN: llc -O2 -mtriple thumbv8m.base < %s | FileCheck --check-prefix=THUMB1 %s
6 ; RUN: llc -O2 -mtriple thumbv7a < %s | FileCheck --check-prefix=THUMB %s
7 ; RUN: llc -O2 -mtriple thumbv8m.main < %s | FileCheck --check-prefix=THUMB %s
9 define void @fn1(i32 %a, i32 %b, i32 %c) local_unnamed_addr #0 {
13 ; ARM: adds r0, r1, r0
14 ; ARM: movw r1, #65535
23 ; THUMB1: subs r2, r3, r2
26 ; THUMB1: adds r0, r1, r0
28 ; THUMB1: lsls r0, r3, #16
33 ; THUMB: rsb.w r2, r2, #1
34 ; THUMB: adds r0, r0, r1
36 ; THUMB: adc r0, r2, #0
37 ; THUMB: lsls r0, r0, #16
44 %cmp = icmp ult i32 %add, %b
45 %conv = zext i1 %cmp to i32
47 %add1 = add i32 %sub, %conv
48 %conv2 = trunc i32 %add1 to i16
49 %tobool = icmp eq i16 %conv2, 0
50 br i1 %tobool, label %if.end, label %for.cond.preheader
52 for.cond.preheader: ; preds = %entry
55 for.cond: ; preds = %for.cond.preheader, %for.cond
58 if.end: ; preds = %entry