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