Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | ; PR 19261 |
| 3 | |
NAKAMURA Takumi | a25ac91 | 2014-04-04 10:16:51 +0000 | [diff] [blame] | 4 | ; RUN: %llc_dwarf -fast-isel=false -O0 -filetype=obj %s -o %t |
| 5 | ; RUN: llvm-dwarfdump %t | FileCheck %s |
Eric Christopher | 5c8c5e5 | 2014-04-07 13:36:26 +0000 | [diff] [blame] | 6 | |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 7 | ; CHECK: {{0x[0-9a-f]+}} 1 0 1 0 0 is_stmt |
Eric Christopher | bc79fdd | 2014-04-03 17:40:08 +0000 | [diff] [blame] | 8 | ; 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 Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 10 | |
| 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 |
| 21 | define void @foo(i32 %i) #0 { |
| 22 | entry: |
| 23 | %i.addr = alloca i32, align 4 |
| 24 | store i32 %i, i32* %i.addr, align 4 |
Duncan P. N. Exon Smith | 176b691 | 2014-10-03 20:01:09 +0000 | [diff] [blame] | 25 | call void @llvm.dbg.declare(metadata !{i32* %i.addr}, metadata !12, metadata !{metadata !"0x102"}), !dbg !13 |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 26 | %0 = load i32* %i.addr, align 4, !dbg !14 |
| 27 | switch i32 %0, label %sw.default [ |
| 28 | ], !dbg !14 |
| 29 | |
| 30 | sw.default: ; preds = %entry |
| 31 | br label %sw.epilog, !dbg !15 |
| 32 | |
| 33 | sw.epilog: ; preds = %sw.default |
| 34 | ret void, !dbg !17 |
| 35 | } |
| 36 | |
| 37 | ; Function Attrs: nounwind readnone |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 38 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 39 | |
| 40 | attributes #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" } |
| 41 | attributes #1 = { nounwind readnone } |
| 42 | |
| 43 | !llvm.dbg.cu = !{!0} |
| 44 | !llvm.module.flags = !{!9, !10} |
| 45 | !llvm.ident = !{!11} |
| 46 | |
Duncan P. N. Exon Smith | 176b691 | 2014-10-03 20:01:09 +0000 | [diff] [blame] | 47 | !0 = metadata !{metadata !"0x11\0012\00clang version 3.5.0 (204712)\000\00\000\00\001", metadata !1, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2} ; [ DW_TAG_compile_unit ] [D:\work\EPRs\396363/test.c] [DW_LANG_C99] |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 48 | !1 = metadata !{metadata !"test.c", metadata !"D:\5Cwork\5CEPRs\5C396363"} |
| 49 | !2 = metadata !{} |
| 50 | !3 = metadata !{metadata !4} |
Duncan P. N. Exon Smith | 176b691 | 2014-10-03 20:01:09 +0000 | [diff] [blame] | 51 | !4 = metadata !{metadata !"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", metadata !1, metadata !5, metadata !6, null, void (i32)* @foo, null, null, metadata !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo] |
| 52 | !5 = metadata !{metadata !"0x29", metadata !1} ; [ DW_TAG_file_type ] [D:\work\EPRs\396363/test.c] |
| 53 | !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 ] |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 54 | !7 = metadata !{null, metadata !8} |
Duncan P. N. Exon Smith | 176b691 | 2014-10-03 20:01:09 +0000 | [diff] [blame] | 55 | !8 = metadata !{metadata !"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] |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 56 | !9 = metadata !{i32 2, metadata !"Dwarf Version", i32 4} |
Duncan P. N. Exon Smith | 176b691 | 2014-10-03 20:01:09 +0000 | [diff] [blame] | 57 | !10 = metadata !{i32 1, metadata !"Debug Info Version", i32 2} |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 58 | !11 = metadata !{metadata !"clang version 3.5.0 (204712)"} |
Duncan P. N. Exon Smith | 176b691 | 2014-10-03 20:01:09 +0000 | [diff] [blame] | 59 | !12 = metadata !{metadata !"0x101\00i\0016777217\000", metadata !4, metadata !5, metadata !8} ; [ DW_TAG_arg_variable ] [i] [line 1] |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 60 | !13 = metadata !{i32 1, i32 0, metadata !4, null} |
| 61 | !14 = metadata !{i32 2, i32 0, metadata !4, null} |
| 62 | !15 = metadata !{i32 4, i32 0, metadata !16, null} |
Duncan P. N. Exon Smith | 176b691 | 2014-10-03 20:01:09 +0000 | [diff] [blame] | 63 | !16 = metadata !{metadata !"0xb\002\000\000", metadata !1, metadata !4} ; [ DW_TAG_lexical_block ] [D:\work\EPRs\396363/test.c] |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 64 | !17 = metadata !{i32 6, i32 0, metadata !4, null} |