xref: /aosp_15_r20/external/llvm/test/DebugInfo/COFF/local-constant.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-windows-msvc < %s -filetype=obj | llvm-readobj -codeview - | FileCheck %s --check-prefix=OBJ
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; This LL file was generated by running 'clang -g -gcodeview' on the
4*9880d681SAndroid Build Coastguard Worker; following code:
5*9880d681SAndroid Build Coastguard Worker; void useint(int);
6*9880d681SAndroid Build Coastguard Worker; void constant_var() {
7*9880d681SAndroid Build Coastguard Worker;   int x = 42;
8*9880d681SAndroid Build Coastguard Worker;   useint(x);
9*9880d681SAndroid Build Coastguard Worker;   useint(x);
10*9880d681SAndroid Build Coastguard Worker; }
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; FIXME: Find a way to describe variables optimized to constants.
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker; OBJ:        ProcStart {
15*9880d681SAndroid Build Coastguard Worker; OBJ:           DisplayName: constant_var
16*9880d681SAndroid Build Coastguard Worker; OBJ:         }
17*9880d681SAndroid Build Coastguard Worker; OBJ:         Local {
18*9880d681SAndroid Build Coastguard Worker; OBJ-NEXT:      Type: int (0x74)
19*9880d681SAndroid Build Coastguard Worker; OBJ-NEXT:      Flags [ (0x100)
20*9880d681SAndroid Build Coastguard Worker; OBJ-NEXT:        IsOptimizedOut (0x100)
21*9880d681SAndroid Build Coastguard Worker; OBJ-NEXT:      ]
22*9880d681SAndroid Build Coastguard Worker; OBJ-NEXT:      VarName: x
23*9880d681SAndroid Build Coastguard Worker; OBJ-NEXT:    }
24*9880d681SAndroid Build Coastguard Worker; OBJ-NOT:     DefRange
25*9880d681SAndroid Build Coastguard Worker; OBJ:         ProcEnd
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker; ModuleID = 't.cpp'
28*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
29*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-pc-windows-msvc18.0.0"
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind uwtable
32*9880d681SAndroid Build Coastguard Workerdefine void @"\01?constant_var@@YAXXZ"() #0 !dbg !4 {
33*9880d681SAndroid Build Coastguard Workerentry:
34*9880d681SAndroid Build Coastguard Worker  tail call void @llvm.dbg.value(metadata i32 42, i64 0, metadata !8, metadata !14), !dbg !15
35*9880d681SAndroid Build Coastguard Worker  tail call void @"\01?useint@@YAXH@Z"(i32 42) #3, !dbg !16
36*9880d681SAndroid Build Coastguard Worker  tail call void @"\01?useint@@YAXH@Z"(i32 42) #3, !dbg !17
37*9880d681SAndroid Build Coastguard Worker  ret void, !dbg !18
38*9880d681SAndroid Build Coastguard Worker}
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Workerdeclare void @"\01?useint@@YAXH@Z"(i32) #1
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind readnone
43*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Workerattributes #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" }
46*9880d681SAndroid Build Coastguard Workerattributes #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" }
47*9880d681SAndroid Build Coastguard Workerattributes #2 = { nounwind readnone }
48*9880d681SAndroid Build Coastguard Workerattributes #3 = { nounwind }
49*9880d681SAndroid Build Coastguard Worker
50*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
51*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!10, !11, !12}
52*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!13}
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Worker!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*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
56*9880d681SAndroid Build Coastguard Worker!2 = !{}
57*9880d681SAndroid Build Coastguard Worker!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*9880d681SAndroid Build Coastguard Worker!5 = !DISubroutineType(types: !6)
59*9880d681SAndroid Build Coastguard Worker!6 = !{null}
60*9880d681SAndroid Build Coastguard Worker!7 = !{!8}
61*9880d681SAndroid Build Coastguard Worker!8 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 3, type: !9)
62*9880d681SAndroid Build Coastguard Worker!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
63*9880d681SAndroid Build Coastguard Worker!10 = !{i32 2, !"CodeView", i32 1}
64*9880d681SAndroid Build Coastguard Worker!11 = !{i32 2, !"Debug Info Version", i32 3}
65*9880d681SAndroid Build Coastguard Worker!12 = !{i32 1, !"PIC Level", i32 2}
66*9880d681SAndroid Build Coastguard Worker!13 = !{!"clang version 3.9.0 (trunk 260957)"}
67*9880d681SAndroid Build Coastguard Worker!14 = !DIExpression()
68*9880d681SAndroid Build Coastguard Worker!15 = !DILocation(line: 3, column: 7, scope: !4)
69*9880d681SAndroid Build Coastguard Worker!16 = !DILocation(line: 4, column: 3, scope: !4)
70*9880d681SAndroid Build Coastguard Worker!17 = !DILocation(line: 5, column: 3, scope: !4)
71*9880d681SAndroid Build Coastguard Worker!18 = !DILocation(line: 6, column: 1, scope: !4)
72