[ARM] Add earlyclobber constraint to pre/post-indexed ARM STR instructions.
[oota-llvm.git] / test / CodeGen / ARM / 2014-07-18-earlyclobber-str-post.ll
1 ; RUN: llc -mtriple=armv7-linux-gnueabihf %s -o - | FileCheck %s
2
3 ; Check that we don't create an unpredictable STR instruction,
4 ; e.g. str r0, [r0], #4
5
6 define i32* @earlyclobber-str-post(i32* %addr) nounwind {
7 ; CHECK: earlyclobber-str-post
8 ; CHECK-NOT: str r[[REG:[0-9]+]], [r[[REG]]], #4
9   %val = ptrtoint i32* %addr to i32
10   store i32 %val, i32* %addr
11   %new = getelementptr i32* %addr, i32 1
12   ret i32* %new
13 }