1 ; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple \
2 ; RUN: aarch64 %s -o - | FileCheck %s --check-prefixes CHECK,V8A
3 ; RUN-V83A: llc -verify-machineinstrs -enable-machine-outliner -mtriple \
4 ; RUN-V83A: aarch64 -mattr=+v8.3a %s -o - > %t
5 ; RUN-V83A: FileCheck --check-prefixes CHECK,V83A < %t %s
7 ; Function a's outlining candidate contains a sp modifying add without a
8 ; corresponsing sub, so we shouldn't outline it.
9 define void @a() "sign-return-address"="all" "sign-return-address-key"="b_key" {
10 ; CHECK-LABEL: a: // @a
12 ; CHECK-NEXT: .cfi_b_key_frame
15 ; V8A-NEXT, V83A-NEXT: .cfi_negate_ra_state
16 %1 = alloca i32, align 4
17 %2 = alloca i32, align 4
18 %3 = alloca i32, align 4
19 %4 = alloca i32, align 4
20 %5 = alloca i32, align 4
21 %6 = alloca i32, align 4
22 store i32 1, ptr %1, align 4
23 store i32 2, ptr %2, align 4
24 store i32 3, ptr %3, align 4
25 store i32 4, ptr %4, align 4
26 store i32 5, ptr %5, align 4
27 store i32 6, ptr %6, align 4
28 ; CHECK-NOT: bl OUTLINED_FUNCTION_{{[0-9]+}}
31 ; V8A-NEXT, V83A-NEXT: .cfi_negate_ra_state
32 ; V8A-NEXT, V83A-NEXT: ret
36 define void @b() "sign-return-address"="all" "sign-return-address-key"="b_key" nounwind {
37 ; CHECK-LABEL: b: // @b
38 ; CHECK-NEXT: // %bb.0:
41 %1 = alloca i32, align 4
42 %2 = alloca i32, align 4
43 %3 = alloca i32, align 4
44 %4 = alloca i32, align 4
45 %5 = alloca i32, align 4
46 %6 = alloca i32, align 4
47 store i32 1, ptr %1, align 4
48 store i32 2, ptr %2, align 4
49 store i32 3, ptr %3, align 4
50 store i32 4, ptr %4, align 4
51 store i32 5, ptr %5, align 4
52 store i32 6, ptr %6, align 4
53 ; CHECK: bl [[OUTLINED_FUNC:OUTLINED_FUNCTION_[0-9]+]]
56 ; V8A-NEXT, V83A-NEXT: ret
60 define void @c() "sign-return-address"="all" "sign-return-address-key"="b_key" nounwind {
61 ; CHECK-LABEL: c: // @c
62 ; CHECK-NEXT: // %bb.0:
65 %1 = alloca i32, align 4
66 %2 = alloca i32, align 4
67 %3 = alloca i32, align 4
68 %4 = alloca i32, align 4
69 %5 = alloca i32, align 4
70 %6 = alloca i32, align 4
71 store i32 1, ptr %1, align 4
72 store i32 2, ptr %2, align 4
73 store i32 3, ptr %3, align 4
74 store i32 4, ptr %4, align 4
75 store i32 5, ptr %5, align 4
76 store i32 6, ptr %6, align 4
77 ; CHECK: bl [[OUTLINED_FUNC]]
80 ; V8A-NEXT, V83A-NEXT: ret
84 ; CHECK: [[OUTLINED_FUNC]]
90 ; V8A-NEXT, V83A-NEXT: ret