brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · c50d406 Raw
42 lines · plain
1; Check that a DISubrange built with an older version of LLVM is correctly restored.2; RUN: llvm-dis < %s.bc | FileCheck %s3; RUN: llvm-dis < %s.bc | llvm-as | llvm-dis | FileCheck %s4 5define void @foo(i32 %n) {6entry:7  %array = alloca i32, i64 42, align 168  call void @llvm.dbg.declare(metadata i32* %array, metadata !19, metadata !12), !dbg !189  ret void10}11 12declare void @llvm.dbg.declare(metadata, metadata, metadata) #113 14!llvm.dbg.cu = !{!0}15!llvm.module.flags = !{!3, !4, !5}16!llvm.ident = !{!6}17 18!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 5.0.1", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)19!1 = !DIFile(filename: "vla.c", directory: "/path/to")20!2 = !{}21!3 = !{i32 2, !"Dwarf Version", i32 4}22!4 = !{i32 2, !"Debug Info Version", i32 3}23!5 = !{i32 1, !"wchar_size", i32 4}24!6 = !{!"clang version 5.0.1"}25!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 20, type: !8, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !11)26!8 = !DISubroutineType(types: !9)27!9 = !{null, !10}28!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)29!11 = !{!16, !19}30!12 = !DIExpression()31!16 = !DILocalVariable(name: "vla_expr", scope: !7, file: !1, line: 21, type: !17)32!17 = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned)33!18 = !DILocation(line: 21, column: 7, scope: !7)34!19 = !DILocalVariable(name: "array", scope: !7, file: !1, line: 21, type: !20)35!20 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, align: 32, elements: !21)36!21 = !{!22}37; CHECK-DAG: ![[NODE:[0-9]+]] = !DILocalVariable(name: "array"38; CHECK-DAG: ![[CONST:[0-9]+]] = !DISubrange(count: 42, lowerBound: 1)39; CHECK-DAG: ![[MULTI:[0-9]+]] = !{![[CONST]]}40; CHECK-DAG: elements: ![[MULTI]]41!22 = !DISubrange(count: 42, lowerBound: 1)42