1 ; RUN: opt -S -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-arm-unknown-eabi"
6 define void @f() local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
9 %a = alloca i8, i32 48, align 8
10 call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %a) #2
11 ; CHECK: call void @llvm.aarch64.settag(i8* %a.tag, i64 48)
12 %b = alloca i8, i32 48, align 8
13 call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %b) #2
14 ; CHECK: call void @llvm.aarch64.settag(i8* %b.tag, i64 48)
15 invoke void @g (i8 * nonnull %a, i8 * nonnull %b) to label %next0 unwind label %lpad0
20 call void @llvm.lifetime.end.p0i8(i64 40, i8* nonnull %a)
21 call void @llvm.lifetime.end.p0i8(i64 40, i8* nonnull %b)
27 %pad0v = landingpad { i8*, i32 } catch i8* null
28 %v = extractvalue { i8*, i32 } %pad0v, 0
29 %x = call i8* @__cxa_begin_catch(i8* %v) #2
30 invoke void @__cxa_end_catch() to label %next1 unwind label %lpad1
40 ; CHECK-DAG: call void @llvm.aarch64.settag(i8* %a, i64 48)
41 ; CHECK-DAG: call void @llvm.aarch64.settag(i8* %b, i64 48)
42 %pad1v = landingpad { i8*, i32 } cleanup
43 resume { i8*, i32 } %pad1v
47 ; CHECK-DAG: call void @llvm.aarch64.settag(i8* %a, i64 48)
48 ; CHECK-DAG: call void @llvm.aarch64.settag(i8* %b, i64 48)
53 declare void @g(i8 *, i8 *) #0
55 declare dso_local i32 @__gxx_personality_v0(...)
57 declare dso_local i8* @__cxa_begin_catch(i8*) 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.p0i8(i64 immarg, i8* nocapture) #1
64 ; Function Attrs: argmemonly nounwind willreturn
65 declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* 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 }