Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc -mcpu=cortex-a9 -O1 -filetype=obj %s -o - | llvm-objdump -arch thumb -mcpu=cortex-a9 -d - | FileCheck %s
      2 
      3 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"
      4 target triple = "thumbv7--linux-gnueabi"
      5 
      6 declare i8* @llvm.returnaddress(i32)
      7 
      8 define i32* @wrong-t2stmia-size-reduction(i32* %addr, i32 %val0) minsize {
      9   store i32 %val0, i32* %addr
     10   %addr1 = getelementptr i32, i32* %addr, i32 1
     11   %lr = call i8* @llvm.returnaddress(i32 0)
     12   %lr32 = ptrtoint i8* %lr to i32
     13   store i32 %lr32, i32* %addr1
     14   %addr2 = getelementptr i32, i32* %addr1, i32 1
     15   ret i32* %addr2
     16 }
     17 
     18 ; Check that stm writes two registers.  The bug caused one of registers (LR,
     19 ; which invalid for Thumb1 form of STMIA instruction) to be dropped.
     20 ; CHECK: stm{{[^,]*}}, {{{.*,.*}}}
     21