34 lines · plain
1; RUN: llc -mtriple=armv7-linux-gnueabihf %s -o - | FileCheck %s2 3; Check that we don't create an unpredictable STR instruction,4; e.g. str r0, [r0], #45 6define ptr @earlyclobber-str-post(ptr %addr) nounwind {7; CHECK-LABEL: earlyclobber-str-post8; CHECK-NOT: str r[[REG:[0-9]+]], [r[[REG]]], #49 %val = ptrtoint ptr %addr to i3210 store i32 %val, ptr %addr11 %new = getelementptr i32, ptr %addr, i32 112 ret ptr %new13}14 15define ptr @earlyclobber-strh-post(ptr %addr) nounwind {16; CHECK-LABEL: earlyclobber-strh-post17; CHECK-NOT: strh r[[REG:[0-9]+]], [r[[REG]]], #218 %val = ptrtoint ptr %addr to i3219 %tr = trunc i32 %val to i1620 store i16 %tr, ptr %addr21 %new = getelementptr i16, ptr %addr, i32 122 ret ptr %new23}24 25define ptr @earlyclobber-strb-post(ptr %addr) nounwind {26; CHECK-LABEL: earlyclobber-strb-post27; CHECK-NOT: strb r[[REG:[0-9]+]], [r[[REG]]], #128 %val = ptrtoint ptr %addr to i3229 %tr = trunc i32 %val to i830 store i8 %tr, ptr %addr31 %new = getelementptr i8, ptr %addr, i32 132 ret ptr %new33}34