brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 8752d24 Raw
50 lines · plain
1; RUN: opt %s -passes=adce -S -o - \2; RUN: | FileCheck %s3 4;; $ cat test.c5;; void fun(int local) {}6;;7;; $ clang test.c -g -O1 -Xclang -disable-llvm-passes | opt -S -passes=declare-to-assign8 9;; Check that the dbg.assign intrinsics that are considered "out of scope" (dbg10;; attachments have been deleted) but still linked to an instruction are not11;; deleted by ADCE.12 13; CHECK: #dbg_assign14; CHECK: #dbg_assign15 16define dso_local void @fun(i32 noundef %local) #0 !dbg !7 {17entry:18  %local.addr = alloca i32, align 4, !DIAssignID !1319  call void @llvm.dbg.assign(metadata i1 undef, metadata !12, metadata !DIExpression(), metadata !13, metadata ptr %local.addr, metadata !DIExpression()), !dbg !1420  store i32 %local, ptr %local.addr, align 4, !DIAssignID !1921  call void @llvm.dbg.assign(metadata i32 %local, metadata !12, metadata !DIExpression(), metadata !19, metadata ptr %local.addr, metadata !DIExpression()), !dbg !1422  ret void23}24 25declare void @llvm.dbg.declare(metadata, metadata, metadata)26declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)27 28!llvm.dbg.cu = !{!0}29!llvm.module.flags = !{!2, !3, !4, !5, !1000}30!llvm.ident = !{!6}31 32!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 14.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)33!1 = !DIFile(filename: "test.c", directory: "/")34!2 = !{i32 7, !"Dwarf Version", i32 5}35!3 = !{i32 2, !"Debug Info Version", i32 3}36!4 = !{i32 1, !"wchar_size", i32 4}37!5 = !{i32 7, !"uwtable", i32 1}38!6 = !{!"clang version 14.0.0"}39!7 = distinct !DISubprogram(name: "fun", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)40!8 = !DISubroutineType(types: !9)41!9 = !{null, !10}42!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)43!11 = !{!12}44!12 = !DILocalVariable(name: "local", arg: 1, scope: !7, file: !1, line: 1, type: !10)45!13 = distinct !DIAssignID()46!14 = !DILocation(line: 0, scope: !7)47!19 = distinct !DIAssignID()48!20 = !DILocation(line: 1, column: 22, scope: !7)49!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}50