blob: 04fe623a1bd84d892bf2a5e721084fd907f0d9ec [file] [log] [blame]
Adrian Prantl6a57daa2017-08-17 16:57:13 +00001; RUN: llc -O0 -mtriple=x86_64-unknown-linux-gnu -stop-before="regallocfast" -o - %s | FileCheck %s
2;
3; We check that all the instructions in bb4 now have a debug-location
4; annotation, and that the annotation is identical to the one on e.g.,
5; the jmp to bb4.
6;
7; CHECK: JMP{{.*}}%bb.4.entry, debug-location ![[JUMPLOC:[0-9]+]]
8; CHECK: bb.4.entry:
9; CHECK: successors:
10; CHECK-NOT: :
11; CHECK: JE{{.*}}debug-location ![[JUMPLOC]]
12; CHECK-NOT: :
13; CHECK: JMP{{.*}}debug-location ![[JUMPLOC]]
14
15define i32 @main() !dbg !12 {
16entry:
17 %add = add nsw i32 undef, 1, !dbg !16
18 switch i32 %add, label %sw.epilog [
19 i32 1, label %sw.bb
20 i32 2, label %sw.bb2
21 ], !dbg !17
22
23sw.bb: ; preds = %entry
24 br label %sw.epilog, !dbg !20
25
26sw.bb2: ; preds = %entry
27 br label %sw.epilog, !dbg !22
28
29sw.epilog: ; preds = %sw.bb2, %sw.bb, %entry
30 ret i32 4711, !dbg !23
31}
32!llvm.dbg.cu = !{!2}
33!llvm.module.flags = !{!8, !9}
34!llvm.ident = !{!11}
35
36!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, emissionKind: FullDebug, enums: !4)
37!3 = !DIFile(filename: "foo.c", directory: ".")
38!4 = !{}
39!7 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
40!8 = !{i32 2, !"Dwarf Version", i32 4}
41!9 = !{i32 2, !"Debug Info Version", i32 3}
42!11 = !{!"clang"}
43!12 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 4, type: !13, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
44!13 = !DISubroutineType(types: !14)
45!14 = !{!7}
46!16 = !DILocation(line: 6, column: 13, scope: !12)
47!17 = !DILocation(line: 6, column: 3, scope: !12)
48!19 = distinct !DILexicalBlock(scope: !12, file: !3, line: 7, column: 5)
49!20 = !DILocation(line: 10, column: 7, scope: !19)
50!22 = !DILocation(line: 13, column: 7, scope: !19)
51!23 = !DILocation(line: 24, column: 1, scope: !12)