1 ; RUN: opt -S -aarch64-stack-tagging %s -o - | FileCheck %s
3 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
4 target triple = "aarch64"
6 define void @f() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
9 %a = alloca i8, i32 48, align 8
10 call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %a) #2
11 ; CHECK: call void @llvm.aarch64.settag(ptr %a.tag, i64 48)
12 %b = alloca i8, i32 48, align 8
13 call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %b) #2
14 ; CHECK: call void @llvm.aarch64.settag(ptr %b.tag, i64 48)
15 invoke void @g (ptr nonnull %a, ptr nonnull %b) to label %next0 unwind label %lpad0
20 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %a)
21 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %b)
27 %pad0v = landingpad { ptr, i32 } catch ptr null
28 %v = extractvalue { ptr, i32 } %pad0v, 0
29 %x = call ptr @__cxa_begin_catch(ptr %v) #2
30 invoke void @__cxa_end_catch() to label %next1 unwind label %lpad1
40 ; CHECK-DAG: call void @llvm.aarch64.settag(ptr %a, i64 48)
41 ; CHECK-DAG: call void @llvm.aarch64.settag(ptr %b, i64 48)
42 %pad1v = landingpad { ptr, i32 } cleanup
43 resume { ptr, i32 } %pad1v
47 ; CHECK-DAG: call void @llvm.aarch64.settag(ptr %a, i64 48)
48 ; CHECK-DAG: call void @llvm.aarch64.settag(ptr %b, i64 48)
53 declare void @g(ptr, ptr) #0
55 declare dso_local i32 @__gxx_personality_v0(...)
57 declare dso_local ptr @__cxa_begin_catch(ptr) local_unnamed_addr
59 declare dso_local void @__cxa_end_catch() local_unnamed_addr
61 ; Function Attrs: argmemonly nounwind willreturn
62 declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
64 ; Function Attrs: argmemonly nounwind willreturn
65 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
67 attributes #0 = { sanitize_memtag "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mte,+neon,+v8.5a" "unsafe-fp-math"="false" "use-soft-float"="false" }
68 attributes #1 = { argmemonly nounwind willreturn }
69 attributes #2 = { nounwind }