1; RUN: llc -mtriple=aarch64-none-eabi < %s | FileCheck --check-prefixes CHECK,CHECK-V8A %s
2; RUN: llc -mtriple=aarch64-none-eabi -mattr=v8.3a < %s | FileCheck --check-prefixes CHECK,CHECK-V83A %s
3; RUN: llc -mtriple=aarch64-none-eabi -filetype=obj -o - <%s | llvm-dwarfdump -v - | FileCheck --check-prefix=CHECK-DUMP %s
4
5@.str = private unnamed_addr constant [15 x i8] c"some exception\00", align 1
6@_ZTIPKc = external dso_local constant i8*
7
8; CHECK: @_Z3fooi
9; CHECK-V8A: hint #25
10; CHECK-V83A: paciasp
11; CHECK-NEXT: .cfi_negate_ra_state
12; CHECK-NOT: .cfi_negate_ra_state
13define dso_local i32 @_Z3fooi(i32 %x) #0 {
14entry:
15  %retval = alloca i32, align 4
16  %x.addr = alloca i32, align 4
17  store i32 %x, i32* %x.addr, align 4
18  %exception = call i8* @__cxa_allocate_exception(i64 8) #1
19  %0 = bitcast i8* %exception to i8**
20  store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0), i8** %0, align 16
21  call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIPKc to i8*), i8* null) #2
22  unreachable
23
24return:                                           ; No predecessors!
25  %1 = load i32, i32* %retval, align 4
26  ret i32 %1
27}
28
29declare dso_local i8* @__cxa_allocate_exception(i64)
30
31declare dso_local void @__cxa_throw(i8*, i8*, i8*)
32
33attributes #0 = { "sign-return-address"="all" }
34
35;CHECK-DUMP: DW_CFA_AARCH64_negate_ra_state
36