[WebAssembly] Use the new offset syntax for memory operands in inline asm.
[oota-llvm.git] / test / CodeGen / Thumb / ldm-merge-struct.ll
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]]
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
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 }