1; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
2
3; CHECK: CodeViewDebugInfo [
4; CHECK:   Subsection [
5; CHECK:     LocalSym {
6; CHECK:       Type: wchar_t (0x71)
7; CHECK:       Flags [ (0x0)
8; CHECK:       ]
9; CHECK:       VarName: foo
10; CHECK:     }
11; CHECK:   Subsection [
12; CHECK:     SubSectionType: Symbols (0xF1)
13; CHECK:     UDTSym {
14; CHECK:       Type: wchar_t (0x71)
15; CHECK:       UDTName: XYZ
16; CHECK:     }
17; CHECK:   ]
18
19target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
20target triple = "i686-pc-windows-msvc18.0.0"
21
22define void @test1() !dbg !5 {
23entry:
24  %foo = alloca i16, align 2
25  call void @llvm.dbg.declare(metadata i16* %foo, metadata !8, metadata !11), !dbg !12
26  ret void, !dbg !12
27}
28
29declare void @llvm.dbg.declare(metadata, metadata, metadata)
30
31!llvm.dbg.cu = !{!0}
32!llvm.module.flags = !{!3, !4}
33
34!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, emissionKind: FullDebug)
35!1 = !DIFile(filename: "-", directory: "/usr/local/google/home/majnemer/llvm/src")
36!3 = !{i32 2, !"CodeView", i32 1}
37!4 = !{i32 2, !"Debug Info Version", i32 3}
38!5 = distinct !DISubprogram(name: "test1", linkageName: "test1", scope: !6, file: !6, type: !7, unit: !0, retainedNodes: !{})
39!6 = !DIFile(filename: "<stdin>", directory: ".")
40!7 = !DISubroutineType(types: !{})
41!8 = !DILocalVariable(name: "foo", scope: !5, file: !6, line: 3, type: !9)
42!9 = !DIDerivedType(tag: DW_TAG_typedef, name: "XYZ", file: !6, line: 2, baseType: !10)
43!10 = !DIBasicType(name: "wchar_t", size: 16, align: 16, encoding: DW_ATE_unsigned)
44!11 = !DIExpression()
45!12 = !DILocation(line: 3, column: 16, scope: !5)
46