1; RUN: llc -filetype=asm -fast-isel=false -O0 < %s | FileCheck %s 2; 3; Generated by: 4; clang -emit-llvm -S -g test.cpp 5 6; typedef double fp_t; 7; typedef unsigned long int_t; 8; 9; int_t glb_start = 17; 10; int_t glb_end = 42; 11; 12; int main() 13; { 14; int_t start = glb_start; 15; int_t end = glb_end; 16; 17; fp_t dbl_start = (fp_t) start; 18; fp_t dbl_end = (fp_t) end; 19; 20; return 0; 21; } 22 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. 25 26; CHECK: .loc 1 12 27; CHECK: .loc 1 13 28; CHECK-NOT: .loc 1 12 29 30; ModuleID = 't.cpp' 31target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 32target triple = "x86_64-unknown-linux-gnu" 33 34@glb_start = global i64 17, align 8 35@glb_end = global i64 42, align 8 36 37; Function Attrs: norecurse nounwind uwtable 38define i32 @main() !dbg !14 { 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 !18, metadata !19), !dbg !20 46 %6 = load i64, i64* @glb_start, align 8, !dbg !21 47 store i64 %6, i64* %2, align 8, !dbg !20 48 call void @llvm.dbg.declare(metadata i64* %3, metadata !22, metadata !19), !dbg !23 49 %7 = load i64, i64* @glb_end, align 8, !dbg !24 50 store i64 %7, i64* %3, align 8, !dbg !23 51 call void @llvm.dbg.declare(metadata double* %4, metadata !25, metadata !19), !dbg !26 52 %8 = load i64, i64* %2, align 8, !dbg !27 53 %9 = uitofp i64 %8 to double, !dbg !27 54 store double %9, double* %4, align 8, !dbg !26 55 call void @llvm.dbg.declare(metadata double* %5, metadata !28, metadata !19), !dbg !29 56 %10 = load i64, i64* %3, align 8, !dbg !30 57 %11 = uitofp i64 %10 to double, !dbg !30 58 store double %11, double* %5, align 8, !dbg !29 59 ret i32 0, !dbg !31 60} 61 62; Function Attrs: nounwind readnone 63declare void @llvm.dbg.declare(metadata, metadata, metadata) 64 65!llvm.dbg.cu = !{!0} 66!llvm.module.flags = !{!11, !12} 67!llvm.ident = !{!13} 68 69!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 268246)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !6) 70!1 = !DIFile(filename: "/home/wpieb/test/D12094.cpp", directory: "/home/wpieb/build/llvm/trunk/llvm-RelWithDebInfo") 71!2 = !{} 72!3 = !{!4} 73!4 = !DIDerivedType(tag: DW_TAG_typedef, name: "fp_t", file: !1, line: 1, baseType: !5) 74!5 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) 75!6 = !{!7, !10} 76!7 = distinct !DIGlobalVariable(name: "glb_start", scope: !0, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, variable: i64* @glb_start) 77!8 = !DIDerivedType(tag: DW_TAG_typedef, name: "int_t", file: !1, line: 2, baseType: !9) 78!9 = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) 79!10 = distinct !DIGlobalVariable(name: "glb_end", scope: !0, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, variable: i64* @glb_end) 80!11 = !{i32 2, !"Dwarf Version", i32 4} 81!12 = !{i32 2, !"Debug Info Version", i32 3} 82!13 = !{!"clang version 3.9.0 (trunk 268246)"} 83!14 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !15, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2) 84!15 = !DISubroutineType(types: !16) 85!16 = !{!17} 86!17 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 87!18 = !DILocalVariable(name: "start", scope: !14, file: !1, line: 9, type: !8) 88!19 = !DIExpression() 89!20 = !DILocation(line: 9, column: 9, scope: !14) 90!21 = !DILocation(line: 9, column: 17, scope: !14) 91!22 = !DILocalVariable(name: "end", scope: !14, file: !1, line: 10, type: !8) 92!23 = !DILocation(line: 10, column: 9, scope: !14) 93!24 = !DILocation(line: 10, column: 17, scope: !14) 94!25 = !DILocalVariable(name: "dbl_start", scope: !14, file: !1, line: 12, type: !4) 95!26 = !DILocation(line: 12, column: 8, scope: !14) 96!27 = !DILocation(line: 12, column: 27, scope: !14) 97!28 = !DILocalVariable(name: "dbl_end", scope: !14, file: !1, line: 13, type: !4) 98!29 = !DILocation(line: 13, column: 8, scope: !14) 99!30 = !DILocation(line: 13, column: 27, scope: !14) 100!31 = !DILocation(line: 15, column: 3, scope: !14) 101