blob: 7ad328c63f11706d21707898f05e4803a4178fc6 [file] [log] [blame]
Manman Rene9a52e12013-07-29 18:12:58 +00001; RUN: llc -O0 -fast-isel=false < %s | FileCheck %s
Devang Patel734f2212011-04-25 16:33:52 +00002target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
3target triple = "x86_64-apple-macosx10.6.7"
4;Radar 9321650
5
6;CHECK: ##DEBUG_VALUE: my_a
7
8%class.A = type { i32, i32, i32, i32 }
9
10define void @_Z3fooi(%class.A* sret %agg.result, i32 %i) ssp {
11entry:
12 %i.addr = alloca i32, align 4
13 %j = alloca i32, align 4
14 %nrvo = alloca i1
15 %cleanup.dest.slot = alloca i32
16 store i32 %i, i32* %i.addr, align 4
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000017 call void @llvm.dbg.declare(metadata i32* %i.addr, metadata !26, metadata !{!"0x102"}), !dbg !27
18 call void @llvm.dbg.declare(metadata i32* %j, metadata !28, metadata !{!"0x102"}), !dbg !30
Devang Patel734f2212011-04-25 16:33:52 +000019 store i32 0, i32* %j, align 4, !dbg !31
20 %tmp = load i32* %i.addr, align 4, !dbg !32
21 %cmp = icmp eq i32 %tmp, 42, !dbg !32
22 br i1 %cmp, label %if.then, label %if.end, !dbg !32
23
24if.then: ; preds = %entry
25 %tmp1 = load i32* %i.addr, align 4, !dbg !33
26 %add = add nsw i32 %tmp1, 1, !dbg !33
27 store i32 %add, i32* %j, align 4, !dbg !33
28 br label %if.end, !dbg !35
29
30if.end: ; preds = %if.then, %entry
31 store i1 false, i1* %nrvo, !dbg !36
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000032 call void @llvm.dbg.declare(metadata %class.A* %agg.result, metadata !37, metadata !{!"0x102"}), !dbg !39
Devang Patel734f2212011-04-25 16:33:52 +000033 %tmp2 = load i32* %j, align 4, !dbg !40
34 %x = getelementptr inbounds %class.A* %agg.result, i32 0, i32 0, !dbg !40
35 store i32 %tmp2, i32* %x, align 4, !dbg !40
36 store i1 true, i1* %nrvo, !dbg !41
37 store i32 1, i32* %cleanup.dest.slot
38 %nrvo.val = load i1* %nrvo, !dbg !42
39 br i1 %nrvo.val, label %nrvo.skipdtor, label %nrvo.unused, !dbg !42
40
41nrvo.unused: ; preds = %if.end
42 call void @_ZN1AD1Ev(%class.A* %agg.result), !dbg !42
43 br label %nrvo.skipdtor, !dbg !42
44
45nrvo.skipdtor: ; preds = %nrvo.unused, %if.end
46 ret void, !dbg !42
47}
48
Adrian Prantl87b7eb92014-10-01 18:55:02 +000049declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
Devang Patel734f2212011-04-25 16:33:52 +000050
51define linkonce_odr void @_ZN1AD1Ev(%class.A* %this) unnamed_addr ssp align 2 {
52entry:
53 %this.addr = alloca %class.A*, align 8
54 store %class.A* %this, %class.A** %this.addr, align 8
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000055 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !43, metadata !{!"0x102"}), !dbg !44
Devang Patel734f2212011-04-25 16:33:52 +000056 %this1 = load %class.A** %this.addr
57 call void @_ZN1AD2Ev(%class.A* %this1)
58 ret void, !dbg !45
59}
60
61define linkonce_odr void @_ZN1AD2Ev(%class.A* %this) unnamed_addr nounwind ssp align 2 {
62entry:
63 %this.addr = alloca %class.A*, align 8
64 store %class.A* %this, %class.A** %this.addr, align 8
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000065 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !46, metadata !{!"0x102"}), !dbg !47
Devang Patel734f2212011-04-25 16:33:52 +000066 %this1 = load %class.A** %this.addr
67 %x = getelementptr inbounds %class.A* %this1, i32 0, i32 0, !dbg !48
68 store i32 1, i32* %x, align 4, !dbg !48
69 ret void, !dbg !48
70}
71
David Blaikie47922fb2013-03-11 22:37:40 +000072!llvm.dbg.cu = !{!2}
Manman Ren409558f2013-11-22 21:49:45 +000073!llvm.module.flags = !{!52}
Devang Patel734f2212011-04-25 16:33:52 +000074
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000075!0 = !{!"0x2e\00~A\00~A\00\002\000\000\000\006\00256\000\000", !51, !1, !11, null, null, null, null, null} ; [ DW_TAG_subprogram ]
76!1 = !{!"0x2\00A\002\00128\0032\000\000\000", !51, !2, null, !4, null, null, null} ; [ DW_TAG_class_type ] [A] [line 2, size 128, align 32, offset 0] [def] [from ]
77!2 = !{!"0x11\004\00clang version 3.0 (trunk 130127)\000\00\000\00\001", !51, !24, !24, !50, null, null} ; [ DW_TAG_compile_unit ]
78!3 = !{!"0x29", !51} ; [ DW_TAG_file_type ]
79!4 = !{!5, !7, !8, !9, !0, !10, !14}
80!5 = !{!"0xd\00x\002\0032\0032\000\000", !51, !3, !6} ; [ DW_TAG_member ]
81!6 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !2} ; [ DW_TAG_base_type ]
82!7 = !{!"0xd\00y\002\0032\0032\0032\000", !51, !3, !6} ; [ DW_TAG_member ]
83!8 = !{!"0xd\00z\002\0032\0032\0064\000", !51, !3, !6} ; [ DW_TAG_member ]
84!9 = !{!"0xd\00o\002\0032\0032\0096\000", !51, !3, !6} ; [ DW_TAG_member ]
85!10 = !{!"0x2e\00A\00A\00\002\000\000\000\006\00320\000\000", !51, !1, !11, null, null, null, null, null} ; [ DW_TAG_subprogram ]
86!11 = !{!"0x15\00\000\000\000\000\000\000", !51, !3, null, !12, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
87!12 = !{null, !13}
88!13 = !{!"0xf\00\000\0064\0064\000\0064", !2, null, !1} ; [ DW_TAG_pointer_type ]
89!14 = !{!"0x2e\00A\00A\00\002\000\000\000\006\00320\000\000", !51, !1, !15, null, null, null, null, null} ; [ DW_TAG_subprogram ]
90!15 = !{!"0x15\00\000\000\000\000\000\000", !51, !3, null, !16, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
91!16 = !{null, !13, !17}
92!17 = !{!"0x10\00\000\000\000\000\000", null, !2, !18} ; [ DW_TAG_reference_type ]
93!18 = !{!"0x26\00\000\000\000\000\000", !2, null, !1} ; [ DW_TAG_const_type ]
94!19 = !{!"0x2e\00foo\00foo\00_Z3fooi\004\000\001\000\006\00256\000\000", !51, !3, !20, null, void (%class.A*, i32)* @_Z3fooi, null, null, null} ; [ DW_TAG_subprogram ] [line 4] [def] [scope 0] [foo]
95!20 = !{!"0x15\00\000\000\000\000\000\000", !51, !3, null, !21, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
96!21 = !{!1}
97!22 = !{!"0x2e\00~A\00~A\00_ZN1AD1Ev\002\000\001\000\006\00256\000\000", !51, !3, !23, null, void (%class.A*)* @_ZN1AD1Ev, null, null, null} ; [ DW_TAG_subprogram ] [line 2] [def] [scope 0] [~A]
98!23 = !{!"0x15\00\000\000\000\000\000\000", !51, !3, null, !24, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
99!24 = !{null}
100!25 = !{!"0x2e\00~A\00~A\00_ZN1AD2Ev\002\000\001\000\006\00256\000\000", !51, !3, !23, null, void (%class.A*)* @_ZN1AD2Ev, null, null, null} ; [ DW_TAG_subprogram ] [line 2] [def] [scope 0] [~A]
101!26 = !{!"0x101\00i\0016777220\000", !19, !3, !6} ; [ DW_TAG_arg_variable ]
102!27 = !{i32 4, i32 11, !19, null}
103!28 = !{!"0x100\00j\005\000", !29, !3, !6} ; [ DW_TAG_auto_variable ]
104!29 = !{!"0xb\004\0014\000", !51, !19} ; [ DW_TAG_lexical_block ]
105!30 = !{i32 5, i32 7, !29, null}
106!31 = !{i32 5, i32 12, !29, null}
107!32 = !{i32 6, i32 3, !29, null}
108!33 = !{i32 7, i32 5, !34, null}
109!34 = !{!"0xb\006\0016\001", !51, !29} ; [ DW_TAG_lexical_block ]
110!35 = !{i32 8, i32 3, !34, null}
111!36 = !{i32 9, i32 9, !29, null}
112!37 = !{!"0x100\00my_a\009\000", !29, !3, !38} ; [ DW_TAG_auto_variable ]
113!38 = !{!"0x10\00\000\000\000\000\000", !2, null, !1} ; [ DW_TAG_reference_type ]
114!39 = !{i32 9, i32 5, !29, null}
115!40 = !{i32 10, i32 3, !29, null}
116!41 = !{i32 11, i32 3, !29, null}
117!42 = !{i32 12, i32 1, !29, null}
118!43 = !{!"0x101\00this\0016777218\0064", !22, !3, !13} ; [ DW_TAG_arg_variable ]
119!44 = !{i32 2, i32 47, !22, null}
120!45 = !{i32 2, i32 61, !22, null}
121!46 = !{!"0x101\00this\0016777218\0064", !25, !3, !13} ; [ DW_TAG_arg_variable ]
122!47 = !{i32 2, i32 47, !25, null}
123!48 = !{i32 2, i32 54, !49, null}
124!49 = !{!"0xb\002\0052\002", !51, !25} ; [ DW_TAG_lexical_block ]
125!50 = !{!19, !22, !25}
126!51 = !{!"a.cc", !"/private/tmp"}
127!52 = !{i32 1, !"Debug Info Version", i32 2}