1 ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
3 ; Tests that CodeView integer types are generated even when using Clang's old integer type names.
5 ; C++ source to regenerate:
7 ; void usevars(long, ...);
10 ; unsigned long l2 = 0;
13 ; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll -target x86_64-pc-windows-msvc19.0.23918
16 ; CHECK: Type: long (0x12)
20 ; CHECK: Type: unsigned long (0x22)
24 ; ModuleID = '/usr/local/google/home/blaikie/dev/scratch/t.cpp'
25 source_filename = "/usr/local/google/home/blaikie/dev/scratch/t.cpp"
26 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
27 target triple = "x86_64-pc-windows-msvc19.0.23918"
29 ; Function Attrs: mustprogress noinline optnone uwtable
30 define dso_local void @"?f@@YAXXZ"() #0 !dbg !8 {
32 %l1 = alloca i32, align 4
33 %l2 = alloca i32, align 4
34 call void @llvm.dbg.declare(metadata i32* %l1, metadata !13, metadata !DIExpression()), !dbg !15
35 store i32 0, i32* %l1, align 4, !dbg !15
36 call void @llvm.dbg.declare(metadata i32* %l2, metadata !16, metadata !DIExpression()), !dbg !18
37 store i32 0, i32* %l2, align 4, !dbg !18
38 %0 = load i32, i32* %l2, align 4, !dbg !19
39 %1 = load i32, i32* %l1, align 4, !dbg !19
40 call void (i32, ...) @"?usevars@@YAXJZZ"(i32 %1, i32 %0), !dbg !19
44 ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
45 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
47 declare dso_local void @"?usevars@@YAXJZZ"(i32, ...) #2
49 attributes #0 = { mustprogress noinline optnone uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
50 attributes #1 = { nofree nosync nounwind readnone speculatable willreturn }
51 attributes #2 = { "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
54 !llvm.module.flags = !{!2, !3, !4, !5, !6}
57 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 14.0.0 (git@github.com:llvm/llvm-project.git 3709fb72c86bea1f0e6c51ab334ed6417cbe1c07)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
58 !1 = !DIFile(filename: "/usr/local/google/home/blaikie/dev/scratch/t.cpp", directory: "/usr/local/google/home/blaikie/dev/llvm/src", checksumkind: CSK_MD5, checksum: "a8e7ccc989ea91d67d3cb95afa046aa5")
59 !2 = !{i32 2, !"CodeView", i32 1}
60 !3 = !{i32 2, !"Debug Info Version", i32 3}
61 !4 = !{i32 1, !"wchar_size", i32 2}
62 !5 = !{i32 7, !"PIC Level", i32 2}
63 !6 = !{i32 7, !"uwtable", i32 1}
64 !7 = !{!"clang version 14.0.0 (git@github.com:llvm/llvm-project.git 3709fb72c86bea1f0e6c51ab334ed6417cbe1c07)"}
65 !8 = distinct !DISubprogram(name: "f", linkageName: "?f@@YAXXZ", scope: !9, file: !9, line: 2, type: !10, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12)
66 !9 = !DIFile(filename: "scratch/t.cpp", directory: "/usr/local/google/home/blaikie/dev", checksumkind: CSK_MD5, checksum: "a8e7ccc989ea91d67d3cb95afa046aa5")
67 !10 = !DISubroutineType(types: !11)
70 !13 = !DILocalVariable(name: "l1", scope: !8, file: !9, line: 3, type: !14)
71 !14 = !DIBasicType(name: "long int", size: 32, encoding: DW_ATE_signed)
72 !15 = !DILocation(line: 3, scope: !8)
73 !16 = !DILocalVariable(name: "l2", scope: !8, file: !9, line: 4, type: !17)
74 !17 = !DIBasicType(name: "long unsigned int", size: 32, encoding: DW_ATE_unsigned)
75 !18 = !DILocation(line: 4, scope: !8)
76 !19 = !DILocation(line: 5, scope: !8)
77 !20 = !DILocation(line: 6, scope: !8)