]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blob - test/DebugInfo/X86/line-info.ll
IR: Make metadata typeless in assembly
[opencl/llvm.git] / test / DebugInfo / X86 / line-info.ll
1 ; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj -O0 < %s > %t
2 ; RUN: llvm-dwarfdump %t | FileCheck %s
4 ; CHECK: [[FILEID:[0-9]+]]]{{.*}}list0.h
5 ; CHECK: [[FILEID]]      0      1   0  0 is_stmt{{$}}
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 ; }
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 !{!"0x102"}), !dbg !15
22   %0 = load 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 }
28 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
30 define i32 @main() #0 {
31 entry:
32   ret i32 0, !dbg !17
33 }
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 }
38 !llvm.dbg.cu = !{!0}
39 !llvm.module.flags = !{!19}
41 !0 = !{!"0x11\0012\00clang version 3.3 \000\00\000\00\000", !1, !2, !2, !3, !2,  !2} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/blaikie/dev/scratch/list0.c] [DW_LANG_C99]
42 !1 = !{!"list0.c", !"/usr/local/google/home/blaikie/dev/scratch"}
43 !2 = !{}
44 !3 = !{!4, !10}
45 !4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", !5, !6, !7, null, i32 (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
46 !5 = !{!"./list0.h", !"/usr/local/google/home/blaikie/dev/scratch"}
47 !6 = !{!"0x29", !5}          ; [ DW_TAG_file_type ] [/usr/local/google/home/blaikie/dev/scratch/./list0.h]
48 !7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
49 !8 = !{!9, !9}
50 !9 = !{!"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]
51 !10 = !{!"0x2e\00main\00main\00\002\000\001\000\006\000\000\002", !1, !11, !12, null, i32 ()* @main, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [main]
52 !11 = !{!"0x29", !1}         ; [ DW_TAG_file_type ] [/usr/local/google/home/blaikie/dev/scratch/list0.c]
53 !12 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !13, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
54 !13 = !{!9}
55 !14 = !{!"0x101\00x\0016777217\000", !4, !6, !9} ; [ DW_TAG_arg_variable ] [x] [line 1]
56 !15 = !{i32 1, i32 0, !4, null}
57 !16 = !{i32 2, i32 0, !4, null}
58 !17 = !{i32 3, i32 0, !18, null}
59 !18 = !{!"0xb\000", !11, !10} ; [ DW_TAG_lexical_block ] [/usr/local/google/home/blaikie/dev/scratch/list0.c]
60 !19 = !{i32 1, !"Debug Info Version", i32 2}