1; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s 2 3; Tests that CodeView integer types are generated even when using Clang's old integer type names. 4 5; C++ source to regenerate: 6; $ cat t.cpp 7; void usevars(long, ...); 8; void f() { 9; long l1 = 0; 10; unsigned long l2 = 0; 11; usevars(l1, l2); 12; } 13; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll -target x86_64-pc-windows-msvc19.0.23918 14 15; CHECK: LocalSym { 16; CHECK: Type: long (0x12) 17; CHECK: VarName: l1 18; CHECK: } 19; CHECK: LocalSym { 20; CHECK: Type: unsigned long (0x22) 21; CHECK: VarName: l2 22; CHECK: } 23 24; ModuleID = '/usr/local/google/home/blaikie/dev/scratch/t.cpp' 25source_filename = "/usr/local/google/home/blaikie/dev/scratch/t.cpp" 26target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 27target triple = "x86_64-pc-windows-msvc19.0.23918" 28 29; Function Attrs: mustprogress noinline optnone uwtable 30define dso_local void @"?f@@YAXXZ"() #0 !dbg !8 { 31entry: 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 41 ret void, !dbg !20 42} 43 44; Function Attrs: nofree nosync nounwind readnone speculatable willreturn 45declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 46 47declare dso_local void @"?usevars@@YAXJZZ"(i32, ...) #2 48 49attributes #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" } 50attributes #1 = { nofree nosync nounwind readnone speculatable willreturn } 51attributes #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" } 52 53!llvm.dbg.cu = !{!0} 54!llvm.module.flags = !{!2, !3, !4, !5, !6} 55!llvm.ident = !{!7} 56 57!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 14.0.0 ([email protected]: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 ([email protected]: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) 68!11 = !{null} 69!12 = !{} 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) 78