1 ; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj -O0 < %s > %t 2 ; RUN: llvm-dwarfdump %t | FileCheck %s 3 4 ; CHECK: [[FILEID:[0-9]+]]]{{.*}}list0.h 5 ; CHECK: [[FILEID]] 0 1 0 0 is_stmt{{$}} 6 7 ; IR generated from clang -g -emit-llvm with the following source: 8 ; list0.h: 9 ; int foo (int x) { 10 ; return ++x; 11 ; } 12 ; list0.c: 13 ; #include "list0.h" 14 ; int main() { 15 ; } 16 17 define i32 @foo(i32 %x) #0 { 18 entry: 19 %x.addr = alloca i32, align 4 20 store i32 %x, i32* %x.addr, align 4 21 call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !14, metadata !MDExpression()), !dbg !15 22 %0 = load i32, i32* %x.addr, align 4, !dbg !16 23 %inc = add nsw i32 %0, 1, !dbg !16 24 store i32 %inc, i32* %x.addr, align 4, !dbg !16 25 ret i32 %inc, !dbg !16 26 } 27 28 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 29 30 define i32 @main() #0 { 31 entry: 32 ret i32 0, !dbg !17 33 } 34 35 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } 36 attributes #1 = { nounwind readnone } 37 38 !llvm.dbg.cu = !{!0} 39 !llvm.module.flags = !{!19} 40 41 !0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) 42 !1 = !MDFile(filename: "list0.c", directory: "/usr/local/google/home/blaikie/dev/scratch") 43 !2 = !{} 44 !3 = !{!4, !10} 45 !4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !5, scope: !6, type: !7, function: i32 (i32)* @foo, variables: !2) 46 !5 = !MDFile(filename: "./list0.h", directory: "/usr/local/google/home/blaikie/dev/scratch") 47 !6 = !MDFile(filename: "./list0.h", directory: "/usr/local/google/home/blaikie/dev/scratch") 48 !7 = !MDSubroutineType(types: !8) 49 !8 = !{!9, !9} 50 !9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 51 !10 = !MDSubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !11, type: !12, function: i32 ()* @main, variables: !2) 52 !11 = !MDFile(filename: "list0.c", directory: "/usr/local/google/home/blaikie/dev/scratch") 53 !12 = !MDSubroutineType(types: !13) 54 !13 = !{!9} 55 !14 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 1, arg: 1, scope: !4, file: !6, type: !9) 56 !15 = !MDLocation(line: 1, scope: !4) 57 !16 = !MDLocation(line: 2, scope: !4) 58 !17 = !MDLocation(line: 3, scope: !18) 59 !18 = !MDLexicalBlockFile(discriminator: 0, file: !11, scope: !10) 60 !19 = !{i32 1, !"Debug Info Version", i32 3} 61