38 lines · plain
1; RUN: opt -passes=loop-deletion %s -o /dev/null --pass-remarks-output=%t --pass-remarks-filter=loop-delete2; RUN: cat %t | FileCheck %s3 4; Check that we use the right debug location: the loop header.5; CHECK: --- !Passed6; CHECK-NEXT: Pass: loop-delete7; CHECK-NEXT: Name: Invariant8; CHECK-NEXT: DebugLoc: { File: loop.c, Line: 2, Column: 3 }9; CHECK-NEXT: Function: main10; CHECK-NEXT: Args:11; CHECK-NEXT: - String: Loop deleted because it is invariant12; CHECK-NEXT: ...13define i32 @main() local_unnamed_addr #0 {14entry:15 br label %for.cond, !dbg !916 17for.cond:18 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.cond ]19 %cmp = icmp ult i32 %i.0, 100020 %inc = add nuw nsw i32 %i.0, 121 br i1 %cmp, label %for.cond, label %for.cond.cleanup22 23for.cond.cleanup:24 ret i32 025}26 27!llvm.dbg.cu = !{!0}28!llvm.module.flags = !{!3}29 30!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2, nameTableKind: None, sysroot: "/")31!1 = !DIFile(filename: "loop.c", directory: "")32!2 = !{}33!3 = !{i32 2, !"Debug Info Version", i32 3}34!6 = distinct !DISubprogram(name: "main", scope: !7, file: !7, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)35!7 = !DIFile(filename: "loop.c", directory: "")36!8 = !DISubroutineType(types: !2)37!9 = !DILocation(line: 2, column: 3, scope: !6)38