1; RUN: opt -instcombine -S -o - %s | FileCheck %s
2
3declare dso_local i32 @bar(i8*)
4
5; Function Attrs: nounwind
6define internal i32 @foo() #0 !dbg !1 {
7; CHECK:  %[[VLA:.*]] = alloca [2 x i32]
8; CHECK:  call void @llvm.dbg.declare(metadata [2 x i32]* %[[VLA]], {{.*}}, metadata !DIExpression())
9
10entry:
11  %vla = alloca i32, i64 2, align 4, !dbg !16
12  call void @llvm.dbg.declare(metadata i32* %vla, metadata !19, metadata !DIExpression()), !dbg !20
13  %0 = bitcast i32* %vla to i8*, !dbg !21
14  %call = call i32 @bar(i8* %0), !dbg !22
15  unreachable
16}
17
18; Function Attrs: nounwind readnone speculatable
19declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
20
21attributes #0 = { nounwind }
22attributes #1 = { nounwind readnone speculatable }
23
24!llvm.dbg.cu = !{!5}
25!llvm.module.flags = !{!0}
26
27!0 = !{i32 2, !"Debug Info Version", i32 3}
28!1 = distinct !DISubprogram(name: "a", scope: !2, file: !2, line: 232, type: !3, isLocal: true, isDefinition: true, scopeLine: 234, flags: DIFlagPrototyped, isOptimized: true, unit: !5, retainedNodes: !6)
29!2 = !DIFile(filename: "b", directory: "c")
30!3 = !DISubroutineType(types: !4)
31!4 = !{}
32!5 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !4)
33!6 = !{!7, !11}
34!7 = !DILocalVariable(name: "__vla_expr", scope: !8, type: !10, flags: DIFlagArtificial)
35!8 = distinct !DILexicalBlock(scope: !9, file: !2, line: 238, column: 39)
36!9 = distinct !DILexicalBlock(scope: !1, file: !2, line: 238, column: 6)
37!10 = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned)
38!11 = !DILocalVariable(name: "ptr32", scope: !8, file: !2, line: 240, type: !12)
39!12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, elements: !14)
40!13 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
41!14 = !{!15}
42!15 = !DISubrange(count: !7)
43!16 = !DILocation(line: 240, column: 3, scope: !17)
44!17 = distinct !DILexicalBlock(scope: !18, file: !2, line: 238, column: 39)
45!18 = distinct !DILexicalBlock(scope: !1, file: !2, line: 238, column: 6)
46!19 = !DILocalVariable(name: "ptr32", scope: !17, file: !2, line: 240, type: !12)
47!20 = !DILocation(line: 240, column: 12, scope: !17)
48!21 = !DILocation(line: 241, column: 65, scope: !17)
49!22 = !DILocation(line: 241, column: 11, scope: !17)
50