Add a testcase for r103135, explicitly representing unknown
[oota-llvm.git] / test / CodeGen / X86 / unknown-location.ll
1 ; RUN: llc < %s -asm-verbose=false -march=x86-64 | FileCheck %s
2
3 ; The divide instruction does not have a debug location. CodeGen should
4 ; represent this in the debug information. This is checked by a check
5 ; for a label between the code for the add and the code for the divide,
6 ; which indicates that the add's location doesn't spill over unto the
7 ; divide.
8
9 ;      CHECK: Ltmp
10 ;      CHECK:         movl    %edx, %r8d
11 ; CHECK-NEXT:         leal    (%rdi,%rsi), %eax
12 ; CHECK-NEXT: Ltmp
13 ; CHECK-NEXT:         cltd
14 ; CHECK-NEXT:         idivl   %r8d
15 ; CHECK-NEXT: Ltmp
16 ; CHECK-NEXT:         addl    %ecx, %eax
17 ; CHECK-NEXT:         ret
18 ; CHECK-NEXT: Ltmp
19
20 define i32 @foo(i32 %w, i32 %x, i32 %y, i32 %z) nounwind {
21 entry:
22   %a = add  i32 %w, %x, !dbg !8
23   %b = sdiv i32 %a, %y
24   %c = add  i32 %b, %z, !dbg !8
25   ret i32 %c, !dbg !8
26 }
27
28 !0 = metadata !{i32 524545, metadata !1, metadata !"x", metadata !2, i32 1, metadata !6} ; [ DW_TAG_arg_variable ]
29 !1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"foo", metadata !"foo", metadata !"foo", metadata !2, i32 1, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
30 !2 = metadata !{i32 524329, metadata !"test.c", metadata !"/dir", metadata !3} ; [ DW_TAG_file_type ]
31 !3 = metadata !{i32 524305, i32 0, i32 12, metadata !"test.c", metadata !".", metadata !"producer", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
32 !4 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !5, i32 0, null} ; [ DW_TAG_subroutine_type ]
33 !5 = metadata !{metadata !6}
34 !6 = metadata !{i32 524324, metadata !2, metadata !"int", metadata !2, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
35 !7 = metadata !{i32 524299, metadata !1, i32 1, i32 30} ; [ DW_TAG_lexical_block ]
36 !8 = metadata !{i32 4, i32 3, metadata !7, null}