b38b6c4b80da81d4b0caf5d1d8c3b62fd2994563
[oota-llvm.git] / test / CodeGen / MIR / X86 / unknown-metadata-node.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 --- |
4
5   define i32 @test(i32 %x) #0 {
6   entry:
7     %x.addr = alloca i32, align 4
8     store i32 %x, i32* %x.addr, align 4
9     call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !13), !dbg !14
10     %0 = load i32, i32* %x.addr, align 4, !dbg !15
11     ret i32 %0, !dbg !15
12   }
13
14   declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
15
16   attributes #0 = { nounwind "no-frame-pointer-elim"="false" }
17   attributes #1 = { nounwind readnone }
18
19   !llvm.dbg.cu = !{!0}
20   !llvm.module.flags = !{!9, !10}
21   !llvm.ident = !{!11}
22
23   !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
24   !1 = !DIFile(filename: "test.ll", directory: "")
25   !2 = !{}
26   !3 = !{!4}
27   !4 = !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, function: i32 (i32)* @test, variables: !2)
28   !5 = !DIFile(filename: "test.c", directory: "")
29   !6 = !DISubroutineType(types: !7)
30   !7 = !{!8, !8}
31   !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
32   !9 = !{i32 2, !"Dwarf Version", i32 4}
33   !10 = !{i32 2, !"Debug Info Version", i32 3}
34   !11 = !{!"clang version 3.7.0"}
35   !12 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !5, line: 4, type: !8)
36   !13 = !DIExpression()
37   !14 = !DILocation(line: 4, scope: !4)
38   !15 = !DILocation(line: 8, scope: !4)
39
40 ...
41 ---
42 name:            test
43 isSSA:           true
44 tracksRegLiveness: true
45 registers:
46   - { id: 0, class: gr32 }
47 frameInfo:
48   maxAlignment:  4
49 stack:
50   - { id: 0, name: x.addr, size: 4, alignment: 4 }
51 body: |
52   bb.0.entry:
53     %0 = COPY %edi
54     ; CHECK: [[@LINE+1]]:21: use of undefined metadata '!42'
55     DBG_VALUE _, 0, !42, !13
56     MOV32mr %stack.0.x.addr, 1, _, 0, _, %0
57     %eax = COPY %0
58     RETQ %eax
59 ...