xref: /aosp_15_r20/external/llvm/test/DebugInfo/Generic/member-order.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; REQUIRES: object-emission
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; generated by clang from:
6*9880d681SAndroid Build Coastguard Worker; struct foo {
7*9880d681SAndroid Build Coastguard Worker;   void f1();
8*9880d681SAndroid Build Coastguard Worker;   void f2();
9*9880d681SAndroid Build Coastguard Worker; };
10*9880d681SAndroid Build Coastguard Worker;
11*9880d681SAndroid Build Coastguard Worker; void foo::f1() {
12*9880d681SAndroid Build Coastguard Worker; }
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_structure_type
15*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: DW_AT_name {{.*}} "foo"
16*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: NULL
17*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_subprogram
18*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: NULL
19*9880d681SAndroid Build Coastguard Worker; CHECK: DW_AT_name {{.*}} "f1"
20*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_subprogram
21*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: NULL
22*9880d681SAndroid Build Coastguard Worker; CHECK: DW_AT_name {{.*}} "f2"
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker%struct.foo = type { i8 }
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind uwtable
28*9880d681SAndroid Build Coastguard Workerdefine void @_ZN3foo2f1Ev(%struct.foo* %this) #0 align 2 !dbg !14 {
29*9880d681SAndroid Build Coastguard Workerentry:
30*9880d681SAndroid Build Coastguard Worker  %this.addr = alloca %struct.foo*, align 8
31*9880d681SAndroid Build Coastguard Worker  store %struct.foo* %this, %struct.foo** %this.addr, align 8
32*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata %struct.foo** %this.addr, metadata !16, metadata !DIExpression()), !dbg !18
33*9880d681SAndroid Build Coastguard Worker  %this1 = load %struct.foo*, %struct.foo** %this.addr
34*9880d681SAndroid Build Coastguard Worker  ret void, !dbg !19
35*9880d681SAndroid Build Coastguard Worker}
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind readnone
38*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.declare(metadata, metadata, metadata) #1
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
41*9880d681SAndroid Build Coastguard Workerattributes #1 = { nounwind readnone }
42*9880d681SAndroid Build Coastguard Worker
43*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
44*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!15, !20}
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)
47*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "member-order.cpp", directory: "/tmp/dbginfo")
48*9880d681SAndroid Build Coastguard Worker!2 = !{}
49*9880d681SAndroid Build Coastguard Worker!3 = !{!4}
50*9880d681SAndroid Build Coastguard Worker!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS3foo")
51*9880d681SAndroid Build Coastguard Worker!5 = !{!6, !11}
52*9880d681SAndroid Build Coastguard Worker!6 = !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !4, type: !7)
53*9880d681SAndroid Build Coastguard Worker!7 = !DISubroutineType(types: !8)
54*9880d681SAndroid Build Coastguard Worker!8 = !{null, !9}
55*9880d681SAndroid Build Coastguard Worker!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)
56*9880d681SAndroid Build Coastguard Worker!10 = !{i32 786468}
57*9880d681SAndroid Build Coastguard Worker!11 = !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !4, type: !7)
58*9880d681SAndroid Build Coastguard Worker!12 = !{i32 786468}
59*9880d681SAndroid Build Coastguard Worker!14 = distinct !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: null, type: !7, declaration: !6, variables: !2)
60*9880d681SAndroid Build Coastguard Worker!15 = !{i32 2, !"Dwarf Version", i32 4}
61*9880d681SAndroid Build Coastguard Worker!16 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !14, type: !17)
62*9880d681SAndroid Build Coastguard Worker!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)
63*9880d681SAndroid Build Coastguard Worker!18 = !DILocation(line: 0, scope: !14)
64*9880d681SAndroid Build Coastguard Worker!19 = !DILocation(line: 7, scope: !14)
65*9880d681SAndroid Build Coastguard Worker!20 = !{i32 1, !"Debug Info Version", i32 3}
66