xref: /aosp_15_r20/external/llvm/test/DebugInfo/COFF/inlining-padding.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -filetype=obj -o - | llvm-readobj -codeview -codeview-subsection-bytes | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Check how we pad out the LF_FUNC_ID records. The 00F3F2F1 bytes in LeafData are
4*9880d681SAndroid Build Coastguard Worker; what's interesting here.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; CHECK:  FuncId (0x1002) {
7*9880d681SAndroid Build Coastguard Worker; CHECK:    TypeLeafKind: LF_FUNC_ID (0x1601)
8*9880d681SAndroid Build Coastguard Worker; CHECK:    Name: a
9*9880d681SAndroid Build Coastguard Worker; CHECK:    LeafData (
10*9880d681SAndroid Build Coastguard Worker; CHECK:      0000: {{.*}} 6100F2F1           |........a...|
11*9880d681SAndroid Build Coastguard Worker; CHECK:    )
12*9880d681SAndroid Build Coastguard Worker; CHECK:  }
13*9880d681SAndroid Build Coastguard Worker; CHECK:  FuncId (0x1003) {
14*9880d681SAndroid Build Coastguard Worker; CHECK:    TypeLeafKind: LF_FUNC_ID (0x1601)
15*9880d681SAndroid Build Coastguard Worker; CHECK:    Name: ab
16*9880d681SAndroid Build Coastguard Worker; CHECK:    LeafData (
17*9880d681SAndroid Build Coastguard Worker; CHECK:      0000: {{.*}} 616200F1           |........ab..|
18*9880d681SAndroid Build Coastguard Worker; CHECK:    )
19*9880d681SAndroid Build Coastguard Worker; CHECK:  }
20*9880d681SAndroid Build Coastguard Worker; CHECK:  FuncId (0x1004) {
21*9880d681SAndroid Build Coastguard Worker; CHECK:    TypeLeafKind: LF_FUNC_ID (0x1601)
22*9880d681SAndroid Build Coastguard Worker; CHECK:    Name: abc
23*9880d681SAndroid Build Coastguard Worker; CHECK:    LeafData (
24*9880d681SAndroid Build Coastguard Worker; CHECK:      0000: {{.*}} 61626300           |........abc.|
25*9880d681SAndroid Build Coastguard Worker; CHECK:    )
26*9880d681SAndroid Build Coastguard Worker; CHECK:  }
27*9880d681SAndroid Build Coastguard Worker; CHECK:  FuncId (0x1005) {
28*9880d681SAndroid Build Coastguard Worker; CHECK:    TypeLeafKind: LF_FUNC_ID (0x1601)
29*9880d681SAndroid Build Coastguard Worker; CHECK:    Name: abcd
30*9880d681SAndroid Build Coastguard Worker; CHECK:    LeafData (
31*9880d681SAndroid Build Coastguard Worker; CHECK:      0000: {{.*}} 61626364 00F3F2F1  |........abcd....|
32*9880d681SAndroid Build Coastguard Worker; CHECK:    )
33*9880d681SAndroid Build Coastguard Worker; CHECK:  }
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Worker; C++ source used to generate the IR:
36*9880d681SAndroid Build Coastguard Worker;
37*9880d681SAndroid Build Coastguard Worker; extern volatile int x;
38*9880d681SAndroid Build Coastguard Worker; static void a() { x++; }
39*9880d681SAndroid Build Coastguard Worker; static void ab() { x++; }
40*9880d681SAndroid Build Coastguard Worker; static void abc() { x++; }
41*9880d681SAndroid Build Coastguard Worker; static void abcd() { x++; }
42*9880d681SAndroid Build Coastguard Worker; int main() {
43*9880d681SAndroid Build Coastguard Worker;   a();
44*9880d681SAndroid Build Coastguard Worker;   ab();
45*9880d681SAndroid Build Coastguard Worker;   abc();
46*9880d681SAndroid Build Coastguard Worker;   abcd();
47*9880d681SAndroid Build Coastguard Worker; }
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Worker; ModuleID = 't.cpp'
50*9880d681SAndroid Build Coastguard Workersource_filename = "t.cpp"
51*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
52*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-pc-windows-msvc"
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Worker@x = external global i32, align 4
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard Worker; Function Attrs: norecurse nounwind
57*9880d681SAndroid Build Coastguard Workerdefine i32 @main() #0 !dbg !6 {
58*9880d681SAndroid Build Coastguard Workerentry:
59*9880d681SAndroid Build Coastguard Worker  store volatile i32 0, i32* @x, align 4, !dbg !11, !tbaa !16
60*9880d681SAndroid Build Coastguard Worker  store volatile i32 0, i32* @x, align 4, !dbg !20, !tbaa !16
61*9880d681SAndroid Build Coastguard Worker  store volatile i32 0, i32* @x, align 4, !dbg !23, !tbaa !16
62*9880d681SAndroid Build Coastguard Worker  store volatile i32 0, i32* @x, align 4, !dbg !26, !tbaa !16
63*9880d681SAndroid Build Coastguard Worker  ret i32 0, !dbg !29
64*9880d681SAndroid Build Coastguard Worker}
65*9880d681SAndroid Build Coastguard Worker
66*9880d681SAndroid Build Coastguard Workerattributes #0 = { norecurse nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-features"="+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
67*9880d681SAndroid Build Coastguard Worker
68*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
69*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!3, !4}
70*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!5}
71*9880d681SAndroid Build Coastguard Worker
72*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 270461) (llvm/trunk 270469)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
73*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "<stdin>", directory: "D:\5Csrc\5Cllvm\5Cbuild")
74*9880d681SAndroid Build Coastguard Worker!2 = !{}
75*9880d681SAndroid Build Coastguard Worker!3 = !{i32 2, !"CodeView", i32 1}
76*9880d681SAndroid Build Coastguard Worker!4 = !{i32 2, !"Debug Info Version", i32 3}
77*9880d681SAndroid Build Coastguard Worker!5 = !{!"clang version 3.9.0 (trunk 270461) (llvm/trunk 270469)"}
78*9880d681SAndroid Build Coastguard Worker!6 = distinct !DISubprogram(name: "main", scope: !7, file: !7, line: 6, type: !8, isLocal: false, isDefinition: true, scopeLine: 6, isOptimized: true, unit: !0, variables: !2)
79*9880d681SAndroid Build Coastguard Worker!7 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
80*9880d681SAndroid Build Coastguard Worker!8 = !DISubroutineType(types: !9)
81*9880d681SAndroid Build Coastguard Worker!9 = !{!10}
82*9880d681SAndroid Build Coastguard Worker!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
83*9880d681SAndroid Build Coastguard Worker!11 = !DILocation(line: 2, scope: !12, inlinedAt: !15)
84*9880d681SAndroid Build Coastguard Worker!12 = distinct !DISubprogram(name: "a", scope: !7, file: !7, line: 2, type: !13, isLocal: true, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !0, variables: !2)
85*9880d681SAndroid Build Coastguard Worker!13 = !DISubroutineType(types: !14)
86*9880d681SAndroid Build Coastguard Worker!14 = !{null}
87*9880d681SAndroid Build Coastguard Worker!15 = distinct !DILocation(line: 7, scope: !6)
88*9880d681SAndroid Build Coastguard Worker!16 = !{!17, !17, i64 0}
89*9880d681SAndroid Build Coastguard Worker!17 = !{!"int", !18, i64 0}
90*9880d681SAndroid Build Coastguard Worker!18 = !{!"omnipotent char", !19, i64 0}
91*9880d681SAndroid Build Coastguard Worker!19 = !{!"Simple C/C++ TBAA"}
92*9880d681SAndroid Build Coastguard Worker!20 = !DILocation(line: 3, scope: !21, inlinedAt: !22)
93*9880d681SAndroid Build Coastguard Worker!21 = distinct !DISubprogram(name: "ab", scope: !7, file: !7, line: 3, type: !13, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, variables: !2)
94*9880d681SAndroid Build Coastguard Worker!22 = distinct !DILocation(line: 8, scope: !6)
95*9880d681SAndroid Build Coastguard Worker!23 = !DILocation(line: 4, scope: !24, inlinedAt: !25)
96*9880d681SAndroid Build Coastguard Worker!24 = distinct !DISubprogram(name: "abc", scope: !7, file: !7, line: 4, type: !13, isLocal: true, isDefinition: true, scopeLine: 4, isOptimized: true, unit: !0, variables: !2)
97*9880d681SAndroid Build Coastguard Worker!25 = distinct !DILocation(line: 9, scope: !6)
98*9880d681SAndroid Build Coastguard Worker!26 = !DILocation(line: 5, scope: !27, inlinedAt: !28)
99*9880d681SAndroid Build Coastguard Worker!27 = distinct !DISubprogram(name: "abcd", scope: !7, file: !7, line: 5, type: !13, isLocal: true, isDefinition: true, scopeLine: 5, isOptimized: true, unit: !0, variables: !2)
100*9880d681SAndroid Build Coastguard Worker!28 = distinct !DILocation(line: 10, scope: !6)
101*9880d681SAndroid Build Coastguard Worker!29 = !DILocation(line: 11, scope: !6)
102