1 2; RUN: llc < %s -filetype=obj -mtriple=x86_64-apple-darwin | llvm-dwarfdump -v - | FileCheck %s 3 4; Test that a nodebug function (a function not appearing in the debug info IR 5; metadata subprogram list) with DebugLocs on its IR doesn't cause crashes/does 6; the right thing. 7 8; Build with clang from the following: 9; extern int i; 10; inline __attribute__((always_inline)) void f1() { 11; i = 3; 12; } 13; 14; __attribute__((nodebug)) void f2() { 15; f1(); 16; } 17 18; Check that there's no DW_TAG_subprogram, not even for the 'f2' function. 19; CHECK: .debug_info contents: 20; CHECK: DW_TAG_compile_unit 21; CHECK-NOT: DW_TAG_subprogram 22 23; Expect no line table entry since there are no functions and file references in this compile unit 24; CHECK: .debug_line contents: 25; CHECK: Line table prologue: 26; CHECK: total_length: 0x0000001a 27; CHECK-NOT: file_names[ 28 29@i = external global i32 30 31; Function Attrs: uwtable 32define void @_Z2f2v() #0 { 33entry: 34 store i32 3, i32* @i, align 4, !dbg !11 35 ret void 36} 37 38attributes #0 = { uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 39 40!llvm.dbg.cu = !{!0} 41!llvm.module.flags = !{!8, !9} 42!llvm.ident = !{!10} 43 44!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !12, globals: !2, imports: !2) 45!1 = !DIFile(filename: "nodebug.cpp", directory: "/tmp/dbginfo") 46!2 = !{} 47!4 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, retainedNodes: !2) 48!5 = !DIFile(filename: "nodebug.cpp", directory: "/tmp/dbginfo") 49!6 = !DISubroutineType(types: !7) 50!7 = !{null} 51!8 = !{i32 2, !"Dwarf Version", i32 4} 52!9 = !{i32 2, !"Debug Info Version", i32 3} 53!10 = !{!"clang version 3.5.0 "} 54!11 = !DILocation(line: 3, scope: !4) 55!12 = !{!13} 56!13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 57