Reapply r257105 "[Verifier] Check that debug values have proper size"
[oota-llvm.git] / test / CodeGen / MIR / X86 / invalid-metadata-node-type.mir
1 # RUN: not llc -march=x86-64 -start-after machine-sink -stop-after machine-sink -o /dev/null %s 2>&1 | FileCheck %s
2 --- |
3   declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
4
5   define void @foo() #1 {
6   entry:
7     %x.i = alloca i8, align 1
8     %y.i = alloca [256 x i8], align 16
9     %0 = bitcast i8* %x.i to i8*
10     br label %for.body
11
12   for.body:
13     %1 = bitcast [256 x i8]* %y.i to i8*
14     call void @llvm.dbg.declare(metadata i8* %0, metadata !4, metadata !7) #3, !dbg !8
15     br label %for.body
16   }
17
18   attributes #0 = { nounwind readnone }
19   attributes #1 = { nounwind ssp uwtable }
20   attributes #3 = { nounwind }
21
22   !llvm.dbg.cu = !{!0}
23   !llvm.module.flags = !{!3}
24
25   !0 = distinct !DICompileUnit(language: DW_LANG_C89, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: 0, enums: !2, retainedTypes: !2)
26   !1 = !DIFile(filename: "t.c", directory: "")
27   !2 = !{}
28   !3 = !{i32 1, !"Debug Info Version", i32 3}
29   !4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !6)
30   !5 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false)
31   !6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
32   !7 = !DIExpression()
33   !8 = !DILocation(line: 0, scope: !5)
34 ...
35 ---
36 name:            foo
37 isSSA:           true
38 tracksRegLiveness: true
39 frameInfo:
40   maxAlignment:    16
41 stack:
42 # CHECK: [[@LINE+1]]:75: expected a reference to a 'DILocalVariable' metadata node
43   - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!8',
44       di-expression: '!7', di-location: '!8' }
45 body: |
46   bb.0.entry:
47     successors: %bb.1.for.body
48   bb.1.for.body:
49     successors: %bb.1.for.body
50
51     DBG_VALUE %stack.0.y.i, 0, !4, !7, debug-location !8
52     JMP_1 %bb.1.for.body
53 ...