xref: /aosp_15_r20/external/llvm/test/Transforms/LoopIdiom/debug-line.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt -loop-idiom < %s -S | FileCheck %s
2*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
3*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-darwin10.0.0"
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine void @foo(double* nocapture %a) nounwind ssp !dbg !0 {
7*9880d681SAndroid Build Coastguard Workerentry:
8*9880d681SAndroid Build Coastguard Worker  tail call void @llvm.dbg.value(metadata double* %a, i64 0, metadata !5, metadata !DIExpression()), !dbg !8
9*9880d681SAndroid Build Coastguard Worker  tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !10, metadata !DIExpression()), !dbg !14
10*9880d681SAndroid Build Coastguard Worker  br label %for.body
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Workerfor.body:                                         ; preds = %entry, %for.body
13*9880d681SAndroid Build Coastguard Worker  %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.body ]
14*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr double, double* %a, i64 %indvar
15*9880d681SAndroid Build Coastguard Worker; CHECK: call void @llvm.memset{{.+}} !dbg
16*9880d681SAndroid Build Coastguard Worker  store double 0.000000e+00, double* %arrayidx, align 8, !dbg !15
17*9880d681SAndroid Build Coastguard Worker  %indvar.next = add i64 %indvar, 1
18*9880d681SAndroid Build Coastguard Worker  %exitcond = icmp ne i64 %indvar.next, 1000
19*9880d681SAndroid Build Coastguard Worker  br i1 %exitcond, label %for.body, label %for.end, !dbg !14
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerfor.end:                                          ; preds = %for.body
22*9880d681SAndroid Build Coastguard Worker  tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !10, metadata !DIExpression()), !dbg !16
23*9880d681SAndroid Build Coastguard Worker  ret void, !dbg !17
24*9880d681SAndroid Build Coastguard Worker}
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!19}
31*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!2}
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker!0 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !18, scope: !1, type: !3)
34*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "li.c", directory: "/private/tmp")
35*9880d681SAndroid Build Coastguard Worker!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 127165:127174)", isOptimized: true, emissionKind: FullDebug, file: !18, enums: !9, retainedTypes: !9)
36*9880d681SAndroid Build Coastguard Worker!3 = !DISubroutineType(types: !4)
37*9880d681SAndroid Build Coastguard Worker!4 = !{null}
38*9880d681SAndroid Build Coastguard Worker!5 = !DILocalVariable(name: "a", line: 2, arg: 1, scope: !0, file: !1, type: !6)
39*9880d681SAndroid Build Coastguard Worker!6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !7)
40*9880d681SAndroid Build Coastguard Worker!7 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
41*9880d681SAndroid Build Coastguard Worker!8 = !DILocation(line: 2, column: 18, scope: !0)
42*9880d681SAndroid Build Coastguard Worker!9 = !{}
43*9880d681SAndroid Build Coastguard Worker!10 = !DILocalVariable(name: "i", line: 3, scope: !11, file: !1, type: !13)
44*9880d681SAndroid Build Coastguard Worker!11 = distinct !DILexicalBlock(line: 3, column: 3, file: !18, scope: !12)
45*9880d681SAndroid Build Coastguard Worker!12 = distinct !DILexicalBlock(line: 2, column: 21, file: !18, scope: !0)
46*9880d681SAndroid Build Coastguard Worker!13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
47*9880d681SAndroid Build Coastguard Worker!14 = !DILocation(line: 3, column: 3, scope: !12)
48*9880d681SAndroid Build Coastguard Worker!15 = !DILocation(line: 4, column: 5, scope: !11)
49*9880d681SAndroid Build Coastguard Worker!16 = !DILocation(line: 3, column: 29, scope: !11)
50*9880d681SAndroid Build Coastguard Worker!17 = !DILocation(line: 5, column: 1, scope: !12)
51*9880d681SAndroid Build Coastguard Worker!18 = !DIFile(filename: "li.c", directory: "/private/tmp")
52*9880d681SAndroid Build Coastguard Worker!19 = !{i32 1, !"Debug Info Version", i32 3}
53