[WebAssembly] Don't perform the returned-argument optimization on constants.
[oota-llvm.git] / test / CodeGen / ARM / 2010-05-18-PostIndexBug.ll
1 ; RUN: llc < %s -mtriple=armv7-apple-darwin   | FileCheck %s -check-prefix=ARM
2 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin | FileCheck %s -check-prefix=THUMB
3 ; rdar://7998649
4
5 %struct.foo = type { i64, i64 }
6
7 define zeroext i8 @t(%struct.foo* %this, i1 %tst) noreturn optsize {
8 entry:
9 ; ARM-LABEL:       t:
10 ; ARM-DAG:       mov r[[ADDR:[0-9]+]], #8
11 ; ARM-DAG:       mov [[VAL:r[0-9]+]], #0
12 ; ARM:       str [[VAL]], [r[[ADDR]]], r0
13
14 ; THUMB-LABEL:     t:
15 ; THUMB-DAG:       movs r[[ADDR:[0-9]+]], #8
16 ; THUMB-DAG:       movs [[VAL:r[0-9]+]], #0
17 ; THUMB-NOT: str {{[a-z0-9]+}}, [{{[a-z0-9]+}}], {{[a-z0-9]+}}
18 ; THUMB:     str [[VAL]], [r[[ADDR]]]
19   %0 = getelementptr inbounds %struct.foo, %struct.foo* %this, i32 0, i32 1 ; <i64*> [#uses=1]
20   store i32 0, i32* inttoptr (i32 8 to i32*), align 8
21   br i1 %tst, label %bb.nph96, label %bb3
22
23 bb3:                                              ; preds = %entry
24   %1 = load i64, i64* %0, align 4                      ; <i64> [#uses=0]
25   ret i8 42
26
27 bb.nph96:                                         ; preds = %entry
28   ret i8 3
29 }