1 ; RUN: opt %s -verify-debuginfo-preserve -passes=instcombine -disable-output 2>&1 | FileCheck --check-prefix=VERIFY %s
2 ; RUN: opt --experimental-debuginfo-iterators=false %s -verify-debuginfo-preserve -passes=instcombine -disable-output 2>&1 | FileCheck --check-prefix=VERIFY %s
4 ; VERIFY: CheckModuleDebugify (original debuginfo):
6 ; RUN: opt %s -verify-each-debuginfo-preserve -O2 -disable-output 2>&1 | FileCheck --check-prefix=VERIFY-EACH %s
7 ; RUN: opt %s --experimental-debuginfo-iterators=false -verify-each-debuginfo-preserve -O2 -disable-output 2>&1 | FileCheck --check-prefix=VERIFY-EACH %s
9 ; VERIFY-EACH: DeadArgumentEliminationPass
10 ; VERIFY-EACH: GlobalDCEPass
13 source_filename = "m.c"
14 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
15 target triple = "x86_64-unknown-linux-gnu"
17 ; Function Attrs: noinline nounwind optnone uwtable
18 define dso_local i32 @foo(i32 %i) !dbg !8 {
20 %i.addr = alloca i32, align 4
21 store i32 %i, ptr %i.addr, align 4
22 call void @llvm.dbg.declare(metadata ptr %i.addr, metadata !13, metadata !DIExpression()), !dbg !14
23 %0 = load i32, ptr %i.addr, align 4, !dbg !15
24 %call = call i32 @goo(i32 %0), !dbg !16
25 ret i32 %call, !dbg !17
28 ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
29 declare void @llvm.dbg.declare(metadata, metadata, metadata)
31 declare dso_local i32 @goo(i32)
34 !llvm.module.flags = !{!2, !3, !4, !5, !6}
37 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 14.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
38 !1 = !DIFile(filename: "m.c", directory: "/dir")
39 !2 = !{i32 7, !"Dwarf Version", i32 4}
40 !3 = !{i32 2, !"Debug Info Version", i32 3}
41 !4 = !{i32 1, !"wchar_size", i32 4}
42 !5 = !{i32 7, !"uwtable", i32 1}
43 !6 = !{i32 7, !"frame-pointer", i32 2}
44 !7 = !{!"clang version 14.0.0"}
45 !8 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !9, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12)
46 !9 = !DISubroutineType(types: !10)
48 !11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
50 !13 = !DILocalVariable(name: "i", arg: 1, scope: !8, file: !1, line: 2, type: !11)
51 !14 = !DILocation(line: 2, column: 13, scope: !8)
52 !15 = !DILocation(line: 3, column: 14, scope: !8)
53 !16 = !DILocation(line: 3, column: 10, scope: !8)
54 !17 = !DILocation(line: 3, column: 3, scope: !8)