xref: /llvm-project/llvm/test/CodeGen/ARM/PR35379.ll (revision bed1c7f061aa12417aa081e334afdba45767b938)
1; RUN: llc -mtriple=armv7a-eabi < %s | FileCheck %s --check-prefix=CHECK-ARM
2; RUN: llc -mtriple=armv6m-eabi < %s | FileCheck %s --check-prefix=CHECK-THM
3
4; Function Attrs: minsize optsize
5declare void @g(ptr) local_unnamed_addr #0
6
7; Function Attrs: minsize optsize
8define void @f() local_unnamed_addr #0 {
9entry:
10  %i = alloca i32, align 4
11  store i32 1, ptr %i, align 4
12  call void @g(ptr nonnull %i)
13  ret void
14}
15
16; Check unwind info does not mention the registers used for padding, and
17; the amount of stack adjustment is the same as in the actual
18; instructions.
19
20; CHECK-ARM:      .save {r11, lr}
21; CHECK-ARM-NEXT: .pad #8
22; CHECK-ARM-NEXT: push {r9, r10, r11, lr}
23; CHECK-ARM:      pop {r2, r3, r11, pc}
24
25; CHECK-THM:      .save {r7, lr}
26; CHECK-THM-NEXT: .pad #8
27; CHECK-THM-NEXT: push {r5, r6, r7, lr}
28; CHECK-THM:      pop {r2, r3, r7, pc}
29
30
31define void @f1() local_unnamed_addr #1 {
32entry:
33  %i = alloca i32, align 4
34  store i32 1, ptr %i, align 4
35  call void @g(ptr nonnull %i)
36  ret void
37}
38
39; Check that unwind info is the same whether or not using -Os (minsize attr)
40
41; CHECK-ARM:      .save {r11, lr}
42; CHECK-ARM-NEXT: push {r11, lr}
43; CHECK-ARM-NEXT: .pad #8
44
45; CHECK-THM:      .save {r7, lr}
46; CHECK-THM-NEXT: push {r7, lr}
47; CHECK-THM-NEXT: .pad #8
48
49attributes #0 = { minsize optsize }
50attributes #1 = { optsize }
51