1; RUN: llc -mtriple=x86_64-windows-msvc < %s -filetype=obj | llvm-readobj -codeview - | FileCheck %s --check-prefix=OBJ 2 3; This LL file was generated by running 'clang -g -gcodeview' on the 4; following code: 5; void useint(int); 6; void constant_var() { 7; int x = 42; 8; useint(x); 9; useint(x); 10; } 11 12; FIXME: Find a way to describe variables optimized to constants. 13 14; OBJ: ProcStart { 15; OBJ: DisplayName: constant_var 16; OBJ: } 17; OBJ: Local { 18; OBJ-NEXT: Type: int (0x74) 19; OBJ-NEXT: Flags [ (0x100) 20; OBJ-NEXT: IsOptimizedOut (0x100) 21; OBJ-NEXT: ] 22; OBJ-NEXT: VarName: x 23; OBJ-NEXT: } 24; OBJ-NOT: DefRange 25; OBJ: ProcEnd 26 27; ModuleID = 't.cpp' 28target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" 29target triple = "x86_64-pc-windows-msvc18.0.0" 30 31; Function Attrs: nounwind uwtable 32define void @"\01?constant_var@@YAXXZ"() #0 !dbg !4 { 33entry: 34 tail call void @llvm.dbg.value(metadata i32 42, i64 0, metadata !8, metadata !14), !dbg !15 35 tail call void @"\01?useint@@YAXH@Z"(i32 42) #3, !dbg !16 36 tail call void @"\01?useint@@YAXH@Z"(i32 42) #3, !dbg !17 37 ret void, !dbg !18 38} 39 40declare void @"\01?useint@@YAXH@Z"(i32) #1 41 42; Function Attrs: nounwind readnone 43declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 44 45attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } 46attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } 47attributes #2 = { nounwind readnone } 48attributes #3 = { nounwind } 49 50!llvm.dbg.cu = !{!0} 51!llvm.module.flags = !{!10, !11, !12} 52!llvm.ident = !{!13} 53 54!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 260957)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 55!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild") 56!2 = !{} 57!4 = distinct !DISubprogram(name: "constant_var", linkageName: "\01?constant_var@@YAXXZ", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !7) 58!5 = !DISubroutineType(types: !6) 59!6 = !{null} 60!7 = !{!8} 61!8 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 3, type: !9) 62!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 63!10 = !{i32 2, !"CodeView", i32 1} 64!11 = !{i32 2, !"Debug Info Version", i32 3} 65!12 = !{i32 1, !"PIC Level", i32 2} 66!13 = !{!"clang version 3.9.0 (trunk 260957)"} 67!14 = !DIExpression() 68!15 = !DILocation(line: 3, column: 7, scope: !4) 69!16 = !DILocation(line: 4, column: 3, scope: !4) 70!17 = !DILocation(line: 5, column: 3, scope: !4) 71!18 = !DILocation(line: 6, column: 1, scope: !4) 72