37 lines · plain
1; RUN: llc -O0 < %s -mtriple=x86_64-unknown | FileCheck %s2; This was extracted from a swift debugger stepping testcase and checks that the3; fold (zext (load x)) -> (zext (truncate (zextload x)))4; rule propagates the SDLoc of the load to the zextload.5 6; CHECK: .loc {{.*}} main.swift:1007; CHECK-NOT: .loc8; CHECK: .loc {{.*}} main.swift:2009; CHECK-NOT: .loc10; CHECK: .loc {{.*}} main.swift:30011; CHECK-NOT: .loc12declare void @foo(double)13 14define i32 @zext_load(ptr %arg) !dbg !30 {15 %1 = getelementptr inbounds i8, ptr %arg, i32 116 %2 = load i8, ptr %1, align 1, !dbg !10017 %3 = uitofp i8 %2 to double, !dbg !20018 call void @foo(double %3), !dbg !20019 %4 = zext i8 %2 to i32, !dbg !30020 ret i32 %421}22!llvm.dbg.cu = !{!1}23!llvm.module.flags = !{!0}24 25!0 = !{i32 2, !"Debug Info Version", i32 3}26!1 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !3, isOptimized: false, emissionKind: FullDebug)27!2 = !DIModule(scope: null, name: "test", includePath: "")28!3 = !DIFile(filename: "main.swift", directory: "/")29 30!30 = distinct !DISubprogram(name: "main", scope: !2, file: !3, line: 1, type: !31, isLocal: false, isDefinition: true, isOptimized: false, unit: !1)31!31 = !DISubroutineType(types: !32)32!32 = !{}33 34!100 = !DILocation(line: 100, scope: !30)35!200 = !DILocation(line: 200, scope: !30)36!300 = !DILocation(line: 300, scope: !30)37