brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · f6313c7 Raw
69 lines · plain
1; RUN: opt -passes=deadargelim -S < %s | FileCheck %s2; PR140163 4; Built with clang (then manually running -passes=mem2reg with opt) from the following source:5; static void f1(int, ...) {6; }7;8; void f2() {9;   f1(1);10; }11 12; Test both varargs removal and removal of a traditional dead arg together, to13; test both the basic functionality, and a particular wrinkle involving updating14; the function->debug info mapping on update to ensure it's accurate when used15; again for the next removal.16 17; CHECK: define internal void @_ZL2f1iz({{.*}} !dbg [[SP:![0-9]+]]18; CHECK: [[SP]] = distinct !DISubprogram(name: "f1"19 20; Check that debug info metadata for subprograms stores pointers to21; updated LLVM functions.22 23; Function Attrs: uwtable24define void @_Z2f2v() !dbg !4 {25entry:26  call void (i32, ...) @_ZL2f1iz(i32 1), !dbg !1527  ret void, !dbg !1628}29 30; Function Attrs: nounwind uwtable31define internal void @_ZL2f1iz(i32, ...) !dbg !8 {32entry:33  call void @llvm.dbg.value(metadata i32 %0, metadata !17, metadata !18), !dbg !1934  ret void, !dbg !2035}36 37; Function Attrs: nounwind readnone38declare void @llvm.dbg.declare(metadata, metadata, metadata) #239 40; Function Attrs: nounwind readnone41declare void @llvm.dbg.value(metadata, metadata, metadata) #242 43attributes #2 = { nounwind readnone }44 45!llvm.dbg.cu = !{!0}46!llvm.module.flags = !{!12, !13}47!llvm.ident = !{!14}48 49!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)50!1 = !DIFile(filename: "dbg.cpp", directory: "/tmp/dbginfo")51!2 = !{}52!4 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", line: 4, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 4, file: !1, scope: !5, type: !6, retainedNodes: !2)53!5 = !DIFile(filename: "dbg.cpp", directory: "/tmp/dbginfo")54!6 = !DISubroutineType(types: !7)55!7 = !{null}56!8 = distinct !DISubprogram(name: "f1", linkageName: "_ZL2f1iz", line: 1, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !9, retainedNodes: !2)57!9 = !DISubroutineType(types: !10)58!10 = !{null, !11, null}59!11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)60!12 = !{i32 2, !"Dwarf Version", i32 4}61!13 = !{i32 2, !"Debug Info Version", i32 3}62!14 = !{!"clang version 3.6.0 "}63!15 = !DILocation(line: 5, column: 3, scope: !4)64!16 = !DILocation(line: 6, column: 1, scope: !4)65!17 = !DILocalVariable(name: "", line: 1, arg: 1, scope: !8, file: !5, type: !11)66!18 = !DIExpression()67!19 = !DILocation(line: 1, column: 19, scope: !8)68!20 = !DILocation(line: 2, column: 1, scope: !8)69