1 ; REQUIRES: object-emission
3 ; RUN: llc < %s -filetype=obj -mtriple=x86_64-apple-darwin | llvm-dwarfdump -v - | FileCheck %s
5 ; Test that a nodebug function (a function not appearing in the debug info IR
6 ; metadata subprogram list) with DebugLocs on its IR doesn't cause crashes/does
9 ; Build with clang from the following:
11 ; inline __attribute__((always_inline)) void f1() {
15 ; __attribute__((nodebug)) void f2() {
19 ; Check that there's no DW_TAG_subprogram, not even for the 'f2' function.
20 ; CHECK: .debug_info contents:
21 ; CHECK: DW_TAG_compile_unit
22 ; CHECK-NOT: DW_TAG_subprogram
24 ; Expect no line table entry since there are no functions and file references in this compile unit
25 ; CHECK: .debug_line contents:
26 ; CHECK: Line table prologue:
27 ; CHECK: total_length: 0x0000001a
28 ; CHECK-NOT: file_names[
30 @i = external global i32
32 ; Function Attrs: uwtable
33 define void @_Z2f2v() #0 {
35 store i32 3, i32* @i, align 4, !dbg !11
39 attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
42 !llvm.module.flags = !{!8, !9}
45 !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)
46 !1 = !DIFile(filename: "nodebug.cpp", directory: "/tmp/dbginfo")
48 !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)
49 !5 = !DIFile(filename: "nodebug.cpp", directory: "/tmp/dbginfo")
50 !6 = !DISubroutineType(types: !7)
52 !8 = !{i32 2, !"Dwarf Version", i32 4}
53 !9 = !{i32 2, !"Debug Info Version", i32 3}
54 !10 = !{!"clang version 3.5.0 "}
55 !11 = !DILocation(line: 3, scope: !4)
57 !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)