blob: acd3e82d771a53d4cc6a6499a27d0fa86c187349 [file] [log] [blame]
David Blaikie2f040112014-07-25 16:10:16 +00001; REQUIRES: object-emission
2
3; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
4
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
7; the right thing.
8
9; Build with clang from the following:
10; extern int i;
11; inline __attribute__((always_inline)) void f1() {
12; i = 3;
13; }
14;
15; __attribute__((nodebug)) void f2() {
16; f1();
17; }
18
19; Check that there's only one DW_TAG_subprogram, nothing for the 'f2' function.
20; CHECK: DW_TAG_subprogram
21; CHECK-NOT: DW_TAG
22; CHECK: DW_AT_name {{.*}} "f1"
23; CHECK-NOT: DW_TAG_subprogram
24
25@i = external global i32
26
27; Function Attrs: uwtable
28define void @_Z2f2v() #0 {
29entry:
30 store i32 3, i32* @i, align 4, !dbg !11
31 ret void
32}
33
34attributes #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" }
35
36!llvm.dbg.cu = !{!0}
37!llvm.module.flags = !{!8, !9}
38!llvm.ident = !{!10}
39
Duncan P. N. Exon Smith176b6912014-10-03 20:01:09 +000040!0 = metadata !{metadata !"0x11\004\00clang version 3.5.0 \000\00\000\00\001", metadata !1, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/nodebug.cpp] [DW_LANG_C_plus_plus]
David Blaikie2f040112014-07-25 16:10:16 +000041!1 = metadata !{metadata !"nodebug.cpp", metadata !"/tmp/dbginfo"}
42!2 = metadata !{}
43!3 = metadata !{metadata !4}
Duncan P. N. Exon Smith176b6912014-10-03 20:01:09 +000044!4 = metadata !{metadata !"0x2e\00f1\00f1\00_Z2f1v\002\000\001\000\006\00256\000\002", metadata !1, metadata !5, metadata !6, null, null, null, null, metadata !2} ; [ DW_TAG_subprogram ] [line 2] [def] [f1]
45!5 = metadata !{metadata !"0x29", metadata !1} ; [ DW_TAG_file_type ] [/tmp/dbginfo/nodebug.cpp]
46!6 = metadata !{metadata !"0x15\00\000\000\000\000\000\000", i32 0, null, null, metadata !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
David Blaikie2f040112014-07-25 16:10:16 +000047!7 = metadata !{null}
48!8 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
Duncan P. N. Exon Smith176b6912014-10-03 20:01:09 +000049!9 = metadata !{i32 2, metadata !"Debug Info Version", i32 2}
David Blaikie2f040112014-07-25 16:10:16 +000050!10 = metadata !{metadata !"clang version 3.5.0 "}
51!11 = metadata !{i32 3, i32 0, metadata !4, null}