55b8a9e66d38bb76656d0a96f61f3d80b29dc143
[oota-llvm.git] / test / CodeGen / X86 / unknown-location.ll
1 ; RUN: llc < %s -asm-verbose=false -mtriple=x86_64-apple-darwin10 -use-unknown-locations | FileCheck %s
2
3 ; The divide instruction does not have a debug location. CodeGen should
4 ; represent this in the debug information. This is done by setting line
5 ; and column to 0
6
7 ;      CHECK:         leal
8 ; CHECK-NEXT:         .loc 1 0 0
9 ;      CHECK:         cltd
10 ; CHECK-NEXT:         idivl
11 ; CHECK-NEXT:         .loc 2 4 3
12
13 define i32 @foo(i32 %w, i32 %x, i32 %y, i32 %z) nounwind {
14 entry:
15   %a = add  i32 %w, %x, !dbg !8
16   %b = sdiv i32 %a, %y
17   %c = add  i32 %b, %z, !dbg !8
18   ret i32 %c, !dbg !8
19 }
20
21 !llvm.dbg.cu = !{!3}
22 !llvm.module.flags = !{!12}
23
24 !0 = !{!"0x101\00x\001\000", !1, !2, !6} ; [ DW_TAG_arg_variable ]
25 !1 = !{!"0x2e\00foo\00foo\00foo\001\000\001\000\006\000\000\001", !10, !2, !4, null, i32 (i32, i32, i32, i32)* @foo, null, null, null} ; [ DW_TAG_subprogram ]
26 !2 = !{!"0x29", !10} ; [ DW_TAG_file_type ]
27 !3 = !{!"0x11\0012\00producer\000\00\000\00\000", !10, !11, !11, !9, null, null} ; [ DW_TAG_compile_unit ]
28 !4 = !{!"0x15\00\000\000\000\000\000\000", !10, !2, null, !5, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
29 !5 = !{!6}
30 !6 = !{!"0x24\00int\000\0032\0032\000\000\005", !10, !2} ; [ DW_TAG_base_type ]
31 !7 = !{!"0xb\001\0030\000", !2, !1} ; [ DW_TAG_lexical_block ]
32 !8 = !{i32 4, i32 3, !7, null}
33 !9 = !{!1}
34 !10 = !{!"test.c", !"/dir"}
35 !11 = !{i32 0}
36 !12 = !{i32 1, !"Debug Info Version", i32 2}