brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.9 KiB · 4865812 Raw
79 lines · plain
1; RUN: opt -passes=jump-threading -S < %s | FileCheck %s2 3define dso_local i32 @_Z3fooi(i32 %a) !dbg !7 {4entry:5  call void @llvm.dbg.value(metadata i32 %a, metadata !12, metadata !DIExpression()), !dbg !136  call void @llvm.dbg.value(metadata i32 1, metadata !14, metadata !DIExpression()), !dbg !137  %tobool = icmp ne i32 %a, 0, !dbg !158  br i1 %tobool, label %if.then, label %if.end, !dbg !179 10if.then:                                          ; preds = %entry11  call void @_Z4callv(), !dbg !1812  call void @llvm.dbg.value(metadata i32 0, metadata !14, metadata !DIExpression()), !dbg !1313  br label %if.end, !dbg !2014 15if.end:                                           ; preds = %if.then, %entry16  %c.0 = phi i32 [ 0, %if.then ], [ 1, %entry ], !dbg !1317  call void @llvm.dbg.value(metadata i32 %c.0, metadata !14, metadata !DIExpression()), !dbg !1318  %tobool1 = icmp ne i32 %c.0, 0, !dbg !2119  br i1 %tobool1, label %if.else, label %if.then2, !dbg !2320 21; CHECK-LABEL: if.then2:22; CHECK: #dbg_value({{.+}}, ![[B:[0-9]+]], !DIExpression(),23; CHECK: #dbg_value({{.+}}, ![[B:[0-9]+]], !DIExpression(),24; CHECK-NOT: #dbg_value({{.+}}, ![[B]], !DIExpression(),25if.then2:                                         ; preds = %if.end26  call void @llvm.dbg.value(metadata i32 4, metadata !24, metadata !DIExpression()), !dbg !1327  br label %if.end3, !dbg !2528 29; CHECK-LABEL: if.end3:30if.else:                                          ; preds = %if.end31  call void @llvm.dbg.value(metadata i32 6, metadata !24, metadata !DIExpression()), !dbg !1332  br label %if.end333 34if.end3:                                          ; preds = %if.else, %if.then235  %b.0 = phi i32 [ 6, %if.else ], [ 4, %if.then2 ], !dbg !2736  call void @llvm.dbg.value(metadata i32 %b.0, metadata !24, metadata !DIExpression()), !dbg !1337  ret i32 %b.0, !dbg !2838}39; Function Attrs: nounwind readnone speculatable willreturn40declare void @llvm.dbg.declare(metadata, metadata, metadata)41declare dso_local void @_Z4callv()42; Function Attrs: nounwind readnone speculatable willreturn43declare void @llvm.dbg.value(metadata, metadata, metadata)44 45!llvm.dbg.cu = !{!0}46!llvm.module.flags = !{!3, !4, !5}47!llvm.ident = !{!6}48 49; CHECK: ![[B]] = !DILocalVariable(name: "b"50!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 10.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)51!1 = !DIFile(filename: "test.cpp", directory: "/")52!2 = !{}53!3 = !{i32 7, !"Dwarf Version", i32 4}54!4 = !{i32 2, !"Debug Info Version", i32 3}55!5 = !{i32 1, !"wchar_size", i32 4}56!6 = !{!"clang version 10.0.0"}57!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", scope: !8, file: !8, line: 3, type: !9, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)58!8 = !DIFile(filename: "./test.cpp", directory: "/")59!9 = !DISubroutineType(types: !10)60!10 = !{!11, !11}61!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)62!12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !8, line: 3, type: !11)63!13 = !DILocation(line: 0, scope: !7)64!14 = !DILocalVariable(name: "c", scope: !7, file: !8, line: 4, type: !11)65!15 = !DILocation(line: 5, column: 7, scope: !16)66!16 = distinct !DILexicalBlock(scope: !7, file: !8, line: 5, column: 7)67!17 = !DILocation(line: 5, column: 7, scope: !7)68!18 = !DILocation(line: 6, column: 5, scope: !19)69!19 = distinct !DILexicalBlock(scope: !16, file: !8, line: 5, column: 10)70!20 = !DILocation(line: 8, column: 3, scope: !19)71!21 = !DILocation(line: 9, column: 8, scope: !22)72!22 = distinct !DILexicalBlock(scope: !7, file: !8, line: 9, column: 7)73!23 = !DILocation(line: 9, column: 7, scope: !7)74!24 = !DILocalVariable(name: "b", scope: !7, file: !8, line: 4, type: !11)75!25 = !DILocation(line: 11, column: 3, scope: !26)76!26 = distinct !DILexicalBlock(scope: !22, file: !8, line: 9, column: 11)77!27 = !DILocation(line: 0, scope: !22)78!28 = !DILocation(line: 14, column: 3, scope: !7)79