1 ; RUN: opt -disable-basicaa -print-memoryssa -disable-output %s 2>&1 | FileCheck %s
3 ; Note that the test crashes the MemorySSA verification when doing loop-rotate,
4 ; if debuginfo is modelled in MemorySSA, due to the fact that MemorySSA is not
5 ; updated when adding/removing debuginfo intrinsics.
7 target triple = "x86_64-unknown-linux-gnu"
9 ; CHECK-LABEL: @overflow_iter_var
10 ; CHECK-NOT: MemoryDef
11 define void @overflow_iter_var() !dbg !11 {
13 call void @llvm.dbg.value(metadata i16 0, metadata !16, metadata !DIExpression()), !dbg !18
16 for.cond: ; preds = %for.body, %entry
17 call void @llvm.dbg.value(metadata i16 0, metadata !16, metadata !DIExpression()), !dbg !18
18 call void @llvm.dbg.value(metadata i16 undef, metadata !20, metadata !DIExpression()), !dbg !21
19 br i1 undef, label %for.end, label %for.body
21 for.body: ; preds = %for.cond
22 %0 = load i16, i16* undef, align 1
25 for.end: ; preds = %for.cond
29 ; Function Attrs: nounwind readnone speculatable willreturn
30 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
32 attributes #1 = { nounwind readnone speculatable willreturn }
35 !llvm.module.flags = !{!10}
37 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 10.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3, nameTableKind: None)
38 !1 = !DIFile(filename: "2_loops.c", directory: "/")
41 !6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 4096, elements: !8)
42 !7 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
44 !9 = !DISubrange(count: 256)
45 !10 = !{i32 2, !"Debug Info Version", i32 3}
46 !11 = distinct !DISubprogram(name: "overflow_iter_var", scope: !1, file: !1, line: 20, type: !12, scopeLine: 21, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
47 !12 = !DISubroutineType(types: !13)
48 !13 = !{null, !14, !14}
49 !14 = !DIBasicType(name: "unsigned int", size: 16, encoding: DW_ATE_unsigned)
50 !16 = !DILocalVariable(name: "i", scope: !17, file: !1, line: 23, type: !14)
51 !17 = distinct !DILexicalBlock(scope: !11, file: !1, line: 23, column: 3)
52 !18 = !DILocation(line: 0, scope: !17)
53 !20 = !DILocalVariable(name: "stop1", arg: 1, scope: !11, file: !1, line: 20, type: !14)
54 !21 = !DILocation(line: 0, scope: !11)