blob: 87654e7ae9e6015279a6f08162c293f22a135830 [file] [log] [blame]
Eric Christopherbfb38ba2014-04-03 12:11:51 +00001; REQUIRES: object-emission
2; PR 19261
3
NAKAMURA Takumia25ac912014-04-04 10:16:51 +00004; RUN: %llc_dwarf -fast-isel=false -O0 -filetype=obj %s -o %t
5; RUN: llvm-dwarfdump %t | FileCheck %s
Eric Christopher5c8c5e52014-04-07 13:36:26 +00006
Eric Christopherbfb38ba2014-04-03 12:11:51 +00007; CHECK: {{0x[0-9a-f]+}} 1 0 1 0 0 is_stmt
Eric Christopherbc79fdd2014-04-03 17:40:08 +00008; CHECK: {{0x[0-9a-f]+}} 2 0 1 0 0 is_stmt
9; CHECK: {{0x[0-9a-f]+}} 4 0 1 0 0 is_stmt
Eric Christopherbfb38ba2014-04-03 12:11:51 +000010
11; IR generated from clang -O0 -g with the following source:
12;void foo(int i){
13; switch(i){
14; default:
15; break;
16; }
17; return;
18;}
19
20; Function Attrs: nounwind
21define void @foo(i32 %i) #0 {
22entry:
23 %i.addr = alloca i32, align 4
24 store i32 %i, i32* %i.addr, align 4
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000025 call void @llvm.dbg.declare(metadata i32* %i.addr, metadata !12, metadata !{!"0x102"}), !dbg !13
David Blaikiea79ac142015-02-27 21:17:42 +000026 %0 = load i32, i32* %i.addr, align 4, !dbg !14
Eric Christopherbfb38ba2014-04-03 12:11:51 +000027 switch i32 %0, label %sw.default [
28 ], !dbg !14
29
Hans Wennborg6c42d1a2014-11-29 21:17:05 +000030sw.epilog: ; preds = %sw.default
31 ret void, !dbg !17
32
Eric Christopherbfb38ba2014-04-03 12:11:51 +000033sw.default: ; preds = %entry
34 br label %sw.epilog, !dbg !15
35
Eric Christopherbfb38ba2014-04-03 12:11:51 +000036}
37
38; Function Attrs: nounwind readnone
Adrian Prantl87b7eb92014-10-01 18:55:02 +000039declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
Eric Christopherbfb38ba2014-04-03 12:11:51 +000040
41attributes #0 = { nounwind "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" }
42attributes #1 = { nounwind readnone }
43
44!llvm.dbg.cu = !{!0}
45!llvm.module.flags = !{!9, !10}
46!llvm.ident = !{!11}
47
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000048!0 = !{!"0x11\0012\00clang version 3.5.0 (204712)\000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [D:\work\EPRs\396363/test.c] [DW_LANG_C99]
49!1 = !{!"test.c", !"D:\5Cwork\5CEPRs\5C396363"}
50!2 = !{}
51!3 = !{!4}
52!4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, void (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
53!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [D:\work\EPRs\396363/test.c]
54!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
55!7 = !{null, !8}
56!8 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
57!9 = !{i32 2, !"Dwarf Version", i32 4}
58!10 = !{i32 1, !"Debug Info Version", i32 2}
59!11 = !{!"clang version 3.5.0 (204712)"}
60!12 = !{!"0x101\00i\0016777217\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [i] [line 1]
Duncan P. N. Exon Smith98854692015-01-14 22:27:36 +000061!13 = !MDLocation(line: 1, scope: !4)
62!14 = !MDLocation(line: 2, scope: !4)
63!15 = !MDLocation(line: 4, scope: !16)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000064!16 = !{!"0xb\002\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [D:\work\EPRs\396363/test.c]
Duncan P. N. Exon Smith98854692015-01-14 22:27:36 +000065!17 = !MDLocation(line: 6, scope: !4)