Wolfgang Pieb | 56aa4b06 | 2016-05-02 22:50:51 +0000 | [diff] [blame] | 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' |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 31 | source_filename = "test/DebugInfo/X86/isel-cse-line.ll" |
Wolfgang Pieb | 56aa4b06 | 2016-05-02 22:50:51 +0000 | [diff] [blame] | 32 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 33 | target triple = "x86_64-unknown-linux-gnu" |
| 34 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 35 | @glb_start = global i64 17, align 8, !dbg !0 |
| 36 | @glb_end = global i64 42, align 8, !dbg !9 |
Wolfgang Pieb | 56aa4b06 | 2016-05-02 22:50:51 +0000 | [diff] [blame] | 37 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 38 | define i32 @main() !dbg !16 { |
Wolfgang Pieb | 56aa4b06 | 2016-05-02 22:50:51 +0000 | [diff] [blame] | 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 |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 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 |
| 59 | ret i32 0, !dbg !33 |
Wolfgang Pieb | 56aa4b06 | 2016-05-02 22:50:51 +0000 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | ; Function Attrs: nounwind readnone |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 63 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 |
Wolfgang Pieb | 56aa4b06 | 2016-05-02 22:50:51 +0000 | [diff] [blame] | 64 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 65 | attributes #0 = { nounwind readnone } |
Wolfgang Pieb | 56aa4b06 | 2016-05-02 22:50:51 +0000 | [diff] [blame] | 66 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 67 | !llvm.dbg.cu = !{!2} |
| 68 | !llvm.module.flags = !{!13, !14} |
| 69 | !llvm.ident = !{!15} |
| 70 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 71 | !0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 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} |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 80 | !9 = distinct !DIGlobalVariableExpression(var: !10, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 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, variables: !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 | |