brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · 805f6d7 Raw
106 lines · plain
1; RUN: llc -filetype=asm -fast-isel=false -O0 < %s | FileCheck %s2;3; Generated by:4; clang -emit-llvm -S -g test.cpp5 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 numbers24; from such nodes are not propagated. Doing so results in oscillating line numbers.25 26; CHECK: .loc 1 1227; CHECK: .loc 1 1328; CHECK-NOT: .loc 1 1229 30; ModuleID = 't.cpp'31source_filename = "test/DebugInfo/X86/isel-cse-line.ll"32target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"33target triple = "x86_64-unknown-linux-gnu"34 35@glb_start = global i64 17, align 8, !dbg !036@glb_end = global i64 42, align 8, !dbg !937 38define i32 @main() !dbg !16 {39  %1 = alloca i32, align 440  %2 = alloca i64, align 841  %3 = alloca i64, align 842  %4 = alloca double, align 843  %5 = alloca double, align 844  store i32 0, ptr %1, align 445  call void @llvm.dbg.declare(metadata ptr %2, metadata !20, metadata !21), !dbg !2246  %6 = load i64, ptr @glb_start, align 8, !dbg !2347  store i64 %6, ptr %2, align 8, !dbg !2248  call void @llvm.dbg.declare(metadata ptr %3, metadata !24, metadata !21), !dbg !2549  %7 = load i64, ptr @glb_end, align 8, !dbg !2650  store i64 %7, ptr %3, align 8, !dbg !2551  call void @llvm.dbg.declare(metadata ptr %4, metadata !27, metadata !21), !dbg !2852  %8 = load i64, ptr %2, align 8, !dbg !2953  %9 = uitofp i64 %8 to double, !dbg !2954  store double %9, ptr %4, align 8, !dbg !2855  call void @llvm.dbg.declare(metadata ptr %5, metadata !30, metadata !21), !dbg !3156  %10 = load i64, ptr %3, align 8, !dbg !3257  %11 = uitofp i64 %10 to double, !dbg !3258  store double %11, ptr %5, align 8, !dbg !3159  ret i32 0, !dbg !3360}61 62; Function Attrs: nounwind readnone63declare void @llvm.dbg.declare(metadata, metadata, metadata) #064 65attributes #0 = { nounwind readnone }66 67!llvm.dbg.cu = !{!2}68!llvm.module.flags = !{!13, !14}69!llvm.ident = !{!15}70 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")75!4 = !{}76!5 = !{!6}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)79!8 = !{!0, !9}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)89!18 = !{!19}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)92!21 = !DIExpression()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)105 106