1 ; RUN: llc -filetype=asm -fast-isel=false -O0 < %s | FileCheck %s
4 ; clang -emit-llvm -S -g test.cpp
7 ; typedef unsigned long int_t;
9 ; int_t glb_start = 17;
14 ; int_t start = glb_start;
15 ; int_t end = glb_end;
17 ; fp_t dbl_start = (fp_t) start;
18 ; fp_t dbl_end = (fp_t) end;
23 ; SelectionDAG performs CSE on constant pool loads. Make sure line numbers
24 ; from such nodes are not propagated. Doing so results in oscillating line numbers.
28 ; CHECK-NOT: .loc 1 12
31 source_filename = "test/DebugInfo/X86/isel-cse-line.ll"
32 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
33 target triple = "x86_64-unknown-linux-gnu"
35 @glb_start = global i64 17, align 8, !dbg !0
36 @glb_end = global i64 42, align 8, !dbg !9
38 define i32 @main() !dbg !16 {
39 %1 = alloca i32, align 4
40 %2 = alloca i64, align 8
41 %3 = alloca i64, align 8
42 %4 = alloca double, align 8
43 %5 = alloca double, align 8
44 store i32 0, i32* %1, align 4
45 call void @llvm.dbg.declare(metadata i64* %2, metadata !20, metadata !21), !dbg !22
46 %6 = load i64, i64* @glb_start, align 8, !dbg !23
47 store i64 %6, i64* %2, align 8, !dbg !22
48 call void @llvm.dbg.declare(metadata i64* %3, metadata !24, metadata !21), !dbg !25
49 %7 = load i64, i64* @glb_end, align 8, !dbg !26
50 store i64 %7, i64* %3, align 8, !dbg !25
51 call void @llvm.dbg.declare(metadata double* %4, metadata !27, metadata !21), !dbg !28
52 %8 = load i64, i64* %2, align 8, !dbg !29
53 %9 = uitofp i64 %8 to double, !dbg !29
54 store double %9, double* %4, align 8, !dbg !28
55 call void @llvm.dbg.declare(metadata double* %5, metadata !30, metadata !21), !dbg !31
56 %10 = load i64, i64* %3, align 8, !dbg !32
57 %11 = uitofp i64 %10 to double, !dbg !32
58 store double %11, double* %5, align 8, !dbg !31
62 ; Function Attrs: nounwind readnone
63 declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
65 attributes #0 = { nounwind readnone }
68 !llvm.module.flags = !{!13, !14}
71 !0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
72 !1 = !DIGlobalVariable(name: "glb_start", scope: !2, file: !3, line: 4, type: !11, isLocal: false, isDefinition: true)
73 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 268246)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !5, globals: !8)
74 !3 = !DIFile(filename: "/home/wpieb/test/D12094.cpp", directory: "/home/wpieb/build/llvm/trunk/llvm-RelWithDebInfo")
77 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "fp_t", file: !3, line: 1, baseType: !7)
78 !7 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)
80 !9 = distinct !DIGlobalVariableExpression(var: !10, expr: !DIExpression())
81 !10 = !DIGlobalVariable(name: "glb_end", scope: !2, file: !3, line: 5, type: !11, isLocal: false, isDefinition: true)
82 !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "int_t", file: !3, line: 2, baseType: !12)
83 !12 = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
84 !13 = !{i32 2, !"Dwarf Version", i32 4}
85 !14 = !{i32 2, !"Debug Info Version", i32 3}
86 !15 = !{!"clang version 3.9.0 (trunk 268246)"}
87 !16 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 7, type: !17, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
88 !17 = !DISubroutineType(types: !18)
90 !19 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
91 !20 = !DILocalVariable(name: "start", scope: !16, file: !3, line: 9, type: !11)
93 !22 = !DILocation(line: 9, column: 9, scope: !16)
94 !23 = !DILocation(line: 9, column: 17, scope: !16)
95 !24 = !DILocalVariable(name: "end", scope: !16, file: !3, line: 10, type: !11)
96 !25 = !DILocation(line: 10, column: 9, scope: !16)
97 !26 = !DILocation(line: 10, column: 17, scope: !16)
98 !27 = !DILocalVariable(name: "dbl_start", scope: !16, file: !3, line: 12, type: !6)
99 !28 = !DILocation(line: 12, column: 8, scope: !16)
100 !29 = !DILocation(line: 12, column: 27, scope: !16)
101 !30 = !DILocalVariable(name: "dbl_end", scope: !16, file: !3, line: 13, type: !6)
102 !31 = !DILocation(line: 13, column: 8, scope: !16)
103 !32 = !DILocation(line: 13, column: 27, scope: !16)
104 !33 = !DILocation(line: 15, column: 3, scope: !16)