1; RUN: opt < %s -aarch64-stack-tagging -S -o - | FileCheck %s 2; RUN: opt < %s -aarch64-stack-tagging -S -o - --try-experimental-debuginfo-iterators | FileCheck %s 3 4target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" 5target triple = "aarch64--linux-android" 6 7declare void @use32(ptr) 8declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone speculatable 9declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone speculatable 10 11; Debug intrinsics use the new alloca directly, not through a GEP or a tagp. 12define void @DbgIntrinsics() sanitize_memtag { 13entry: 14 %x = alloca i32, align 4 15 call void @llvm.dbg.declare(metadata ptr %x, metadata !6, metadata !DIExpression()), !dbg !10 16 call void @llvm.dbg.value(metadata !DIArgList(ptr %x, ptr %x), metadata !6, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus)), !dbg !10 17 store i32 42, ptr %x, align 4 18 call void @use32(ptr %x) 19 ret void 20} 21 22; CHECK-LABEL: define void @DbgIntrinsics( 23; CHECK: [[X:%.*]] = alloca { i32, [12 x i8] }, align 16 24; CHECK: #dbg_declare(ptr [[X]], 25; CHECK: #dbg_value(!DIArgList(ptr [[X]], ptr [[X]]) 26 27 28!llvm.dbg.cu = !{!0} 29!llvm.module.flags = !{!8, !9} 30 31!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 9.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None) 32!1 = !DIFile(filename: "stack-tagging.cc", directory: "/tmp") 33!2 = !{} 34!3 = distinct !DISubprogram(name: "DbgIntrinsics", linkageName: "DbgIntrinsics", scope: !1, file: !1, line: 3, type: !4, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) 35!4 = !DISubroutineType(types: !5) 36!5 = !{null} 37!6 = !DILocalVariable(name: "x", scope: !3, file: !1, line: 4, type: !7) 38!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 39!8 = !{i32 2, !"Dwarf Version", i32 4} 40!9 = !{i32 2, !"Debug Info Version", i32 3} 41!10 = !DILocation(line: 1, column: 2, scope: !3) 42