xref: /aosp_15_r20/external/llvm/test/DebugInfo/Generic/2010-03-24-MemberFn.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: %llc_dwarf -O0 < %s | grep AT_decl_file |  grep 2
2*9880d681SAndroid Build Coastguard Worker; Here _ZN1S3fooEv is defined in header file identified as AT_decl_file no. 2 in debug info.
3*9880d681SAndroid Build Coastguard Worker%struct.S = type <{ i8 }>
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdefine i32 @_Z3barv() nounwind ssp !dbg !3 {
6*9880d681SAndroid Build Coastguard Workerentry:
7*9880d681SAndroid Build Coastguard Worker  %retval = alloca i32                            ; <i32*> [#uses=2]
8*9880d681SAndroid Build Coastguard Worker  %0 = alloca i32                                 ; <i32*> [#uses=2]
9*9880d681SAndroid Build Coastguard Worker  %s1 = alloca %struct.S                          ; <%struct.S*> [#uses=1]
10*9880d681SAndroid Build Coastguard Worker  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
11*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata %struct.S* %s1, metadata !0, metadata !DIExpression()), !dbg !16
12*9880d681SAndroid Build Coastguard Worker  %1 = call i32 @_ZN1S3fooEv(%struct.S* %s1) nounwind, !dbg !17 ; <i32> [#uses=1]
13*9880d681SAndroid Build Coastguard Worker  store i32 %1, i32* %0, align 4, !dbg !17
14*9880d681SAndroid Build Coastguard Worker  %2 = load i32, i32* %0, align 4, !dbg !17            ; <i32> [#uses=1]
15*9880d681SAndroid Build Coastguard Worker  store i32 %2, i32* %retval, align 4, !dbg !17
16*9880d681SAndroid Build Coastguard Worker  br label %return, !dbg !17
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerreturn:                                           ; preds = %entry
19*9880d681SAndroid Build Coastguard Worker  %retval1 = load i32, i32* %retval, !dbg !17          ; <i32> [#uses=1]
20*9880d681SAndroid Build Coastguard Worker  ret i32 %retval1, !dbg !16
21*9880d681SAndroid Build Coastguard Worker}
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerdefine linkonce_odr i32 @_ZN1S3fooEv(%struct.S* %this) nounwind ssp align 2 !dbg !12 {
24*9880d681SAndroid Build Coastguard Workerentry:
25*9880d681SAndroid Build Coastguard Worker  %this_addr = alloca %struct.S*                  ; <%struct.S**> [#uses=1]
26*9880d681SAndroid Build Coastguard Worker  %retval = alloca i32                            ; <i32*> [#uses=1]
27*9880d681SAndroid Build Coastguard Worker  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
28*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata %struct.S** %this_addr, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !21
29*9880d681SAndroid Build Coastguard Worker  store %struct.S* %this, %struct.S** %this_addr
30*9880d681SAndroid Build Coastguard Worker  br label %return, !dbg !21
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerreturn:                                           ; preds = %entry
33*9880d681SAndroid Build Coastguard Worker  %retval1 = load i32, i32* %retval, !dbg !21          ; <i32> [#uses=1]
34*9880d681SAndroid Build Coastguard Worker  ret i32 %retval1, !dbg !22
35*9880d681SAndroid Build Coastguard Worker}
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!5}
40*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!28}
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Worker!0 = !DILocalVariable(name: "s1", line: 3, scope: !1, file: !4, type: !9)
43*9880d681SAndroid Build Coastguard Worker!1 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !2)
44*9880d681SAndroid Build Coastguard Worker!2 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !3)
45*9880d681SAndroid Build Coastguard Worker!3 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !5, scopeLine: 3, file: !25, scope: !4, type: !6)
46*9880d681SAndroid Build Coastguard Worker!4 = !DIFile(filename: "one.cc", directory: "/tmp/")
47*9880d681SAndroid Build Coastguard Worker!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !25, enums: !27, retainedTypes: !27, imports:  null)
48*9880d681SAndroid Build Coastguard Worker!6 = !DISubroutineType(types: !7)
49*9880d681SAndroid Build Coastguard Worker!7 = !{!8}
50*9880d681SAndroid Build Coastguard Worker!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
51*9880d681SAndroid Build Coastguard Worker!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", line: 2, size: 8, align: 8, file: !26, scope: !4, elements: !11)
52*9880d681SAndroid Build Coastguard Worker!10 = !DIFile(filename: "one.h", directory: "/tmp/")
53*9880d681SAndroid Build Coastguard Worker!11 = !{!12}
54*9880d681SAndroid Build Coastguard Worker!12 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1S3fooEv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !5, scopeLine: 3, file: !26, scope: !9, type: !13)
55*9880d681SAndroid Build Coastguard Worker!13 = !DISubroutineType(types: !14)
56*9880d681SAndroid Build Coastguard Worker!14 = !{!8, !15}
57*9880d681SAndroid Build Coastguard Worker!15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !9)
58*9880d681SAndroid Build Coastguard Worker!16 = !DILocation(line: 3, scope: !1)
59*9880d681SAndroid Build Coastguard Worker!17 = !DILocation(line: 3, scope: !3)
60*9880d681SAndroid Build Coastguard Worker; Modified from being a pointer, to make this testcase independent of target pointer size
61*9880d681SAndroid Build Coastguard Worker!18 = !DILocalVariable(name: "this", line: 3, arg: 1, scope: !12, file: !10, type: !9)
62*9880d681SAndroid Build Coastguard Worker!19 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !20)
63*9880d681SAndroid Build Coastguard Worker!20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !25, scope: !4, baseType: !9)
64*9880d681SAndroid Build Coastguard Worker!21 = !DILocation(line: 3, scope: !12)
65*9880d681SAndroid Build Coastguard Worker!22 = !DILocation(line: 3, scope: !23)
66*9880d681SAndroid Build Coastguard Worker!23 = distinct !DILexicalBlock(line: 3, column: 0, file: !26, scope: !12)
67*9880d681SAndroid Build Coastguard Worker!25 = !DIFile(filename: "one.cc", directory: "/tmp/")
68*9880d681SAndroid Build Coastguard Worker!26 = !DIFile(filename: "one.h", directory: "/tmp/")
69*9880d681SAndroid Build Coastguard Worker!27 = !{}
70*9880d681SAndroid Build Coastguard Worker!28 = !{i32 1, !"Debug Info Version", i32 3}
71