xref: /llvm-project/llvm/test/Verifier/RemoveDI/invalid-disubrange-count-node.ll (revision 464d9d96b3565ead06396ffb8d02b4dcf9cb9556)
1; RUN: llvm-as < %s -disable-output 2>&1 | FileCheck %s
2
3define void @foo(i32 %n) {
4entry:
5  %0 = zext i32 %n to i64
6  %vla = alloca i32, i64 %0, align 16
7    #dbg_declare(ptr %vla, !19, !DIExpression(), !18)
8  ret void
9}
10
11
12!llvm.dbg.cu = !{!0}
13!llvm.module.flags = !{!3, !4, !5}
14!llvm.ident = !{!6}
15
16!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 5.0.1", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
17!1 = !DIFile(filename: "vla.c", directory: "/path/to")
18!2 = !{}
19!3 = !{i32 2, !"Dwarf Version", i32 4}
20!4 = !{i32 2, !"Debug Info Version", i32 3}
21!5 = !{i32 1, !"wchar_size", i32 4}
22!6 = !{!"clang version 5.0.1"}
23!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)
24!8 = !DISubroutineType(types: !9)
25!9 = !{null, !10}
26!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
27!11 = !{!16, !19}
28!12 = !DIExpression()
29!16 = !DILocalVariable(name: "vla_expr", scope: !7, file: !1, line: 21, type: !17)
30!17 = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned)
31!18 = !DILocation(line: 21, column: 7, scope: !7)
32!19 = !DILocalVariable(name: "vla", scope: !7, file: !1, line: 21, type: !20)
33!20 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, align: 32, elements: !21)
34!21 = !{!22}
35; CHECK: Count must be signed constant or DIVariable or DIExpression
36!22 = !DISubrange(count: !17)
37