1; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
2
3; Use character types for all 8-bit integers. The VS debugger doesn't cope well
4; with the T_[U]INT1 types. Non-C language frontends are likely use the normal
5; DW_ATE_[un]signed encoding for all integer types if they don't have distinct
6; integer types for characters types. This was PR30552.
7
8; CHECK-LABEL: GlobalData {
9; CHECK-NEXT:    Kind: S_GDATA32 (0x110D)
10; CHECK-NEXT:    DataOffset:
11; CHECK-NEXT:    Type: signed char (0x10)
12; CHECK-NEXT:    DisplayName: x
13; CHECK-NEXT:    LinkageName: x
14; CHECK-NEXT:  }
15
16; CHECK-LABEL: GlobalData {
17; CHECK-NEXT:    Kind: S_GDATA32 (0x110D)
18; CHECK-NEXT:    DataOffset:
19; CHECK-NEXT:    Type: unsigned char (0x20)
20; CHECK-NEXT:    DisplayName: y
21; CHECK-NEXT:    LinkageName: y
22; CHECK-NEXT:  }
23
24source_filename = "-"
25target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
26target triple = "x86_64-pc-windows-msvc19.0.24210"
27
28@x = global i8 0, align 1, !dbg !0
29@y = global i8 0, align 1, !dbg !6
30
31!llvm.dbg.cu = !{!2}
32!llvm.module.flags = !{!13, !14, !15}
33!llvm.ident = !{!16}
34
35!0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
36!1 = !DIGlobalVariable(name: "x", scope: !2, file: !8, line: 4, type: !11, isLocal: false, isDefinition: true)
37!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 4.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
38!3 = !DIFile(filename: "-", directory: "C:\5Csrc\5Cllvm\5Cbuild")
39!4 = !{}
40!5 = !{!0, !6}
41!6 = distinct !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
42!7 = !DIGlobalVariable(name: "y", scope: !2, file: !8, line: 5, type: !9, isLocal: false, isDefinition: true)
43!8 = !DIFile(filename: "<stdin>", directory: "C:\5Csrc\5Cllvm\5Cbuild")
44!9 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint8_t", file: !8, line: 3, baseType: !10)
45!10 = !DIBasicType(size: 8, align: 8, encoding: DW_ATE_unsigned)
46!11 = !DIDerivedType(tag: DW_TAG_typedef, name: "int8_t", file: !8, line: 2, baseType: !12)
47!12 = !DIBasicType(size: 8, align: 8, encoding: DW_ATE_signed)
48!13 = !{i32 2, !"CodeView", i32 1}
49; Manually modified to use DW_ATE_unsigned
50!14 = !{i32 2, !"Debug Info Version", i32 3}
51!15 = !{i32 1, !"PIC Level", i32 2}
52; Manually modified to use DW_ATE_signed
53!16 = !{!"clang version 4.0.0 "}
54
55