blob: 707236803fb3126f768df082ad2cc8b7a534503f [file] [log] [blame]
Moritz Roth8f376562014-08-15 17:00:30 +00001; RUN: llc -mtriple=thumbv6m-eabi -verify-machineinstrs %s -o - | FileCheck %s
2target datalayout = "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-v128:64:128-a:0:32-n32-S64"
3target triple = "thumbv6m-none--eabi"
4
5%struct.S = type { i32, i32 }
6
7@s = common global %struct.S zeroinitializer, align 4
8
9define i32 @f() {
10entry:
11; CHECK-LABEL: f:
12; CHECK: ldm r[[BASE:[0-9]]],
Paul Robinson51fa0a82016-02-26 19:40:34 +000013; CHECK-NOT: subs r[[BASE]]
David Blaikief72d05b2015-03-13 18:20:45 +000014 %0 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @s, i32 0, i32 0), align 4
15 %1 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @s, i32 0, i32 1), align 4
Moritz Roth8f376562014-08-15 17:00:30 +000016 %cmp = icmp sgt i32 %0, %1
17 %2 = sub i32 0, %1
18 %cond.p = select i1 %cmp, i32 %1, i32 %2
19 %cond = add i32 %cond.p, %0
20 ret i32 %cond
21}