Moritz Roth | 8f37656 | 2014-08-15 17:00:30 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=thumbv6m-eabi -verify-machineinstrs %s -o - | FileCheck %s |
| 2 | target 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" |
| 3 | target triple = "thumbv6m-none--eabi" |
| 4 | |
| 5 | %struct.S = type { i32, i32 } |
| 6 | |
| 7 | @s = common global %struct.S zeroinitializer, align 4 |
| 8 | |
| 9 | define i32 @f() { |
| 10 | entry: |
| 11 | ; CHECK-LABEL: f: |
| 12 | ; CHECK: ldm r[[BASE:[0-9]]], |
| 13 | ; CHECK-NEXT-NOT: subs r[[BASE]] |
David Blaikie | f72d05b | 2015-03-13 18:20:45 +0000 | [diff] [blame] | 14 | %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 Roth | 8f37656 | 2014-08-15 17:00:30 +0000 | [diff] [blame] | 16 | %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 | } |