• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -disable-basic-aa -enable-new-pm=0 -print-memoryssa -disable-output %s 2>&1 | FileCheck %s
2
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.
6
7target triple = "x86_64-unknown-linux-gnu"
8
9; CHECK-LABEL: @overflow_iter_var
10; CHECK-NOT: MemoryDef
11define void @overflow_iter_var() !dbg !11 {
12entry:
13  call void @llvm.dbg.value(metadata i16 0, metadata !16, metadata !DIExpression()), !dbg !18
14  br label %for.cond
15
16for.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
20
21for.body:                                         ; preds = %for.cond
22  %0 = load i16, i16* undef, align 1
23  br label %for.cond
24
25for.end:                                          ; preds = %for.cond
26  ret void
27}
28
29; Function Attrs: nounwind readnone speculatable willreturn
30declare void @llvm.dbg.value(metadata, metadata, metadata) #1
31
32attributes #1 = { nounwind readnone speculatable willreturn }
33
34!llvm.dbg.cu = !{!0}
35!llvm.module.flags = !{!10}
36
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: "/")
39!2 = !{}
40!3 = !{}
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)
43!8 = !{!9}
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)
55