117 lines · plain
1; RUN: llc -O0 %s -mtriple=x86_64-apple-darwin -filetype=obj -o %t2; RUN: llvm-dwarfdump -v %t | FileCheck %s3; RUN: llc -O0 %s -mtriple=x86_64-apple-darwin -filetype=obj -o %t -dwarf-version=34; RUN: llvm-dwarfdump -v %t | FileCheck %s -check-prefix=DWARF35; RUN: llc < %s -O0 -mtriple=x86_64-apple-macosx10.7 | FileCheck %s -check-prefix=ASM6 7; rdar://130670058; CHECK: .debug_info contents:9; CHECK: DW_TAG_compile_unit10; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)11; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)12; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000010)13; CHECK: DW_TAG_subprogram14; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)15; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000010)16 17; CHECK: DW_TAG_compile_unit18; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000040)19; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000010)20; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000009)21; CHECK: DW_TAG_subprogram22; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000010)23; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000009)24 25 26; CHECK: .debug_line contents:27; CHECK-NEXT: debug_line[{{.*}}]28; CHECK-NEXT: Line table prologue:29; CHECK-NEXT: total_length: 0x0000003c30; CHECK: file_names[ 1]:31; CHECK-NEXT: name: "simple.c"32; CHECK-NEXT: dir_index: 033; CHECK: debug_line[{{.*}}]34; CHECK-NEXT: Line table prologue:35; CHECK-NEXT: total_length: 0x0000003a36; CHECK: file_names[ 1]:37; CHECK-NEXT: name: "simple2.c"38; CHECK-NEXT: dir_index: 039; CHECK-NOT: file_names40 41; DWARF3: .debug_info contents:42; DWARF3: DW_TAG_compile_unit43; DWARF3: DW_AT_stmt_list [DW_FORM_data4] (0x00000000)44 45; DWARF3: DW_TAG_compile_unit46; DWARF3: DW_AT_stmt_list [DW_FORM_data4] (0x0000003f)47 48 49; DWARF3: .debug_line contents:50; DWARF3-NEXT: debug_line[{{.*}}]51; DWARF3-NEXT: Line table prologue:52; DWARF3-NEXT: total_length: 0x0000003b53; DWARF3: file_names[ 1]:54; DWARF3-NEXT: name: "simple.c"55; DWARF3-NEXT: dir_index: 056; DWARF3: debug_line[{{.*}}]57; DWARF3-NEXT: Line table prologue:58; DWARF3-NEXT: total_length: 0x0000003959; DWARF3: file_names[ 1]:60; DWARF3-NEXT: name: "simple2.c"61; DWARF3-NEXT: dir_index: 062; DWARF3-NOT: file_names63 64; PR1540865; ASM: Lcu_begin0:66; ASM-NOT: Lcu_begin67; ASM: Lset[[LT:[0-9]+]] = Lline_table_start0-Lsection_line ## DW_AT_stmt_list68; ASM-NEXT: .long Lset[[LT]]69; ASM: Lcu_begin1:70; ASM-NOT: Lcu_begin71; ASM: Lset[[LT:[0-9]+]] = Lline_table_start0-Lsection_line ## DW_AT_stmt_list72; ASM-NEXT: .long Lset[[LT]]73define i32 @test(i32 %a) nounwind uwtable ssp !dbg !5 {74entry:75 %a.addr = alloca i32, align 476 store i32 %a, ptr %a.addr, align 477 call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !15, metadata !DIExpression()), !dbg !1678 %0 = load i32, ptr %a.addr, align 4, !dbg !1779 %call = call i32 @fn(i32 %0), !dbg !1780 ret i32 %call, !dbg !1781}82 83declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone84 85define i32 @fn(i32 %a) nounwind uwtable ssp !dbg !13 {86entry:87 %a.addr = alloca i32, align 488 store i32 %a, ptr %a.addr, align 489 call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !19, metadata !DIExpression()), !dbg !2090 %0 = load i32, ptr %a.addr, align 4, !dbg !2191 ret i32 %0, !dbg !2192}93 94!llvm.dbg.cu = !{!0, !10}95!llvm.module.flags = !{!25}96!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3", isOptimized: false, emissionKind: FullDebug, file: !23, enums: !1, retainedTypes: !1, globals: !1, imports: !1)97!1 = !{}98!5 = distinct !DISubprogram(name: "test", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !23, scope: !6, type: !7, retainedNodes: !1)99!6 = !DIFile(filename: "simple.c", directory: "/private/tmp")100!7 = !DISubroutineType(types: !8)101!8 = !{!9, !9}102!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)103!10 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 172862)", isOptimized: false, emissionKind: FullDebug, file: !24, enums: !1, retainedTypes: !1, globals: !1, imports: !1)104!13 = distinct !DISubprogram(name: "fn", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !10, scopeLine: 1, file: !24, scope: !14, type: !7, retainedNodes: !1)105!14 = !DIFile(filename: "simple2.c", directory: "/private/tmp")106!15 = !DILocalVariable(name: "a", line: 2, arg: 1, scope: !5, file: !6, type: !9)107!16 = !DILocation(line: 2, scope: !5)108!17 = !DILocation(line: 4, scope: !18)109!18 = distinct !DILexicalBlock(line: 3, column: 0, file: !23, scope: !5)110!19 = !DILocalVariable(name: "a", line: 1, arg: 1, scope: !13, file: !14, type: !9)111!20 = !DILocation(line: 1, scope: !13)112!21 = !DILocation(line: 2, scope: !22)113!22 = distinct !DILexicalBlock(line: 1, column: 0, file: !24, scope: !13)114!23 = !DIFile(filename: "simple.c", directory: "/private/tmp")115!24 = !DIFile(filename: "simple2.c", directory: "/private/tmp")116!25 = !{i32 1, !"Debug Info Version", i32 3}117