brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 9edcf39 Raw
68 lines · plain
1; RUN: opt < %s -passes=add-discriminators -S | FileCheck %s2 3; Discriminator support for diamond-shaped CFG.:4; #1 void bar(int);5; #2 6; #3 void foo(int i) {7; #4   if (i > 10)8; #5     bar(5); else bar(3);9; #6 }10 11; bar(5):     discriminator 012; bar(3):     discriminator 213 14; Function Attrs: uwtable15define void @_Z3fooi(i32 %i) !dbg !4 {16  %1 = alloca i32, align 417  store i32 %i, ptr %1, align 418  call void @llvm.dbg.declare(metadata ptr %1, metadata !11, metadata !12), !dbg !1319  %2 = load i32, ptr %1, align 4, !dbg !1420  %3 = icmp sgt i32 %2, 10, !dbg !1621  br i1 %3, label %4, label %5, !dbg !1722 23; <label>:4                                       ; preds = %024  call void @_Z3bari(i32 5), !dbg !1825  br label %6, !dbg !1826 27; <label>:5                                       ; preds = %028  call void @_Z3bari(i32 3), !dbg !1929; CHECK:  call void @_Z3bari(i32 3), !dbg ![[ELSE:[0-9]+]]30  br label %631 32; <label>:6                                       ; preds = %5, %433  ret void, !dbg !2034}35 36; Function Attrs: nounwind readnone37declare void @llvm.dbg.declare(metadata, metadata, metadata)38 39declare void @_Z3bari(i32)40 41!llvm.dbg.cu = !{!0}42!llvm.module.flags = !{!8, !9}43!llvm.ident = !{!10}44 45!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 253273)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)46!1 = !DIFile(filename: "a.cc", directory: "/tmp")47!2 = !{}48!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)49!5 = !DISubroutineType(types: !6)50!6 = !{null, !7}51!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)52!8 = !{i32 2, !"Dwarf Version", i32 4}53!9 = !{i32 2, !"Debug Info Version", i32 3}54!10 = !{!"clang version 3.8.0 (trunk 253273)"}55!11 = !DILocalVariable(name: "i", arg: 1, scope: !4, file: !1, line: 3, type: !7)56!12 = !DIExpression()57!13 = !DILocation(line: 3, column: 14, scope: !4)58!14 = !DILocation(line: 4, column: 7, scope: !15)59!15 = distinct !DILexicalBlock(scope: !4, file: !1, line: 4, column: 7)60!16 = !DILocation(line: 4, column: 9, scope: !15)61!17 = !DILocation(line: 4, column: 7, scope: !4)62!18 = !DILocation(line: 5, column: 5, scope: !15)63!19 = !DILocation(line: 5, column: 18, scope: !15)64!20 = !DILocation(line: 6, column: 1, scope: !4)65 66; CHECK: ![[ELSE]] = !DILocation(line: 5, column: 18, scope: ![[ELSEBLOCK:[0-9]+]])67; CHECK: ![[ELSEBLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2)68