Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | ; PR 19261 |
| 3 | |
Hans Wennborg | a9e2057 | 2015-04-16 15:43:26 +0000 | [diff] [blame] | 4 | ; RUN: %llc_dwarf -fast-isel=false -O0 -filetype=obj %s -o %t |
NAKAMURA Takumi | a25ac91 | 2014-04-04 10:16:51 +0000 | [diff] [blame] | 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 |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 21 | define void @foo(i32 %i) #0 !dbg !4 { |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 22 | entry: |
| 23 | %i.addr = alloca i32, align 4 |
| 24 | store i32 %i, i32* %i.addr, align 4 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 25 | call void @llvm.dbg.declare(metadata i32* %i.addr, metadata !12, metadata !DIExpression()), !dbg !13 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 26 | %0 = load i32, i32* %i.addr, align 4, !dbg !14 |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 27 | switch i32 %0, label %sw.default [ |
| 28 | ], !dbg !14 |
| 29 | |
Hans Wennborg | 6c42d1a | 2014-11-29 21:17:05 +0000 | [diff] [blame] | 30 | sw.epilog: ; preds = %sw.default |
| 31 | ret void, !dbg !17 |
| 32 | |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 33 | sw.default: ; preds = %entry |
| 34 | br label %sw.epilog, !dbg !15 |
| 35 | |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | ; Function Attrs: nounwind readnone |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 39 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
Eric Christopher | bfb38ba | 2014-04-03 12:11:51 +0000 | [diff] [blame] | 40 | |
| 41 | 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" } |
| 42 | attributes #1 = { nounwind readnone } |
| 43 | |
| 44 | !llvm.dbg.cu = !{!0} |
| 45 | !llvm.module.flags = !{!9, !10} |
| 46 | !llvm.ident = !{!11} |
| 47 | |
Duncan P. N. Exon Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 48 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (204712)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 49 | !1 = !DIFile(filename: "test.c", directory: "D:\5Cwork\5CEPRs\5C396363") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 50 | !2 = !{} |
| 51 | !3 = !{!4} |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 52 | !4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 53 | !5 = !DIFile(filename: "test.c", directory: "D:CworkCEPRsC396363") |
| 54 | !6 = !DISubroutineType(types: !7) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 55 | !7 = !{null, !8} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 56 | !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 57 | !9 = !{i32 2, !"Dwarf Version", i32 4} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 58 | !10 = !{i32 1, !"Debug Info Version", i32 3} |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 59 | !11 = !{!"clang version 3.5.0 (204712)"} |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 60 | !12 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !4, file: !5, type: !8) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 61 | !13 = !DILocation(line: 1, scope: !4) |
| 62 | !14 = !DILocation(line: 2, scope: !4) |
| 63 | !15 = !DILocation(line: 4, scope: !16) |
| 64 | !16 = distinct !DILexicalBlock(line: 2, column: 0, file: !1, scope: !4) |
| 65 | !17 = !DILocation(line: 6, scope: !4) |