xref: /llvm-project/llvm/test/DebugInfo/COFF/local-constant.ll (revision 2298a44ccdc1a9babcb2712a0019d064b3cecd5a)
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; OBJ:        {{.*}}Proc{{.*}}Sym {
13; OBJ:           DisplayName: constant_var
14; OBJ:         }
15; OBJ:         ConstantSym {
16; OBJ-NEXT:      Kind: S_CONSTANT
17; OBJ-NEXT:      Type: int (0x74)
18; OBJ-NEXT:      Value: 42
19; OBJ-NEXT:      Name: x
20; OBJ-NEXT:    }
21; OBJ-NOT:     DefRange
22; OBJ:         ProcEnd
23
24; ModuleID = 't.cpp'
25target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
26target triple = "x86_64-pc-windows-msvc18.0.0"
27
28; Function Attrs: nounwind uwtable
29define void @"\01?constant_var@@YAXXZ"() #0 !dbg !4 {
30entry:
31  tail call void @llvm.dbg.value(metadata i32 42, metadata !8, metadata !14), !dbg !15
32  tail call void @"\01?useint@@YAXH@Z"(i32 42) #3, !dbg !16
33  tail call void @"\01?useint@@YAXH@Z"(i32 42) #3, !dbg !17
34  ret void, !dbg !18
35}
36
37declare void @"\01?useint@@YAXH@Z"(i32) #1
38
39; Function Attrs: nounwind readnone
40declare void @llvm.dbg.value(metadata, metadata, metadata) #2
41
42attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" }
43attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" }
44attributes #2 = { nounwind readnone }
45attributes #3 = { nounwind }
46
47!llvm.dbg.cu = !{!0}
48!llvm.module.flags = !{!10, !11, !12}
49!llvm.ident = !{!13}
50
51!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)
52!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
53!2 = !{}
54!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, retainedNodes: !7)
55!5 = !DISubroutineType(types: !6)
56!6 = !{null}
57!7 = !{!8}
58!8 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 3, type: !9)
59!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
60!10 = !{i32 2, !"CodeView", i32 1}
61!11 = !{i32 2, !"Debug Info Version", i32 3}
62!12 = !{i32 1, !"PIC Level", i32 2}
63!13 = !{!"clang version 3.9.0 (trunk 260957)"}
64!14 = !DIExpression()
65!15 = !DILocation(line: 3, column: 7, scope: !4)
66!16 = !DILocation(line: 4, column: 3, scope: !4)
67!17 = !DILocation(line: 5, column: 3, scope: !4)
68!18 = !DILocation(line: 6, column: 1, scope: !4)
69