1 ; RUN: opt -passes=loop-deletion %s -o /dev/null --pass-remarks-output=%t --pass-remarks-filter=loop-delete
2 ; RUN: cat %t | FileCheck %s
4 ; Check that we use the right debug location: the loop header.
6 ; CHECK-NEXT: Pass: loop-delete
7 ; CHECK-NEXT: Name: Invariant
8 ; CHECK-NEXT: DebugLoc: { File: loop.c, Line: 2, Column: 3 }
9 ; CHECK-NEXT: Function: main
11 ; CHECK-NEXT: - String: Loop deleted because it is invariant
13 define i32 @main() local_unnamed_addr #0 {
15 br label %for.cond, !dbg !9
18 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.cond ]
19 %cmp = icmp ult i32 %i.0, 1000
20 %inc = add nuw nsw i32 %i.0, 1
21 br i1 %cmp, label %for.cond, label %for.cond.cleanup
28 !llvm.module.flags = !{!3}
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: "")
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)