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