brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.0 KiB · 35d0539 Raw
102 lines · plain
1; RUN: llc %s -mtriple=x86_64-unknown-unknown -o - -stop-before=finalize-isel \2; RUN:   | FileCheck %s --check-prefix=NORMAL-INPUT3 4; RUN: llc %s -mtriple=x86_64-unknown-unknown -o - -stop-before=finalize-isel \5; RUN:   -experimental-debug-variable-locations \6; RUN:   | FileCheck %s --check-prefix=EXPER-INPUT7 8; RUN: llc %s -mtriple=x86_64-unknown-unknown -o - -stop-after=livedebugvars \9; RUN:   | FileCheck %s --check-prefix=OUTPUT10 11; RUN: llc %s -mtriple=x86_64-unknown-unknown -o - -stop-after=livedebugvars \12; RUN:   -experimental-debug-variable-locations \13; RUN:   | FileCheck %s --check-prefix=OUTPUT14 15; This test checks that LiveDebugVariables strips all debug instructions16; from nodebug functions. Such instructions occur when a function with debug17; info is inlined into a nodebug function.18 19; The test first verifies that DBG_VALUE/DBG_LABEL instructions are present in20; the input to LiveDebugVariables. It then verifies that after the pass is ran21; no debug instructions are present.22 23; When -experimental-debug-variable-locations is enabled, certain variable24; locations are represented by DBG_INSTR_REF instead of DBG_VALUE. The test25; verifies that a DBG_INSTR_REF is emitted by the option, and that it is also26; stripped.27 28; Generated from:29;30; extern int foobar();31; 32; int bar(int a) {33;   int b = 10;34;   b += foobar();35; label:36;   if (a) goto label;37;   return b;38; }39; 40; __attribute__((nodebug))41; int foo(int a) {42;   return bar(a);43; }44 45; NORMAL-INPUT-DAG: DBG_VALUE46; NORMAL-INPUT-DAG: DBG_LABEL47 48; EXPER-INPUT-DAG: DBG_INSTR_REF49; EXPER-INPUT-DAG: DBG_LABEL50 51; OUTPUT-NOT: DBG_VALUE52; OUTPUT-NOT: DBG_INSTR_REF53; OUTPUT-NOT: DBG_LABEL54 55target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"56target triple = "x86_64-unknown-linux-gnu"57 58define dso_local i32 @_Z3fooi(i32 %a) local_unnamed_addr #0 {59entry:60  call void @llvm.dbg.value(metadata i32 %a, metadata !12, metadata !DIExpression()), !dbg !1561  call void @llvm.dbg.value(metadata i32 10, metadata !13, metadata !DIExpression()), !dbg !1562  %call.i = tail call i32 @_Z6foobarv()63  call void @llvm.dbg.value(metadata i32 undef, metadata !13, metadata !DIExpression()), !dbg !1564  %tobool.not.i = icmp eq i32 %a, 065  br i1 %tobool.not.i, label %_Z3bari.exit, label %label.i66 67label.i:                                          ; preds = %entry, %label.i68  call void @llvm.dbg.label(metadata !14), !dbg !1869  br label %label.i70 71_Z3bari.exit:                                     ; preds = %entry72  %add.i = add nsw i32 %call.i, 1073  call void @llvm.dbg.value(metadata i32 %add.i, metadata !13, metadata !DIExpression()), !dbg !1574  ret i32 %add.i75}76 77declare void @llvm.dbg.value(metadata, metadata, metadata) #278declare dso_local i32 @_Z6foobarv() local_unnamed_addr #179declare void @llvm.dbg.label(metadata) #280 81!llvm.dbg.cu = !{!0}82!llvm.module.flags = !{!3, !4, !5}83!llvm.ident = !{!6}84 85!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)86!1 = !DIFile(filename: "f.cpp", directory: "")87!2 = !{}88!3 = !{i32 7, !"Dwarf Version", i32 4}89!4 = !{i32 2, !"Debug Info Version", i32 3}90!5 = !{i32 1, !"wchar_size", i32 4}91!6 = !{!"clang version 12.0.0"}92!7 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)93!8 = !DISubroutineType(types: !9)94!9 = !{!10, !10}95!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)96!11 = !{!12, !13, !14}97!12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 3, type: !10)98!13 = !DILocalVariable(name: "b", scope: !7, file: !1, line: 4, type: !10)99!14 = !DILabel(scope: !7, name: "label", file: !1, line: 6)100!15 = !DILocation(line: 0, scope: !7)101!18 = !DILocation(line: 6, column: 1, scope: !7)102