d0fd23963c24dbdabd57073135a9f8bbecaf2f4c
[oota-llvm.git] / test / tools / dsymutil / Inputs / odr3.ll
1 ; Generated from odr3.cpp and odr-types.h by running:
2 ; clang -emit-llvm -g -S -std=c++11 odr3.cpp
3 ; ModuleID = 'odr3.cpp'
4 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx10.11.0"
6
7 %struct.S = type { i32, %"struct.S::Nested" }
8 %"struct.S::Nested" = type { double }
9
10 ; Function Attrs: ssp uwtable
11 define i32 @_Z3barv() #0 {
12 entry:
13   %this.addr.i = alloca %struct.S*, align 8
14   %Add.addr.i = alloca i32, align 4
15   %s = alloca %struct.S, align 8
16   call void @llvm.dbg.declare(metadata %struct.S* %s, metadata !34, metadata !35), !dbg !36
17   store %struct.S* %s, %struct.S** %this.addr.i, align 8, !dbg !37
18   store i32 42, i32* %Add.addr.i, align 4, !dbg !37
19   %this1.i = load %struct.S*, %struct.S** %this.addr.i, !dbg !37
20   %0 = load i32, i32* %Add.addr.i, align 4, !dbg !38
21   %I.i = getelementptr inbounds %struct.S, %struct.S* %this1.i, i32 0, i32 0, !dbg !40
22   %1 = load i32, i32* %I.i, align 4, !dbg !41
23   %add.i = add nsw i32 %1, %0, !dbg !41
24   store i32 %add.i, i32* %I.i, align 4, !dbg !41
25   %call = call i32 @_ZN1S3fooEv(%struct.S* %s), !dbg !42
26   call void @llvm.dbg.declare(metadata %struct.S** %this.addr.i, metadata !43, metadata !35), !dbg !45
27   call void @llvm.dbg.declare(metadata i32* %Add.addr.i, metadata !46, metadata !35), !dbg !47
28   ret i32 %call, !dbg !48
29 }
30
31 ; Function Attrs: nounwind readnone
32 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
33
34 ; Function Attrs: nounwind ssp uwtable
35 define linkonce_odr i32 @_ZN1S3fooEv(%struct.S* %this) #2 align 2 {
36 entry:
37   %this.addr = alloca %struct.S*, align 8
38   store %struct.S* %this, %struct.S** %this.addr, align 8
39   call void @llvm.dbg.declare(metadata %struct.S** %this.addr, metadata !49, metadata !35), !dbg !50
40   %this1 = load %struct.S*, %struct.S** %this.addr
41   %I = getelementptr inbounds %struct.S, %struct.S* %this1, i32 0, i32 0, !dbg !51
42   %0 = load i32, i32* %I, align 4, !dbg !51
43   ret i32 %0, !dbg !52
44 }
45
46 attributes #0 = { ssp uwtable "disable-tail-calls"="false" "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" "target-cpu"="core2" "target-features"="+cx16,+sse,+sse2,+sse3,+ssse3" "unsafe-fp-math"="false" "use-soft-float"="false" }
47 attributes #1 = { nounwind readnone }
48 attributes #2 = { nounwind ssp uwtable "disable-tail-calls"="false" "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" "target-cpu"="core2" "target-features"="+cx16,+sse,+sse2,+sse3,+ssse3" "unsafe-fp-math"="false" "use-soft-float"="false" }
49
50 !llvm.dbg.cu = !{!0}
51 !llvm.module.flags = !{!30, !31, !32}
52 !llvm.ident = !{!33}
53
54 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 242534)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !24)
55 !1 = !DIFile(filename: "odr3.cpp", directory: "/Inputs")
56 !2 = !{}
57 !3 = !{!4, !20}
58 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !5, line: 1, size: 128, align: 64, elements: !6, identifier: "_ZTS1S")
59 !5 = !DIFile(filename: "./odr-types.h", directory: "/Inputs")
60 !6 = !{!7, !9, !10, !14, !17}
61 !7 = !DIDerivedType(tag: DW_TAG_member, name: "I", scope: !"_ZTS1S", file: !5, line: 2, baseType: !8, size: 32, align: 32)
62 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
63 !9 = !DIDerivedType(tag: DW_TAG_member, name: "D", scope: !"_ZTS1S", file: !5, line: 15, baseType: !"_ZTSN1S6NestedE", size: 64, align: 64, offset: 64)
64 !10 = !DISubprogram(name: "incr", linkageName: "_ZN1S4incrEv", scope: !"_ZTS1S", file: !5, line: 4, type: !11, isLocal: false, isDefinition: false, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false)
65 !11 = !DISubroutineType(types: !12)
66 !12 = !{null, !13}
67 !13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1S", size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
68 !14 = !DISubprogram(name: "incr", linkageName: "_ZN1S4incrEi", scope: !"_ZTS1S", file: !5, line: 5, type: !15, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false)
69 !15 = !DISubroutineType(types: !16)
70 !16 = !{null, !13, !8}
71 !17 = !DISubprogram(name: "foo", linkageName: "_ZN1S3fooEv", scope: !"_ZTS1S", file: !5, line: 18, type: !18, isLocal: false, isDefinition: false, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: false)
72 !18 = !DISubroutineType(types: !19)
73 !19 = !{!8, !13}
74 !20 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nested", scope: !"_ZTS1S", file: !5, line: 9, size: 64, align: 64, elements: !21, identifier: "_ZTSN1S6NestedE")
75 !21 = !{!22}
76 !22 = !DIDerivedType(tag: DW_TAG_member, name: "D", scope: !"_ZTSN1S6NestedE", file: !5, line: 10, baseType: !23, size: 64, align: 64)
77 !23 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)
78 !24 = !{!25, !28, !29}
79 !25 = !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !1, file: !1, line: 3, type: !26, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @_Z3barv, variables: !2)
80 !26 = !DISubroutineType(types: !27)
81 !27 = !{!8}
82 !28 = !DISubprogram(name: "incr", linkageName: "_ZN1S4incrEi", scope: !"_ZTS1S", file: !5, line: 5, type: !15, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, declaration: !14, variables: !2)
83 !29 = !DISubprogram(name: "foo", linkageName: "_ZN1S3fooEv", scope: !"_ZTS1S", file: !5, line: 18, type: !18, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: false, function: i32 (%struct.S*)* @_ZN1S3fooEv, declaration: !17, variables: !2)
84 !30 = !{i32 2, !"Dwarf Version", i32 2}
85 !31 = !{i32 2, !"Debug Info Version", i32 3}
86 !32 = !{i32 1, !"PIC Level", i32 2}
87 !33 = !{!"clang version 3.8.0 (trunk 242534)"}
88 !34 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "s", scope: !25, file: !1, line: 4, type: !"_ZTS1S")
89 !35 = !DIExpression()
90 !36 = !DILocation(line: 4, column: 4, scope: !25)
91 !37 = !DILocation(line: 5, column: 2, scope: !25)
92 !38 = !DILocation(line: 5, column: 59, scope: !28, inlinedAt: !39)
93 !39 = distinct !DILocation(line: 5, column: 2, scope: !25)
94 !40 = !DILocation(line: 5, column: 54, scope: !28, inlinedAt: !39)
95 !41 = !DILocation(line: 5, column: 56, scope: !28, inlinedAt: !39)
96 !42 = !DILocation(line: 6, column: 9, scope: !25)
97 !43 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, scope: !28, type: !44, flags: DIFlagArtificial | DIFlagObjectPointer)
98 !44 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1S", size: 64, align: 64)
99 !45 = !DILocation(line: 0, scope: !28, inlinedAt: !39)
100 !46 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "Add", arg: 2, scope: !28, file: !5, line: 5, type: !8)
101 !47 = !DILocation(line: 5, column: 16, scope: !28, inlinedAt: !39)
102 !48 = !DILocation(line: 6, column: 2, scope: !25)
103 !49 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, scope: !29, type: !44, flags: DIFlagArtificial | DIFlagObjectPointer)
104 !50 = !DILocation(line: 0, scope: !29)
105 !51 = !DILocation(line: 18, column: 21, scope: !29)
106 !52 = !DILocation(line: 18, column: 14, scope: !29)